Repository navigation
feat(openai): register and reuse SIWC OAuth clients [SIWC 5/6] - #9
Open
stevenlee-oai wants to merge 1 commit into
Open
stevenlee-oai wants to merge 1 commit into
stevenlee-oai wants to merge 1 commit into
Conversation
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
from
September 22, 2026 00:38
5f9c988 to
3bbe7e7
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 22, 2026 00:38
05c2a9c to
b0a2c78
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
2 times, most recently
from
September 22, 2026 21:58
1c326a2 to
3c4e3a1
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 22, 2026 21:58
90944eb to
575680a
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
from
September 22, 2026 22:24
3c4e3a1 to
f76be61
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 22, 2026 22:24
575680a to
90d165a
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
from
September 22, 2026 23:08
f76be61 to
3f995f8
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 22, 2026 23:27
13abbc4 to
0314699
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
from
September 22, 2026 23:31
3f995f8 to
62337b5
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 22, 2026 23:49
0314699 to
d629a95
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
2 times, most recently
from
September 23, 2026 18:14
6263b84 to
842f944
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 23, 2026 18:14
d629a95 to
11a8af3
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
from
September 23, 2026 19:16
842f944 to
f0149dc
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 23, 2026 19:16
11a8af3 to
745abef
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-dynamic-client
branch
from
September 23, 2026 21:59
f0149dc to
eef42f7
Compare
stevenlee-oai
force-pushed
the
dev/stevenlee/siwc-status-endpoints
branch
from
September 23, 2026 21:59
745abef to
3b915bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Sign in with ChatGPT needs authorization-time client registration instead of a client ID baked into OpenClaw.
User Impact
New accounts start with
dynamic_agent_client; OpenClaw saves the returned client ID with the credential and reuses it for authorization, token exchange, and refresh. Reconnect defaults to the saved registration. Choose Connect a different ChatGPT account or workspace for a fresh registration; reconnect rejects an unexpected identity change.Requires OpenAI enablement of the dynamic-agent flow. Real registration, inference, and refresh against OpenAI remain unverified.
Why This Change Was Made
The callback validates the registered client ID and uses it as the verified ID-token audience. New registrations request
openid email profile resource.invoke chatgpt.tokens.use.direct offline_access. Reconnect retains the issued client ID and other requested permissions, translating only the obsolete preview sharing-scope spelling. Older static registrations keep their narrower permissions. Requested scopes remain separate from the actual granted scopes persisted by the provider layer.Credential candidates come from the host: same-provider profiles for CLI/setup, or only the current person's selected owned credential for personal login. Metadata uses the existing credential store. No static test registration, client secret, new configuration, or database schema is added.
Review layer 5/6, based on #8. Related: openclaw/openclaw#148567. The diff contains only this layer; the parent's callback transport and model-routing behavior are preserved.
Evidence
This layer owns registration/reconnect and requested-scope handling. Actual grant parsing and storage belong to layer 2; the temporary managed-Codex header belongs to layer 3.