An unofficial terminal client for Tangled, optimized for humans and agents. tgcli.wisp.place

Persist localhost OAuth client identity across refresh #70

Merged aly.codes
targeting master from cameron.stream/tg:fix/oauth-client-identity
Merged opened by and assigned to aly.codes
targeting master from cameron.stream/tg:fix/oauth-client-identity

Summary #

  • Persist the loopback OAuth client_id / callback URL on the keyring account at login.
  • Restore that identity before ResumeSession, so token refresh uses the same localhost client that minted the grant.
  • Keep those fields across token refresh, and stop mapping invalid_client_metadata to "Session expired".

ATProto localhost clients encode the redirect URI in client_id. tg auth login binds an ephemeral port, then later processes reconstructed NewLocalhostConfig("") and sent redirect_uri= on refresh. Bluesky returned HTTP 400 invalid_client_metadata, and tg auth status reported the still-present session as expired.

Existing sessions still need one tg auth login after this lands so the client identity is stored.

Test plan #

"There are only two hard things in Computer Science: cache invalidation and naming things." - Phil Karlton

Written by Cameron ◯ Letta Code

Commits 0