Repository navigation
feat(core): add SIWC auth mode and Chrome extension sign-in - #3287
Merged
Merged
Conversation
EAGzzyCSL
marked this pull request as draft
October 20, 2026 12:58
Deploying midscene with
|
| Latest commit: |
abc26e3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ef0c799a.midscene.pages.dev |
| Branch Preview URL: | https://zzy-siwc-auth-mode.midscene.pages.dev |
EAGzzyCSL
force-pushed
the
zzy/siwc-auth-mode
branch
from
October 21, 2026 08:01
d3a9aca to
f265c53
Compare
EAGzzyCSL
marked this pull request as ready for review
October 21, 2026 10:41
Co-Authored-By: Riff
Co-Authored-By: Riff
yuyutaotao
enabled auto-merge (squash)
October 21, 2026 16:11
yuyutaotao
approved these changes
Oct 21, 2026
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.
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
authModefield.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/corepnpm exec nx build @midscene/clipnpm exec nx build chrome-extensionLive OAuth was not rerun for the diagnostics changes.