Repository navigation
feat(accounts): open ZCode sign-in in the existing setup terminal - #27321
Conversation
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to 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 |
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 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 winKeep 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
📒 Files selected for processing (4)
src/renderer/src/components/automations/use-automations-page-setup-state.tssrc/renderer/src/components/sidebar/folder-workspace-composer-submit-fixtures.tssrc/renderer/src/components/sidebar/folder-workspace-composer-submit-host-platform.test.tssrc/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.
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-browsercommand. API-key setup prepareszcode, 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:
After, the separate setup controls:
The actual terminal contains the prepared command:
Testing
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
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