Skip to content

feat(core): add SIWC auth mode and Chrome extension sign-in - #3287

Merged
yuyutaotao merged 10 commits into
mainfrom
zzy/siwc-auth-mode
Oct 21, 2026
Merged

yuyutaotao merged 10 commits into
mainfrom
zzy/siwc-auth-mode

Conversation

@EAGzzyCSL

@EAGzzyCSL EAGzzyCSL commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add MIDSCENE_MODEL_AUTH_MODE="siwc" to use saved ChatGPT credentials without manually configuring an API Key, endpoint, Responses protocol, or streaming. Node.js reads ~/.midscene/siwc.json; the Chrome extension reads its local extension storage.

Add a ChatGPT sign-in entry in the extension's model configuration dialog. Authorization opens in a new tab, saves credentials locally, and displays a configuration example with copy controls. Share authorization-code exchange and credential refresh between Core, CLI, and the extension, and update the English and Chinese setup documentation.

Refresh credentials once when OpenAI rejects a request with HTTP 401 and token_expired, then retry with the updated token. Concurrent refreshes within one process share a promise. Do not replay delivered streaming content or retry again after the refreshed request fails. Token expiration is not compared against the local clock.

Preserve authentication failure stages, HTTP response bodies, and nested causes, and print complete CLI diagnostics. Update model configuration snapshots for the new default authMode field.

Validation

  • pnpm run lint (passes with one existing unused-suppression warning)
  • pnpm exec nx test @midscene/core -- siwc (39 tests)
  • pnpm exec nx test @midscene/core -- agent-custom-model (23 tests)
  • pnpm exec nx test @midscene/cli -- siwc (15 tests)
  • pnpm exec nx test @midscene/cli -- openai-login (13 tests)
  • pnpm exec nx build @midscene/core
  • pnpm exec nx build @midscene/cli
  • pnpm exec nx build chrome-extension

Live OAuth was not rerun for the diagnostics changes.

@EAGzzyCSL
EAGzzyCSL marked this pull request as draft October 20, 2026 12:58
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: abc26e3
Status: ✅  Deploy successful!
Preview URL: https://ef0c799a.midscene.pages.dev
Branch Preview URL: https://zzy-siwc-auth-mode.midscene.pages.dev

View logs

@EAGzzyCSL
EAGzzyCSL marked this pull request as ready for review October 21, 2026 10:41
@yuyutaotao
yuyutaotao enabled auto-merge (squash) October 21, 2026 16:11
@yuyutaotao
yuyutaotao merged commit 0979977 into main Oct 21, 2026
18 checks passed
@yuyutaotao
yuyutaotao deleted the zzy/siwc-auth-mode branch October 21, 2026 16:13
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.

3 participants