Skip to content

feat(accounts): open ZCode sign-in in the existing setup terminal - #27321

Merged
nwparker merged 3 commits into
mainfrom
nwparker/zcode-sign-in-setup
Oct 10, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/zcode-sign-in-setup

Conversation

@nwparker

@nwparker nwparker commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Accounts can open a terminal for ZCode sign-in or API-key setup.

What Changed

Add three controls using Orca’s existing inline terminal and execution-host routing. Z.AI and BigModel prepare the corresponding zcode login ... --no-browser command. API-key setup prepares zcode, which owns masked key entry and model selection. Closing the setup terminal releases it and re-enables the controls. Existing quota-key controls continue to monitor usage.

Why

Users previously had to discover the setup command themselves. Reusing the existing terminal keeps authentication with the CLI and avoids adding another OAuth or credential-writing implementation. This UI is split from #24674’s read-only discovery and #24964’s storage repair.

Linked Issue

Includes the separately reviewable lint prerequisite #27326. Merge that first; its identical cleanup is composed here so the final head can pass required checks.

Refs #8476. CLI authentication and model selection remain owned by ZCode; this does not add an Orca-native GLM model picker.

Visual Proof

Before, Accounts has quota controls without sign-in setup:

Before

After, the separate setup controls:

After

The actual terminal contains the prepared command:

Prepared command

Testing

  • Inspected hidden Electron captures on macOS arm64.
  • 17 component tests pass, including command overrides and credential controls.

The rebuilt hidden Electron test opens all three real terminals, checks each prepared command, closes each terminal, and checks cleanup and re-enabled controls. It does not submit commands, authenticate, or issue paid requests. Typecheck passes; changed-code quality and normal hooks cover the final commit. Two existing test fixtures are corrected: explicit local repository context and authoritative saved-key status. All four proposed PRs merge into current main without conflicts; the composed result passes 360 focused tests including the lint prerequisite, typecheck, changed-code quality, and all three rebuilt hidden Electron flows. Hosted checks are running on this head.

Review

Uses existing terminal ownership, host routing, settings, and shadcn primitives. No new credential reader/writer, provider request, remote protocol, or agent-status store. Folder workspaces need no Git metadata.

Credit: the GLM Accounts foundation from Luchong / @parkavenue9639 and GuanBear remains in the existing history. This PR keeps their credential work separate.

Agent skill upstream boundary

  • Not applicable; no skill-installer material copied.

Notes

Low merge risk after hosted checks pass: independent UI around an existing terminal, with actual open/close verification. Real provider sign-in and native Windows/WSL/SSH UI have not been exercised.

Checklist

  • Small and focused.
  • Before/after, mechanism, and reuse explained.
  • Visual proof attached.
  • Self-reviewed for correctness, security, cleanup, and performance.
  • Cross-platform, SSH, folder, and mixed-version impact considered.
  • Typecheck, focused tests, and Electron build pass; CI covers broader checks.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The settings UI adds Z.AI and BigModel browser sign-in options and a ZCode API-key setup option. Each option opens an inline terminal with its corresponding command. The settings section appears when credentials are editable. Unit and end-to-end tests cover the setup choices and terminal controls. The diff also changes an automation hook dependency and shares fixture factories between two sidebar tests.





Priority: ➖ Normal

Merge Risk: 🔵 Low · up to bc9cf

Closing setup can leave a ZCode process running if PTY shutdown fails, with no local retry handle. Make failed cleanup recoverable before relying on this close flow.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the primary change: opening ZCode sign-in in the existing setup terminal.
Description check Passed The description is complete and matches the template. It explains the user-facing change, implementation, rationale, issue references, visual proof, testing, review scope, platform limitations, and ch…

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR






  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Keep the setup terminal mounted until cleanup succeeds. · ZcodeCliSetupSection.tsx:70-75

src/renderer/src/components/settings/ZcodeCliSetupSection.tsx:70-75
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Keep the setup terminal mounted until cleanup succeeds.

setChoice(null) immediately unmounts the inline terminal. Its cleanup can reject while the PTY remains alive, but the tab and local handle are already gone. The provider disconnect path preserves sessions and does not provide a termination or retry fallback. Keep the terminal and its retry handle until shutdown succeeds.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7560a0e3-d829-4985-9a59-46a5fde2cd14
📥 Commits

Reviewing files that changed from the base of the PR and between 6219144 and bc9cf1a.

📒 Files selected for processing (4)
  • src/renderer/src/components/automations/use-automations-page-setup-state.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit-fixtures.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit-host-platform.test.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@nwparker
nwparker merged commit 04f8f2b into main Oct 10, 2026
38 checks passed
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.

1 participant