fix(kiro_cli): honor --yolo and profile.model at launch#201
Merged
Conversation
The kiro_cli provider silently dropped two CAO launch flags: 1. --yolo (allowed_tools=['*']) never became kiro-cli --trust-all-tools, so every tool invocation re-prompted for permission and blocked assign/handoff flows inside multi-agent workflows. 2. profile.model was never passed to kiro-cli. Workflows pinning a specific model silently ran on kiro-cli's default (auto). Translate allowed_tools=['*'] into --trust-all-tools and profile.model into --model <value> for both the TUI launch and the --legacy-ui fallback path. Profile load is best-effort — kiro-cli has its own agent store, so a CAO-unregistered profile must not block launch. PR #189 fixed the model gap for claude_code/codex/gemini/kimi/copilot but assumed kiro_cli handled model via install-time JSON baking; that assumption did not cover the runtime launch command. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kiro-cli 2.0.1's new TUI shows a non-bypassable "Yes, I accept" consent dialog when launched with --trust-all-tools, breaking CAO's headless launch. Only --legacy-ui / --classic / --no-interactive skip the dialog. When CAO launches with --yolo (allowed_tools=['*']), now launch directly with --legacy-ui + --trust-all-tools instead of attempting TUI first. Non-yolo launches preserve the existing TUI-first behavior with --legacy-ui fallback. Also fail fast on yolo timeout (no second fallback), avoiding the ~30-second double-timeout that previously surfaced as a 500 to the caller. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tell the user that kiro_cli will be launched with --legacy-ui when --yolo is set. Mirrors the provider-side behavior so the CLI output matches what actually runs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
opencode's TUI has no runtime equivalent to --dangerously-skip-permissions / --yolo / --trust-all-tools (tracked upstream in anomalyco/opencode#8463), so permissions must be baked into the profile at `cao install` time. `cao launch --yolo` on opencode_cli is silently ignored today; this commit makes the gap visible. - docs/opencode-cli.md: correct the "pass --yolo" note, add a "Known Limitations" subsection explaining the install-time-only workflow and linking the upstream issue. - cli/commands/launch.py: when provider == opencode_cli and --yolo is set, emit a yellow warning that --yolo has no runtime effect and point the user at `cao install` with `allowedTools: ["*"]`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
|
@patricka3125 when you get a chance can you help to review this ? |
Collaborator
|
@haofeif lgtm |
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.
fix(kiro_cli): honor --yolo and profile.model at launch
Summary
Three issues with the
kiro_cliprovider are fixed here, plus a follow-on doc fix foropencode_cliafter it merged into this branch:cao launch --yolodid not bypass Kiro CLI's permission prompts. CAO setsallowed_tools=['*']for yolo, but the kiro_cli provider never translated that intokiro-cli chat --trust-all-tools. Every tool invocation re-prompted, which blocks assign/handoff flows inside multi-agent workflows.profile.modelwas ignored. The agent-profilemodel:frontmatter field was never passed tokiro-cli, so workflows pinningmodel: claude-opus-4.6(or similar) silently ran on kiro-cli's default (auto).--trust-all-tools. CAO cannot answer it headlessly, so initialization hangs until timeout → 500 to the caller.cao launch --yolowas silently ignored onopencode_cli. After PR feat: Add OpenCode CLI provider support #193 merged into main and into this branch, the new opencode_cli provider inherited the same gap as kiro_cli had — but unlike kiro, opencode's TUI has no upstream runtime flag to translate--yolointo (tracked at [FEATURE]: Add--dangerously-skip-permissions(aka YOLO mode) anomalyco/opencode#8463). So this PR documents the limitation and adds a launch-time warning rather than a code fix.Kiro flags are now honored, yolo launches on kiro skip the TUI entirely in favor of
--legacy-uito avoid the consent dialog, and opencode users get a clear runtime warning pointing them at the install-time workflow.Background
PR #189 ("honor profile.model at terminal creation") fixed the
--modelgap for claude_code / codex / gemini_cli / kimi_cli / copilot_cli, but the PR body assumed kiro_cli already baked model selection in at install time:That assumption is incorrect. The kiro_cli provider's
initialize()built the command askiro-cli chat --agent {profile}with no--modelflag and no read ofprofile.model. Install-time baking does not cover runtime model overrides, so the field was effectively dead.The yolo gap is separate — it has been there since the provider was introduced. Other providers handle their equivalent flag (
--dangerously-skip-permissions,--yolo, etc.) unconditionally; kiro_cli did not.The consent-dialog issue is a kiro-cli 2.0 regression (kirodotdev/Kiro#7398, aws/amazon-q-developer-cli#3751). Confirmed on kiro-cli 2.0.1: the new TUI still shows the dialog; only
--legacy-ui,--classic, and--no-interactivebypass it. CAO drives kiro-cli through a TUI inside tmux, so--legacy-uiis the only viable path when--trust-all-toolsis set.Matrix (verified locally on kiro-cli 2.0.1):
--tui(default)--classic--legacy-ui--no-interactiveChanges
src/cli_agent_orchestrator/providers/kiro_cli.py:_get_profile_model()helper: best-effort profile load, returnsprofile.modelif available,Noneotherwise. Missing profile is not fatal — kiro-cli has its own agent store, so a profile that isn't CAO-registered must not block launch.initialize(), whenself._allowed_toolscontains"*"(yolo):kiro-cli chat --legacy-ui --trust-all-tools [--model <m>] --agent <profile>. The TUI attempt is skipped entirely because its consent dialog cannot be dismissed headlessly.INFO:"kiro_cli yolo mode: forcing --legacy-ui (kiro-cli 2.0.1 TUI shows a non-bypassable trust-all-tools consent dialog)".initialize(), when not yolo:--legacy-uifallback on timeout.--modelis forwarded on both the TUI attempt and the legacy fallback.test/providers/test_kiro_cli_unit.py:load_agent_profile(it's called on everyinitialize()now). Original assertions preserved verbatim.test_initialize_yolo_forces_legacy_ui_with_trust_all_tools: yolo launches with--legacy-ui --trust-all-toolson the first command — no TUI attempt.test_initialize_passes_profile_model:profile.model→ command contains--model <value>.test_initialize_yolo_and_model_combine: both yolo flags and--modelappear together in the expected order (on the single legacy-ui launch).test_initialize_yolo_no_fallback_on_timeout: yolo timeout raises without a second launch attempt.test_initialize_non_yolo_legacy_ui_fallback_preserves_model: non-yolo TUI timeout falls back to--legacy-ui, and the--modelflag is preserved on both attempts.src/cli_agent_orchestrator/cli/commands/launch.py(opencode_cli follow-on):--yolois set andprovider == "opencode_cli", emit a yellow warning explaining that--yolohas no runtime effect on opencode_cli and pointing users atcao installwithallowedTools: ["*"].--dangerously-skip-permissions/--trust-all-tools/--yolo. The flag exists only onopencode run(the headless one-shot command) which CAO does not drive. Tracked upstream in [FEATURE]: Add--dangerously-skip-permissions(aka YOLO mode) anomalyco/opencode#8463 and siblings, all still open.docs/opencode-cli.md(opencode_cli follow-on):--yoloto allow all 13 tools" note (it implied runtime widening, which doesn't work).cao launch --yolois install-time only subsection explaining the upstream TUI gap and the correctallowedTools: ["*"]+ re-install workflow.Verification
Unit tests
Live launch — yolo path (the 500 symptom)
Before this PR,
cao launch --agents kb_eval_supervisor --yoloreturned:and the server log showed:
Root cause: both the TUI attempt and the legacy-ui fallback were launched with
--trust-all-tools, and in 2.0.1 only the legacy path bypasses the consent dialog — but the first 30-second TUI timeout plus the second ~30-second legacy timeout exceeded the HTTP client's patience, and the retry path was reusing a pane that had already shown (and still had focus on) the consent dialog.After this PR, the first and only command sent is:
Terminal banner (confirming both flags landed):
Live launch — non-yolo path with profile.model
Command sent to tmux:
Terminal confirmation:
E2E suite (kiro_cli)
Comparison matrix (before → after)
--yolobypass flagprofile.modelflag--dangerously-skip-permissions✅--yolo✅--yolo✅--yolo✅--allow-all✅ (pre-existing)--trust-all-tools+--legacy-ui✅Out of scope
--modeloverride oncao launch(to overrideprofile.modelat runtime when switching providers) is discussed but not implemented here.kiro-cli < 2.0.1is installed is not added here; the consent-dialog regression is confirmed present in 2.0.1 itself and the--legacy-uibypass covers all affected versions.opencode_cli --yolo(writing a temp.mdwithpermission: {"*": "allow"}to$OPENCODE_CONFIG_DIR/agent/at launch time) is deliberately out of scope. Once upstream [FEATURE]: Add--dangerously-skip-permissions(aka YOLO mode) anomalyco/opencode#8463 lands a TUI-compatible--dangerously-skip-permissions/--yoloflag in a stable release, a ~5-line provider change will wire it in behind the existing"*" in self._allowed_toolscheck.Test plan checklist
test/providers/test_kiro_cli_unit.pypasses (91/91)test/e2e/kiro_cli subset passes (11/11)cao launch --yoloon a workflow that previously returned 500 now initializes cleanly on the first attemptcao launch(non-yolo) with a profile containingmodel:shows--modelon the kiro-cli command lineblack --check src/ test/passes