Skip to content

fix(cli): continue local chat after account sign-in - #1054

Merged
dcramer merged 11 commits into
mainfrom
codex/local-oauth-assets
Jul 26, 2026
Merged

fix(cli): continue local chat after account sign-in#1054
dcramer merged 11 commits into
mainfrom
codex/local-oauth-assets

Conversation

@dcramer

@dcramer dcramer commented Jul 26, 2026

Copy link
Copy Markdown
Member

Local junior chat used to stop whenever GitHub or an MCP tool needed the user to sign in. It now prints the sign-in link, waits for the browser callback, and continues the same request. This also lets GitHub image uploads use the connected user's credential, as required by GitHub's user-attachment endpoint.

The browser still returns through the public development URL, then a signed, expiring redirect sends it to the waiting CLI. Credentials remain outside the sandbox, sensitive callback data is removed from telemetry, and duplicate, late, or stalled callbacks cannot resume the wrong request. Plugin and MCP authorization share the same small runtime capability, while local dev-server signaling stays behind an authenticated sandbox transport. Slack behavior is unchanged, and local chat still works without the dev server when no sign-in is needed.

OAuth QA exposed a separate dev-server restart bug: the outer command could exit while its Nitro process kept the port, leaving the tunnel alive but unable to reach a healthy replacement. The dev launcher now stops each long-running command as one process tree before restarting it, and the local QA skill verifies both the loopback and public callback paths before presenting an authorization URL.

The end-to-end coverage exchanges a code with a fake provider through the real loopback server, resumes the parked local turn, and verifies that the resumed slice completes durably. A live Linear MCP check also completed browser authorization, resumed the same CLI turn, and fetched the requested teams without repeating the prompt.

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Jul 26, 2026 11:38pm

Request Review

Comment thread packages/junior/src/chat/local/oauth-relay.ts Fixed
Comment thread packages/junior/src/chat/local/oauth-callback-server.ts
@dcramer
dcramer force-pushed the codex/local-oauth-assets branch from 8d12b5a to f40e3c8 Compare July 26, 2026 16:54
@dcramer dcramer changed the title fix(cli): support local OAuth asset uploads fix(cli): let local chat wait for account sign-in Jul 26, 2026
Comment thread packages/junior/src/chat/local/oauth-relay.ts Fixed
Comment thread packages/junior/src/chat/local/runner.ts
Comment thread packages/junior/src/chat/local/runner.ts
Comment thread packages/junior/src/chat/local/oauth-callback-server.ts
Comment thread packages/junior/src/chat/local/oauth-callback-server.ts
@dcramer dcramer changed the title fix(cli): let local chat wait for account sign-in fix(cli): continue local chat after account sign-in Jul 26, 2026
@dcramer
dcramer marked this pull request as ready for review July 26, 2026 21:45
@github-actions github-actions Bot added the risk: high PR risk score: high label Jul 26, 2026
Comment thread packages/junior/src/cli/chat.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6edb5ad. Configure here.

Comment thread scripts/dev-server.mjs
@dcramer
dcramer merged commit 16cec4a into main Jul 26, 2026
32 checks passed
@dcramer
dcramer deleted the codex/local-oauth-assets branch July 26, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants