You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): forward OpenCode --method and --answer from account add - #37622
Some OpenCode logins ask follow-up questions, such as which GitHub deployment to use. Without an interactive terminal, orca account add could not answer them, so login stopped before authorization. This forwards OpenCode's method and repeated form-answer flags inside Orca's private account profile.
The flags answer provider forms; they do not supply an API-key secret, approve a device authorization, or make every authentication method noninteractive.
Changes
Forward the method and each key=value answer in order, preserving spaces, empty right-hand values and embedded equals signs. OpenCode validates its own fields and authentication methods.
Reject malformed options, including a missing value among repeated answers, before runtime lookup or login. Keep form-answer values out of login-failure messages. These flags remain OpenCode-only.
Start generated account logins and the compatibility probe through the existing process launcher. Windows launchers can receive literal form text containing percent signs, ampersands and quotes, with terminal input, JSON output routing and cancellation preserved.
Keep isolated credential capture, import after successful login and cleanup on failure. No saved-data or wire-format changes.
Thanks to Alonso Almeida (@Alonsojrr14) for the original implementation and follow-up fixes; his commits and co-author attribution are retained.
Validation
128 targeted tests pass across seven exact named files: CLI parser, repeatable flags, account handlers, login-command probe, real CLI subprocess checks and the existing skills CLI test. CLI typecheck, lint, formatting, changed-code quality and affected verification baselines pass.
Independent correctness and architecture/reference review accepted the repairs. The final test-only correction preserves the earlier runtime evidence; no production changes followed final QA.
macOS: real OpenCode existing-key enrollment, capture/import/list/removal, normal picker/stdin/cancellation and bounded real Codex login cancellation pass. A targeted follow-up with real Claude Code 2.1.316 passes auth-prompt launch, attached terminal input, cancellation and pending-profile cleanup. Prior Settings screenshot covers unchanged UI.
Windows 11: eight native fixture cases pass through the actual account-add CLI for recognized npm/pnpm shims and unrecognized batch fallback, literal form values, stdin, JSON routing, cancellation, rejection before runtime and cleanup. Fixtures prove transport and handoff, not provider authorization.
Earlier real no-TTY method/form forwarding reached device authorization. Completed answer-bearing no-TTY enrollment/import remains unexercised: no inventoried machine has an existing supported sign-in for that flow. Brennan authorized skipping this one completion check on November 3 after the maintainer assessed the separate forwarding, real import and Windows transport evidence; this is a documented validation gap, not a passing runtime result.
Full local check:changed is not green: its excessive related-test selection was replaced with exact named tests, and its baseline node typecheck encountered an unrelated GraphQL fixture error. Scoped verification is recorded above. Required CI passes on f0f93ebf80d5b8a8bc9fce5e65435bff40f3dfab, including all twelve unit shards, static analysis/typecheck, packaging and native smoke checks.
Risk
This touches account argument validation and the generated-login launcher. Automated checks, real Mac provider checks and native Windows transport/cancellation checks cover the repaired boundaries. Completed answer-bearing no-TTY authorization remains a validation gap. Terminal commands typed by users are unchanged.
AI disclosure
Original implementation written with Claude Code (Claude Opus 5.5) and reviewed by Alonso. Maintainer repairs reviewed with Codex.
Agent skill upstream boundary
Not applicable; no upstream skill-installer implementation is copied.
Without a TTY, OpenCode 2 stops at integration forms such as the GitHub
deployment type, and orca account add had no way to answer them.
Forward --method and repeatable --answer key=value to
`opencode auth login --standalone`, rejecting them for other agents
and malformed answers before login starts.
Fixesstablyai#37621
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAGqwhqLekFS97KWFEHG3v
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The account add command accepts --method and repeatable --answer options for OpenCode. It validates that these options are used only with OpenCode and that supplied values meet the required formats. The handler adds valid options to the OpenCode login arguments before --standalone. Failure messages redact answer values, while the login process receives the original arguments. The CLI specification and tests cover the options, validation, forwarding, and redaction.
Severity of issue fixed: Medium
Merge Risk: Minimal · up to d7c80
No current-head defect or merge-blocking risk was established in the changed OpenCode login-option paths.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: forwarding OpenCode --method and --answer options from account add.
Linked Issues check
[#37621] requires OpenCode-only --method and repeatable --answer flags, unchanged forwarding, and rejection of invalid answers before login. account.ts declares both flags and answer as repeat…
Out of Scope Changes check
The changes stay within [#37621]. The command specification exposes the requested options. The handler validates and forwards them only for OpenCode. Redaction protects answer values in login errors. …
Description check
The description follows the repository template. It explains the change in plain language, lists the mechanism and the reasons for it, and names the linked issue (#37621). It also gives detailed valid…
Full details: Linked Issues check
Explanation
[#37621] requires OpenCode-only --method and repeatable --answer flags, unchanged forwarding, and rejection of invalid answers before login. account.ts declares both flags and answer as repeatable. data-account-commands.ts rejects these flags for non-OpenCode agents, rejects empty or dash-led methods, rejects malformed answers, preserves the original method value, and forwards repeated answers before --standalone. Tests cover argument order, surrounding method whitespace, = in answer values, invalid options, and pre-login rejection. The account handler tests cover non-OpenCode rejection and answer redaction.
Full details: Out of Scope Changes check
Explanation
The changes stay within [#37621]. The command specification exposes the requested options. The handler validates and forwards them only for OpenCode. Redaction protects answer values in login errors. The Windows error helper identifies whether a new login argument or the launcher path caused the existing batch guard failure without exposing values. Tests cover the new forwarding, validation, rejection, and redaction behavior. No unrelated change is demonstrated.
Full details: Description check
Explanation
The description follows the repository template. It explains the change in plain language, lists the mechanism and the reasons for it, and names the linked issue (#37621). It also gives detailed validation evidence on macOS and Windows, a risk statement, and an AI disclosure. The Linked Issue section says "Fixes #" with no number, and "Tracked in #37621" is used instead, so the template field is not filled as written. The Visual Proof section is not marked N/A, and it refers to a prior Settings screenshot without attaching a before/after comparison. The Risk section does not give a risk level or a clear revert procedure. The Testing checkbox for manual testing is not checked, though the body describes manual validation. These are minor gaps and do not make the description largely incomplete.
Full details: Docstring Coverage
Explanation
Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 6 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
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.
Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 2ab33942-7de5-4c41-82a8-6f097ba97441
Commits
Reviewing files that changed from the base of the PR and between 9bb1b7b and d7c8048.
Files selected for processing: 3
src/cli/handlers/account.test.ts
src/cli/handlers/data-account-commands.test.ts
src/cli/handlers/data-account-commands.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
- Redact --answer values in the login failure message, since form
answers can hold secrets.
- Reject an empty --answer instead of dropping it before validation.
- Reject --method/--answer for Claude and Codex before their login
starts, not only for Devin.
Refs stablyai#37621
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAGqwhqLekFS97KWFEHG3v
…dows
When an OpenCode .cmd launcher is used, a --method or --answer value
containing cmd.exe metacharacters tripped the batch guard, but the error
said the launcher path was the problem. Name the login argument instead,
without echoing its value.
Refs stablyai#37621
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAGqwhqLekFS97KWFEHG3v
A --method, --answer or --integration value starting with a dash, such
as `--answer=--server=http://...`, could be read by OpenCode as its own
flag. Reject dash-led values, and validate login options before the
runtime call so bad input fails without touching the host.
Refs stablyai#37621
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAGqwhqLekFS97KWFEHG3v
The reason will be displayed to describe this comment to others. Learn more.
Follow-up Comments
Forward the --method value unchanged after validation.
149-152: Minor · Functional Correctness · Quick win
Forward the --method value unchanged after validation.
method.trim() removes leading and trailing whitespace only. IDs without such whitespace are unaffected. A value such as device passes the validation and is forwarded as device. The issue requires --method to reach opencode auth login unchanged.
Keep method.trim() in the validation to reject all-whitespace values. Forward method in the argument array.
The current test checks only one --answer. Add a second answer and assert that both values are redacted while both original values remain in the spawned command.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 097fbecd-9c55-4a7e-80f3-0e09f7ac243d
Commits
Reviewing files that changed from the base of the PR and between 5cb7cba and 2633786.
Files selected for processing: 3
src/cli/handlers/account-login-launch-error.ts
src/cli/handlers/account.test.ts
src/cli/handlers/account.ts
Files skipped from review as they are similar to previous changes: 1
src/cli/handlers/account.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Trim --method only for validation and pass the value to OpenCode as
given. Apply the same trimmed dash check to --integration, and test that
every --answer value is redacted from the login failure message.
Refs stablyai#37621
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAGqwhqLekFS97KWFEHG3v
Addressed the two follow-up comments from the review of 2633786fd7 in d7c8048ac8:
--method is now forwarded to opencode auth login unchanged. trim() is only used to reject blank or dash-led values. --integration gets the same trimmed dash check.
The login failure test now uses two --answer values and checks that both are redacted from the error and both still reach the spawned command.
9bb1b7ba3e also rejects dash-led --method/--answer/--integration values (so something like --answer=--server=... can't be parsed by OpenCode as its own flag), and validates login options before the runtime call.
Reject every missing repeated string value before runtime lookup, and use the shared process launcher for account login and capability probes. Preserve provider form keys and literal values while retaining option-boundary validation.
Co-authored-by: Alonso Almeida <alonsojr1269@gmail.com>
Narrow the expected failure type, explain bounded subprocess deadlines, and remove the obsolete direct-import exception.
Co-authored-by: Alonso Almeida <alonsojr1269@gmail.com>
Retain the exact rejection and exit-code assertions after repeatable values began failing before dispatch.
Co-authored-by: Alonso Almeida <alonsojr1269@gmail.com>
Thanks, @Alonsojrr14 — the method/form forwarding addresses the missing no-terminal login path. I added two repairs: reject every missing repeated value before login, and use the common process launcher so Windows preserves literal form answers. OpenCode continues to own method/field validation; isolated credential capture and cancellation stay intact.
Validation: 128 targeted tests pass; real OpenCode key enrollment/import and OpenCode/Codex cancellation pass on macOS. Real Claude auth-prompt launch, attached terminal input, cancellation and pending-profile cleanup also pass in the follow-up. Eight native Windows fixture cases pass for literal argv, stdin, JSON routing, cancellation and cleanup. Fixtures verify transport, not provider authorization.
OpenCode completed answer-bearing no-TTY authorization/import waived by Brennan: “Eh. Think it's safe to skip it? We can if so” (November 3, 2026), conditional on my safety assessment. I recommend and accept this narrow exception: the real no-TTY form flow reached device authorization; real key enrollment independently exercised private capture/import/removal; targeted tests and eight native Windows fixture cases cover argument transport and cleanup. Completion of that exact authorization/import combination remains unverified. All other required runs retain their recorded results.
CI passes on f0f93ebf80d5b8a8bc9fce5e65435bff40f3dfab, including all twelve unit shards. Final review is complete on that head. OpenCode/Codex and Windows QA ran on ac2470c7af8d1333a162cb2eac28b74003804f1a; the sole later commit f0f93ebf80d5b8a8bc9fce5e65435bff40f3dfab changes only an existing test’s missing-value diagnostic assertion, so their runtime evidence carries. Real Claude follow-up ran on f0f93eb. Alonso’s thanks and co-author trailer will be preserved in the squash.
QA evidence: actual CLI against real OpenCode/Codex on macOS and the native Windows fixture runtime; reports and logs retained in ~/orca-qa/pr-37622/final-mac-qa-report.md and final-windows-qa-report.md. claude-followup-report.md records the real Claude follow-up. Prior Settings screenshot covers unchanged UI.
Existing behavior observed during QA: raw-mode Claude/OpenCode cancellation can report the provider’s exit 130 as a CLI failure while cleanup succeeds. The same nonzero-exit mapping exists on the merged main baseline; this PR does not change it.
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
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.
ELI5
Some OpenCode logins ask follow-up questions, such as which GitHub deployment to use. Without an interactive terminal,
orca account addcould not answer them, so login stopped before authorization. This forwards OpenCode's method and repeated form-answer flags inside Orca's private account profile.The flags answer provider forms; they do not supply an API-key secret, approve a device authorization, or make every authentication method noninteractive.
Changes
key=valueanswer in order, preserving spaces, empty right-hand values and embedded equals signs. OpenCode validates its own fields and authentication methods.Tracked in #37621.
Thanks to Alonso Almeida (@Alonsojrr14) for the original implementation and follow-up fixes; his commits and co-author attribution are retained.
Validation
check:changedis not green: its excessive related-test selection was replaced with exact named tests, and its baseline node typecheck encountered an unrelated GraphQL fixture error. Scoped verification is recorded above. Required CI passes onf0f93ebf80d5b8a8bc9fce5e65435bff40f3dfab, including all twelve unit shards, static analysis/typecheck, packaging and native smoke checks.Risk
This touches account argument validation and the generated-login launcher. Automated checks, real Mac provider checks and native Windows transport/cancellation checks cover the repaired boundaries. Completed answer-bearing no-TTY authorization remains a validation gap. Terminal commands typed by users are unchanged.
AI disclosure
Original implementation written with Claude Code (Claude Opus 5.5) and reviewed by Alonso. Maintainer repairs reviewed with Codex.
Agent skill upstream boundary