Skip to content

Stop showing a raw org id, and shut the proxy down on exit - #12

Merged
BeLazy167 merged 1 commit into
mainfrom
fix/account-confirm-and-proxy-cleanup
Aug 21, 2026
Merged

Stop showing a raw org id, and shut the proxy down on exit#12
BeLazy167 merged 1 commit into
mainfrom
fix/account-confirm-and-proxy-cleanup

Conversation

@BeLazy167

Copy link
Copy Markdown
Member

Both items from the first outside dogfood (Ryan in #software).

1. "the organization is the ID not the name"

Correct, and it turns out an API key cannot read its organization's name — verified against prod:

  • GET /organizations/currentMISSING_ORGANIZATION_CONTEXT (needs a JWT org context; the X-Organization-Id header isn't enough for key auth)
  • GET /organizationsUser authentication required (rejects key auth outright)
  • GET /organizations/me returns membership with no org name in it

So the old step asked a non-technical user to confirm 507f1f77bcf86cd799439011. It now shows plan (from /ai/quota) and credits, names the organization only when it actually resolves, and replaces the hex string with the sentence that helps: create a key under the org you want, here's the link.

The real fix — letting an API key resolve its own org name — is an api change; happy to file it separately if we want the name shown for key auth.

2. "if I quit does the gpt proxy shut off automatically?"

It didn't. Now: if the launcher started the proxy, it stops it on exit — including Ctrl+C and terminal close (trap ... EXIT INT TERM HUP). A proxy that was already running belongs to another session and is left alone. Windows .cmd does the same via the status/stop helper.

Verified live: a gpt session leaves zero cliproxyapi processes behind; a second run starts a fresh one and cleans up again.

Suites green (routing 6/6, shellcheck, bash 3.2 parse).

Both from the first outside dogfood (Ryan, #software):

- "the organization is the ID not the name which a user probably wouldn't
  recognize". An API key genuinely cannot read its organization's NAME:
  /organizations/current needs a JWT org context and /organizations rejects
  key auth (both verified against prod). So asking someone to confirm
  507f1f77bcf86cd799439011 was worse than not asking. The step now shows
  plan and credits, names the organization only when it resolves, and makes
  the escape hatch an actionable sentence instead of a hex string.

- "if I quit does the gpt proxy shut off automatically?" It didn't. When the
  launcher starts the proxy it now stops it on exit, including Ctrl+C and
  terminal close (trap). A proxy that was ALREADY running belongs to another
  session and is left alone.

Verified live: gpt session leaves no process behind, a second run starts a
fresh one.
@BeLazy167
BeLazy167 merged commit aaec78b into main Aug 21, 2026
6 checks passed
@BeLazy167
BeLazy167 deleted the fix/account-confirm-and-proxy-cleanup branch August 21, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant