Skip to content

feat(openai): add Sign in with ChatGPT through Responses - #148567

Merged
stevenlee-oai merged 17 commits into
openclaw:mainfrom
stevenlee-oai:dev/stevenlee/siwc-token-sharing
Sep 24, 2026
Merged

stevenlee-oai merged 17 commits into
openclaw:mainfrom
stevenlee-oai:dev/stevenlee/siwc-token-sharing

Conversation

@stevenlee-oai

@stevenlee-oai stevenlee-oai commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenClaw needs Sign in with ChatGPT (SIWC) as an authentication choice alongside Codex login and API keys, with model calls using the separately granted token-sharing capability through the public Responses API. This PR adds the sign-in flow and carries that credential through routing, the OpenClaw and managed local Codex runtimes, setup, and status.

Changes by area

SIWC provider, credential lifecycle, and sign-in UI

  • Labels the choices Codex login (browser), Codex login (device code), and Sign in with ChatGPT. Adds SIWC to provider setup and openclaw models auth login --provider openai --method siwc. The OpenAI plugin implements PKCE/OIDC verification, the IPv4 loopback callback on port 8080, identity-only versus token-sharing outcomes, and SIWC-specific refresh through the existing auth manager.
  • Persists verified identity and actual granted permissions with the credential, separately from requested scopes. A stable registration identity survives the existing secret-free refresh fence and prevents adopting another account during refresh or store reconciliation. Refresh preserves omitted scopes and handles reduced grants. Catalog preparation carries refreshed grant classification with the new bearer, so a downgrade cannot retain the previous inference catalog. Existing agent and personal-account stores remain the persistence owners.
  • Sends SIWC chat and background completions through Responses with HTTP streaming, full context, store:false, and the temporary preview header. The provider removes unsupported request controls after caller transforms and rejects unsupported service tiers before dispatch. API-key and ordinary OAuth request behavior is preserved.
  • Keeps Open sign-in, Copy link, Waiting for sign-in, and Cancel visible while a callback-only provider waits. This repairs the shared dashboard wizard used inside the Mac app. Native onboarding reuses the Gateway-advertised option and gains reconnect coverage; the app does not implement another OAuth flow. An unacknowledged wizard note is also bounded by the OAuth deadline so timeout releases the callback listener.

Provider connection dialog

Before/after screenshots and browser coverage.

  • Groups connection choices by provider. The provider dialog shows the accounts available to the selected agent, followed by visible buttons for each connection method and a comparison guide.
  • OpenAI offers Codex browser login, Codex device code, Sign in with ChatGPT, and API key together. Plugin-owned metadata supplies the documentation URL; the shared UI does not branch on OpenAI.
  • Reuses the existing account inventory, health labels, secure wizard, and API-key form. Accounts are matched by their credential owner, including providers whose display brand differs. Footer controls remain visible while long content scrolls.

Dynamic client registration and reconnect

  • Starts new registrations with dynamic_agent_client, validates the real client ID returned by authorization, and saves it with the credential. The issued ID is used for token exchange, refresh, and subsequent authorization.
  • Reconnect reuses the saved registration, rejects an unexpected identity change, and preserves a custom profile name even when the saved credential is a pending refresh fence. Connect a different ChatGPT account or workspace starts a fresh registration. Personal-login reuse is limited to the current person's selected owned credential.
  • Requests identity, email/profile, resource invocation, token sharing, and offline access. Requested permissions remain distinct from actual grants. Existing registrations retain their client ID; reconnect translates the obsolete preview sharing scope. No static test client ID or client secret ships.

Credential selection and provider routing

  • Carries the selected credential's OAuth flow, resource, and granted scopes through availability checks, model discovery, runtime preparation, stream hooks, and usage selection. An OAuth credential can now select a provider-approved public API route instead of implicitly selecting subscription/native-auth routing.
  • Moves the OpenAI-specific routing decision into provider policy. Identity-only SIWC grants cannot become inference credentials; existing Codex and API-key credentials retain their routes.
  • Reuses the existing auth-profile and runtime-plan owners. Routing receives grant facts without propagating token material through policy metadata. Codex quota probes are restricted to subscription credentials, excluding SIWC bearers.

SIWC credentials with the managed Codex runtime

  • Adds a route for an OpenClaw-managed local Codex process to use the selected SIWC credential. The existing host relay resolves and refreshes that exact credential, checks its identity and grant, and inserts the bearer immediately before the upstream Responses request. Native Codex receives a local placeholder.
  • Configures the private native provider for HTTP Responses and automatic local summarization, with direct function tools and web search. Initial requests and refresh retries apply the same SIWC preview header.
  • Gates features that this adapter cannot support, including remote/supervised execution, manual compaction, connected apps, OpenAI-hosted plugins, and native multi-agent tools. Native Codex authentication keeps its existing behavior.

Model/auth endpoint visibility in status

  • Adds Endpoint beside model/auth information in /status, using the same resolved selection as the credential label. This distinguishes public Responses routing from the Codex backend and fixes a configured API key being labeled as a different saved OAuth credential.
  • Displays a sanitized API base URL; the transport appends operation paths such as /responses. Credentials, query strings, fragments, and custom paths are hidden; unresolved routes display unknown.
  • Describes the current selection. It does not add request history, billing attribution, or endpoint telemetry. Personal-account labels remain generic.

Operator documentation

  • Adds a decision guide comparing Codex login, SIWC, and API keys by model access, hosted plugins, usage tracking, permissions, and billing, with agent and personal-account setup commands.
  • Puts shared-agent versus personal-account scope before setup, distinguishes model credentials from Gateway access tokens, and documents Connect provider and Test & use. Explains that harness choice is separate from service access, and distinguishes OpenAI-hosted plugins from locally configured OpenClaw tools. Adds the relevant setup/OAuth links, navigation, glossary, and docs label routing.

Existing Codex login remains the default. This change adds no database schema, separate credential store, operator configuration option, or telemetry collection.

Scope and size

Most production growth is the SIWC protocol lifecycle, credential-aware routing, and the managed Codex adapter. The provider-dialog increment adds 216 production lines and removes 88, adds 217 test lines and removes 38, plus five documentation/manifest lines. That growth adds account summaries, visible method choices, and provider-owned comparison links while reusing the existing auth owners.

Evidence

  • Current-main merge (7ef1b220c9b): merged main 59c02b8cb7a, preserving its extracted compaction lifecycle and SIWC refusal before manual native inference. The status fixture now uses the current auth-binding owner without dropping profile data. Manual resolutions change imports/fixture binding only; no new production behavior or test cases. All seven focused files pass (219 tests), covering status, auth-store ownership, native compaction/cancellation, activity persistence, native auth handoff, and SIWC credential preparation. Extension production type checking, targeted lint/formatting, and diff checks pass. Independent correctness and maintainability review found no actionable issues. Direct sibling Codex source inspection confirmed that manual compaction accepts only the thread ID. Native Periphery cannot run on this Linux host; its inherited main-side finding is documented below.

  • Provider-dialog browser follow-up (1b86a2ea6a9): CI exposed two older tests that expected provider selection to skip directly to the API-key form. Both now select the explicit API-key method. All credential-save, no-write, and agent-switch cleanup assertions remain. Both complete browser suites pass (11/11, 40.85 seconds); formatting and fresh independent review pass. Production delta is zero; test delta is +2/-0.

  • Provider connection dialog (a24f2b654be): 58 focused tests and four mocked-Gateway browser scenarios pass. Final layout changes were rechecked with 35 profile/login tests and the browser scenario at desktop and 390px widths. The account-summary regression failed against the previous implementation. Core/UI/plugin production and test type checks pass. Fresh correctness and maintainability review found no actionable issues. These tests cover account display, credential-owner aliases, API-key setup, and the existing browser sign-in/wait/completion path; they do not repeat live SIWC authentication or inference. The final production/full-tree/script unused-export scans pass. The remaining local lint run was interrupted when the temporary validation workspace disappeared; no full local lint result is claimed. The previous whole-PR file-size limitation remains.

  • Maintenance test repair (944236e5f9a): both foreign-durable-work cases reproduced the implicit one-second polling failure in a fresh unmodified whole-file run (2 failed, 8 passed), and CI attempt 2 failed both cases too. The test now races an explicit callback-start signal against captured background completion, then retains the call-count assertion. Real SQLite admission, ownership checks, the release gate, and final settlement/cleanup are unchanged; production delta is zero, test delta is +4/-1. The complete file passes all 10 tests with node scripts/run-vitest.mjs src/agents/embedded-agent-runner/context-engine-maintenance.ownership.test.ts --reporter=verbose; node scripts/check-changed.mjs --base a79c672f357 -- src/agents/embedded-agent-runner/context-engine-maintenance.ownership.test.ts and independent source plus automated P2 review pass.

  • Original large-43 inventory replay: all five recorded groups were exercised on CI-matching Node 24.19.0, retaining their file selection and order. The affected file passes all 10 cases within the 64-file storage group (1,165 passed, 15 unrelated backup failures, 1 skipped). Gateway, subagent, and command groups pass 605, 917, and 197 tests respectively. The host has non-sticky mode-0777 /tmp: all 15 backup failures clear when the whole backup file is rerun with a private temporary root (28 passed, 1 skipped). The CLI group remains 28 passed / 32 failed: its explicit preferred /tmp/openclaw root still reaches that insecure ancestor despite private TMPDIR. This is a named local validation limitation; no source, security checks, credentials, or shared permissions were changed to mask it. The initial sandbox also interfered with four Gateway fixtures; all four pass outside it.

  • Merge reconciliation (2662f544b29): merged main b933613c861 and reconciled the two maintenance-test startup fixes. Retains upstream naming and the PR's early-completion/failure observation; assertions and cleanup remain intact. All 10 maintenance ownership tests and the SIWC callback regression pass (11 tests total, 132.63 seconds including cold worker preparation). Formatting and diff checks pass; independent review found no actionable issues. GitHub reports the new head as mergeable; hosted CI is running.

  • Live sign-in: user-run dynamic registration persisted an issued client ID and grant. The user subsequently confirmed that the rebuilt Mac app displays the browser controls and completes SIWC sign-in.

  • Live inference: on September 24 the user confirmed a successful Responses API request using the SIWC token. This clears the previously reported server-side model 404 blocker. This is user-reported direct API proof; it does not establish a full managed-Codex run, live refresh, or allowance attribution.

  • Automated coverage: focused suites cover routing, PKCE/OIDC and loopback callbacks, credential persistence after database reopen, client reuse, refresh scope changes, Responses request policy, Codex relay behavior, utility completions, and status sanitization. Current-main validation results are recorded below.

  • Regression proof: wrong-account adoption, legacy replacement, and refresh-fence reconnect cases failed before their fixes. After repair, the OAuth suite passes 31 tests and the real-manager identity/fence cases pass. The new real-wizard timeout integration test demonstrates listener reuse after an unacknowledged note expires; both catalog downgrade cases failed before repair and the full catalog-context suite passes 4 tests. The 4 dashboard provider-login browser cases and 22 Models-page unit cases pass; the targeted setup registration test passes.

  • Earlier merge validation (f078050fbbb): resolved the CLI import overlap with main while preserving stored SIWC registrations for reconnect. All 115 focused tests pass: CLI auth (62), web-push (29), SQLite schema facts (18), and managed-Codex OAuth (6). The complete export checks pass in production, full-tree, and scripts scans. Formatting passes with the current pinned formatter. Production type checks pass across core, UI, and plugins using TypeScript 7.0.2. Test wall time was 222 seconds including 58 seconds of cold worker preparation; no test cases were added by the merge repair.

  • Callback fixture repair (a79c672f357): CI exposed a test that started a replacement sign-in before the expired runner had settled. The test now awaits the existing settlement barrier before asserting same-port reuse; production is unchanged. The focused test passes (64 ms test time, 22.56 s wrapper), and independent source plus automated P2 review found no actionable issues. The unmodified test also passed in a focused local replay, so that replay alone is not claimed as proof of the race.

  • Earlier feature coverage: 448 focused tests passed for provider sign-in, request policy, routing, and Codex credential preparation. CI-regression shards cover missing-profile handling, callback port reuse, stream selection, status, wrapper closure, plugin boundaries, and Codex fixtures. Docs MDX/link checks and production/plugin-test type checks passed on the previous head.

  • Review: Kevin approved the preceding head; GitHub dismissed that approval after the merge update, and follow-up review has been requested. A fresh independent correctness and maintainability review found no actionable merge issues. Native Codex source was inspected directly for route construction, account auth, and request-header behavior. The automated review scanner stopped on synthetic credential URLs in the endpoint-sanitization tests; no automated clean verdict is claimed.

  • Build and proof limits: the earlier full build passed at 2a3a051fe38; it is not exact-head build proof. Earlier full changed-file validation stopped at the file-size ratchet. Composed persisted-grant-to-physical-egress rejection, live refresh, and allowance attribution remain unverified. Prior boundary tests and user-reported inference are not presented as proof of those paths.

The automated browser recording uses Chromium and a simulated provider. The live Mac sign-in result above is user-reported verification of the embedded app flow.

Before After
Starting state hides sign-in actions Sign-in actions remain available during callback wait

Recorded dashboard recovery · Callback completion

The provider picker also distinguishes Codex access from SIWC. These screenshots use the real Control UI with canonical before/after provider metadata from a simulated Gateway; no authentication or inference was performed for this capture.

Before After
Earlier ambiguous ChatGPT login choices Explicit Codex login and Sign in with ChatGPT choices

GitHub accepted the media uploads. The provider-dialog images are embedded in the linked comment; their URLs redirect publicly after attachment, but this environment cannot retrieve the image CDN, so PR image rendering remains unverified. Earlier video CDN playback also remains unverified.

Preview limits and remaining work

  • Inherited Swift CI blocker: Shared OpenClawKit Periphery reports only GatewayExternalAuthorizationError, its initializer, and errorDescription. This type was introduced on main by #157454 as a staged iOS prerequisite; no production caller creates it yet. #157516 documents the same baseline failure. The SIWC candidate leaves the shared Swift sources identical to main and adds no suppression. Its owner needs to resolve activation/retention; removing that unrelated feature here would be incorrect. The previous release-tooling and eager-import failures did not recur on 1b86a2ea6a9.
  • Requires OpenAI enablement of dynamic registration and token sharing. The preview request contract is narrower than API-key Responses, uses a temporary header, and does not support file-backed inputs or WebSocket inference.
  • The Codex adapter requires an OpenClaw-managed local process and isolated agent home. Native custom CA settings or unsupported proxy configurations are rejected because the host relay cannot reproduce that transport; the normal native-auth path retains its existing behavior. Other feature restrictions are described above.
  • Existing SIWC preview credentials created before the registration identity binding must reconnect before refresh. This is an unreleased-preview change; no credential migration or new store is introduced.
  • Composed persisted-grant-to-physical-egress rejection proof remains incomplete; unit and relay boundary tests are not presented as that end-to-end proof.
  • Dashboard follow-ups: fresh short-lived tokens can show “Expiring”; personal-account browser waiting still uses an acknowledgement step; identity-only completion needs a clearer model-access result; reconnect choices should distinguish accounts by verified identity.
  • File-size checks flag oversized modules and tests enlarged by this feature; splitting those files remains outstanding. The simplification pass reduces production code slightly without moving it into extra modules to satisfy a line count. Full changed-file validation is not green. Targeted lint reports only file-length violations; formatting and plugin test-import boundaries pass.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here.

ClawSweeper will not retry this unchanged revision.

Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: openai extensions: codex size: XL labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 14, 2026, 6:28 PM ET / 22:28 UTC.

ClawSweeper review

What this changes

Adds ChatGPT token-sharing sign-in, provider-owned credential routing, and a host-managed Responses relay for Codex while preserving separate API-key and Codex subscription choices.

Merge readiness

⛔ Blocked before merge - 9 items remain

Keep open as a meaningful preview that current main does not provide. The contributor clearly documents the simulated evidence and outstanding prerequisites; neither closure nor merge readiness is supported.

Priority: P2
Reviewed head: d018af44a1bb4f5c7e7fb5a09e2f1442809760f9
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has coherent ownership and useful partial evidence, but live integration and authority-boundary coverage remain incomplete.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: inspected screenshots establish both callback messages under signed fixtures, and the body reports native Codex wire-contract success against a simulated upstream. Neither establishes approved OpenAI sign-in, refresh, and allowance use or composed rejection before inference for withdrawn/reassigned credentials and stale turns. These are explicitly acknowledged coverage gaps, independent of the video inspection limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: inspected screenshots establish both callback messages under signed fixtures, and the body reports native Codex wire-contract success against a simulated upstream. Neither establishes approved OpenAI sign-in, refresh, and allowance use or composed rejection before inference for withdrawn/reassigned credentials and stale turns. These are explicitly acknowledged coverage gaps, independent of the video inspection limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 10 items Introduced scope verified: The local merge-base-to-head comparison recovers all 99 introduced paths, including those omitted from the supplied file list. The checkout matches the pinned original head; endpoint drift was not treated as PR-owned work. Diff whitespace checks passed.
Current-main necessity: Current main’s provider contract offers OAuth, device-code, and API-key methods without token sharing. Searches of current OpenAI source and docs found neither new grant marker. The bounded GitHub title search returned this PR alone, establishing no canonical replacement.
Registration remains deliberately disabled: The production client ID is unset, and login rejects before opening the browser without it. The captured PR body explicitly states that approved registration, real consent, inference, refresh, and allowance charging remain unverified. No release implementation is established; inspection of the supplied latest-release tag could not retrieve its source object.
Findings None None.
Security Needs attention Complete final-effect authority proof: The source rechecks authority before network I/O, but supplied rejection tests mock the credential owner and transport. Demonstrate that an identity-only or reassigned profile, withdrawn sharing, and retired turn generation cannot send inference through the real composed boundary, including a 401 refresh retry.

How this fits together

The OpenAI plugin turns sign-in results into credentials managed by OpenClaw’s existing auth store. Agent execution selects an eligible endpoint; managed Codex requests pass through a local relay that supplies the selected bearer before sending inference to OpenAI.

flowchart TD
  A[Browser sign-in] --> B[OpenAI consent and identity]
  B --> C[OpenClaw credential store]
  C --> D[Provider route policy]
  D --> E[OpenClaw Responses transport]
  D --> F[Managed Codex local relay]
  E --> G[Public Responses API]
  F --> G
Loading

Decision needed

Question Recommendation
Should OpenClaw sponsor this bundled token-sharing preview and its provider-policy SDK expansion, contingent on approved registration and production proof? Sponsor the gated preview: Retain the draft while provider, SDK, and security owners settle the contract and approved-client evidence.

Why: The new grant family, supported SDK contract, and OpenAI registration require explicit product and owner acceptance that source review cannot supply.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: inspected screenshots establish both callback messages under signed fixtures, and the body reports native Codex wire-contract success against a simulated upstream. Neither establishes approved OpenAI sign-in, refresh, and allowance use or composed rejection before inference for withdrawn/reassigned credentials and stale turns. These are explicitly acknowledged coverage gaps, independent of the video inspection limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve security concern: Complete final-effect authority proof - The source rechecks authority before network I/O, but supplied rejection tests mock the credential owner and transport. Demonstrate that an identity-only or reassigned profile, withdrawn sharing, and retired turn generation cannot send inference through the real composed boundary, including a 401 refresh retry.
  • Resolve merge risk (P1) - The new sign-in choice currently terminates at the deliberately unset client ID; production registration and allowance behavior remain unverified.
  • Resolve merge risk (P1) - The new provider-policy contract replaces shared credential eligibility logic, but supported SDK semantics and fresh-install versus existing-profile compatibility have not been accepted and fully demonstrated.
  • Resolve merge risk (P1) - Mocked rejection tests do not establish that withdrawn consent, profile reassignment, or stale turn admission blocks physical inference after refresh in the composed production path.
  • Complete next step (P2) - Keep the preview unmerged until owners accept the contract and approved-client, authority, and upgrade proof is supplied. Redact tokens, IP addresses, private endpoints, and personal data; attach required visible-flow screenshots and update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review if needed.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [medium] Complete final-effect authority proof — extensions/codex/src/app-server/inference-proxy.ts:177
Agent review details

Security

Needs attention: No concrete bypass or supply-chain defect was established, but the new bearer boundary needs composed revocation proof and security-owner involvement.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Credential contract 1 sign-in method and 1 provider-policy hook added The preview introduces both a user choice and a supported routing contract requiring explicit acceptance.
Production versus tests Production net +1,388; tests net +1,264 The body justifies production growth through consent, grant routing, and the existing relay’s bearer boundary.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Hold the preview at its declared prerequisites (recommended)
    Keep the draft unmerged until registration, SDK acceptance, existing-profile compatibility, and final-effect authorization proof are complete.
  2. Establish the supported contract
    Document the provider-policy hook and refresh exports, then demonstrate unchanged API-key and Codex subscription behavior alongside the new grant.

Technical review

Best possible solution:

Keep consent and refresh with their existing owners, establish a documented SDK contract, and enable the preview only with approved-client, authority-boundary, and existing-profile compatibility proof.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this adds a new sign-in capability rather than repairing an established failure; no definite introduced runtime defect was established.

Is this the best way to solve the issue?

Unclear. Provider-owned grant policy and reuse of the existing refresh owner are coherent, but SDK acceptance and real consent-to-inference evidence are needed to establish the complete solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1b0b0fd60cb1.

Labels

Label justifications:

  • P2: This is a bounded provider capability proposal without evidence of an urgent existing-user regression.
  • merge-risk: 🚨 compatibility: A new SDK policy hook replaces shared credential classification and needs documented semantics plus existing-profile compatibility proof.
  • merge-risk: 🚨 security-boundary: The host now supplies persisted OAuth authority to native inference, while composed revocation and reassignment rejection remains unproven.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: inspected screenshots establish both callback messages under signed fixtures, and the body reports native Codex wire-contract success against a simulated upstream. Neither establishes approved OpenAI sign-in, refresh, and allowance use or composed rejection before inference for withdrawn/reassigned credentials and stale turns. These are explicitly acknowledged coverage gaps, independent of the video inspection limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Authority-chain proof required: inspected screenshots establish both callback messages under signed fixtures, and the body reports native Codex wire-contract success against a simulated upstream. Neither establishes approved OpenAI sign-in, refresh, and allowance use or composed rejection before inference for withdrawn/reassigned credentials and stale turns. These are explicitly acknowledged coverage gaps, independent of the video inspection limitation.

Evidence

Security concerns:

  • [medium] Complete final-effect authority proof — extensions/codex/src/app-server/inference-proxy.ts:177
    The source rechecks authority before network I/O, but supplied rejection tests mock the credential owner and transport. Demonstrate that an identity-only or reassigned profile, withdrawn sharing, and retired turn generation cannot send inference through the real composed boundary, including a 401 refresh retry.
    Confidence: 0.9

What I checked:

  • Introduced scope verified: The local merge-base-to-head comparison recovers all 99 introduced paths, including those omitted from the supplied file list. The checkout matches the pinned original head; endpoint drift was not treated as PR-owned work. Diff whitespace checks passed. (d018af44a1bb)
  • Current-main necessity: Current main’s provider contract offers OAuth, device-code, and API-key methods without token sharing. Searches of current OpenAI source and docs found neither new grant marker. The bounded GitHub title search returned this PR alone, establishing no canonical replacement. (extensions/openai/provider-contract-api.ts:75, 1b0b0fd60cb1)
  • Registration remains deliberately disabled: The production client ID is unset, and login rejects before opening the browser without it. The captured PR body explicitly states that approved registration, real consent, inference, refresh, and allowance charging remain unverified. No release implementation is established; inspection of the supplied latest-release tag could not retrieve its source object. (extensions/openai/token-sharing.ts:12, d018af44a1bb)
  • Inspected callback proof: Both downloaded screenshots visibly show the production callback’s sharing-granted and identity-only messages. They support those visible outcomes under signed fixtures, not real OpenAI consent or inference. Video preparation failed with 'ffprobe failed: spawnSync ffprobe ENOENT'; the fallback attachment open returned 'Cache miss'. This reviewer-side video limitation does not negate the inspected screenshots. Assessment preserves the supplied context revision 9e07c3533f8785cb2f4991b3486f1afe6c18cbff7e5f7a7f8544505f3324b13e. (d018af44a1bb)
  • Authority checks and proof boundary: The relay restricts OAuth to public Responses, strips native account/project headers, and rechecks admitted-turn and credential authority through beforeRequest. Credential tests cover deletion, sharing withdrawal, subject replacement, and pending refresh generations; relay rejection tests mock transport and credential resolution, so the composed persistence-to-network rejection boundary remains unproven. (extensions/codex/src/app-server/inference-proxy.ts:153, d018af44a1bb)
  • Affirmative Codex dependency signal: The branch creates a private native model provider and relies on native HTTP Responses and automatic local summarization. The PR additionally claims a Codex 0.154.0 simulated-upstream run; these are explicit dependency-contract signals requiring direct Codex inspection. (extensions/codex/src/app-server/inference-routing.ts:264, d018af44a1bb)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add approved-client CLI sign-in, consent, inference, refresh, and allowance evidence; include screenshots for visible flows and redacted logs or traces for runtime behavior.
  • Prove allowed inference and rejection before physical I/O for withdrawn sharing, reassigned profiles, and retired turns, including refresh retries.
  • Obtain SDK/security-owner acceptance, document the new contract, and complete relevant type, contract, and existing-profile upgrade checks.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@stevenlee-oai
stevenlee-oai force-pushed the dev/stevenlee/siwc-token-sharing branch from d018af4 to 36f435f Compare September 22, 2026 00:38
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations labels Sep 22, 2026
@stevenlee-oai stevenlee-oai changed the title feat(openai): preview ChatGPT token sharing through Responses feat(openai): add Sign in with ChatGPT through Responses Sep 22, 2026
@stevenlee-oai
stevenlee-oai force-pushed the dev/stevenlee/siwc-token-sharing branch 6 times, most recently from 9585d72 to 234c22d Compare September 22, 2026 23:49
@stevenlee-oai
stevenlee-oai merged commit 67fd7e9 into openclaw:main Sep 24, 2026
233 of 237 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
…8567)

* feat(auth): route renewable OAuth grants by provider policy

* feat(openai): add Sign in with ChatGPT preview

* feat(codex): bridge host-owned token sharing to Responses

* feat(status): show the selected model endpoint

* feat(openai): register and reuse SIWC OAuth clients

* docs(openai): explain authentication choices and identity

* refactor(siwc): clarify sign-in choices and credential preparation

* test(openai): await expired SIWC wizard before retry

* test(agents): await foreign maintenance startup

* feat(ui): show provider accounts and connection methods together

* test(ui): select API key from provider connection dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: macos App: macos app: web-ui App: web-ui commands Command implementations dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: codex extensions: openai gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants