Repository navigation
fix: make gateway --approval yolo auto-approve dashboard chat tools - #31487
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix arms an existing grant from an existing flag. The new Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: FIX, closes #29697: a gateway started with
[FIRST-PRINCIPLES-REVIEWED] ffc14e3 Description read[DESCRIPTION-READ] 15bb40cd273b92fa2462ab1c38cca25388df71a19a2fce0ac9a8039b3d4c788f That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the flag now arms the existing declared grant through its existing controls, and the Slack carve-out keeps Slack behaving as it did before. Notes
[DESIGN-REVIEWED] ffc14e3 Description read[DESCRIPTION-READ] 6b3d2700170fd80512703df5ebb229170af92514f80279f38aabbc4fdfae8822 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
[operator: bolichen97] The red that remains on this PR belongs to |
1cc692d to
4eb77aa
Compare
A gateway started with --approval yolo still stopped dashboard chats on an approval card: only the background approval path read the flag, and dashboard chats read the process-wide safety override, which nothing armed from it. At startup the dashboard takes the declared grant from the flag (audit source cli), the same grant agent.dangerouslySkipPermissions uses: it is refused when an approval_modes policy denies yolo and bounded by the yolo_duration scope and yolo_max_seconds. Picking another mode in the dashboard ends it for dashboard chats. Closes #29697
4eb77aa to
ffc14e3
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on ffc14e3, no conflict, no open change request.
…31487) A gateway started with --approval yolo still stopped dashboard chats on an approval card: only the background approval path read the flag, and dashboard chats read the process-wide safety override, which nothing armed from it. At startup the dashboard takes the declared grant from the flag (audit source cli), the same grant agent.dangerouslySkipPermissions uses: it is refused when an approval_modes policy denies yolo and bounded by the yolo_duration scope and yolo_max_seconds. Picking another mode in the dashboard ends it for dashboard chats. Closes #29697 (cherry picked from commit f2d2537)
Problem / Motivation
Goal: A gateway started with
--approval yoloruns dashboard chat tool calls without an approval card, as the flag's help promises.kirocrew gateway --approval yolo(isolatedKIROCREW_HOME) still stops a dashboard chat on a permission card for a shell call, acron_addcall or a skill load. Nothing runs until someone clicks Allow, an unattended run is declined after the approval timeout, and the chat's mode picker shows Normal.Why it matters
Test harnesses, eval runs, pods and the GUI user test start the gateway with
--approval yoloso that no prompt ever appears (scripts/gui-user-test/boot.shsays so). In those runs every dashboard chat waits on a card instead, which is the opposite of the documented "'yolo' auto-approves all tools".Not a goal
--approval readsin dashboard chats. The dashboard's Reads rung is per slot (trust_reads) with no process-wide switch to seed, and--test-modedefaults toreads, so honouring it would change every test-mode harness. It needs its own issue.echo yolo > file, refused as an unsafe shell pattern) stays refused under yolo, and the "You rejected it" wording after that refusal is a separate defect.approval_modesdeny or a dashboard mode pick reach background turns.What changed (motivation → approach → change)
Dashboard chats stopped on a card because they decide auto-approval from the process-wide safety override, while the
--approvalflag only ever reached the orchestrator's background approval path. Nothing armed the override from the flag.The gateway passes its
--approvalvalue tostart_dashboard, and_apply_startup_yoloarms the override fromyolothroughgrant_declared_yolo(safety_override.py, which now takes the grant's source), with sourcecli. Slack also reads that override, so acligrant is the dashboard's only (SafetyOverride.is_cli_launchinsafety_override_grant.py): Slack'sis_yolo_mode, its/yolocommand and its subagent gate ignore it, and so does a dashboard turn a channel message started or steered, or one in a channel-linked slot (DashboardState.yolo_reaches, read wherever a dashboard turn decides or stores auto-approval).yolo_max_seconds,yolo_durationscopeapproval_modespolicy denyingyoloThe flag is a launch-time operator declaration (only the operator starting the process can pass it, it needs a non-default
KIROCREW_HOME,kirocrew restartrepeats it), so it lasts the launch like the config declaration. The CLI, governance and dashboard-bootstrap specs describe this.Backwards compatibility
Compatible: only a gateway launched with
--approval yolobehaves differently, and only in dashboard chats on unlinked slots, which now do what the flag documents. Slack and channel-linked dashboard turns ask as before.start_dashboardand_apply_startup_yolotake an optionalapproval_mode(defaultNone), andgrant_declared_yoloan optionalsource(defaultconfig), so every existing caller is unchanged.Removes nothing: the diff arms an existing grant from an existing flag; no path, record, validator or key is taken away.
Tests
test/test_dashboard_yolo_startup.py::test_gateway_approval_yolo_arms_a_cli_grant: the flag arms a no-expiry grant with sourcecli.::test_gateway_approval_yolo_leaves_slack_asking: under it,is_yolo_mode()is false and Slack's_resolve_approval_modeanswers interactive;::test_a_slack_yolo_grant_still_reaches_slackkeeps the owner's ownyolo onworking.::test_the_cli_grant_reaches_unlinked_dashboard_turns_onlyand::test_any_other_grant_reaches_every_dashboard_turn: the narrowing is thecligrant's alone.::test_gateway_approval_yolo_is_refused_when_policy_denies_yolo,::test_gateway_approval_yolo_is_refused_when_its_audit_fails,::test_gateway_approval_yolo_expires_at_the_time_cap,::test_gateway_approval_yolo_shows_on_the_status_bar,::test_only_gateway_approval_yolo_arms_the_grant,::test_gateway_approval_yolo_keeps_the_tool_gate_floors: the controls in the table, and that no other--approvalvalue arms anything.::test_an_ended_cli_grant_is_not_one:is_cli_launchcovers a live or renewablecligrant only.test/test_dashboard_chat_approval_mode.py::TestApiChatModePropagation::test_a_slot_pick_ends_gateway_approval_yolo: picking Reads or Trust on one slot ends the flag's grant, as it ends a declared one.test/test_slack_events_coverage.py::TestHandleYolo::test_the_cli_grant_is_not_slacksandtest/test_slack_handler_coverage.py::TestYoloCommand::test_the_cli_grant_is_not_slacks_to_renew: Slack's/yoloand!yoloread the grant as off and do not renew it.test/test_channel_approval_meta.py::test_a_cli_grant_leaves_channel_agents_asking: a channel agent shows its card under acligrant and auto-approves under a dashboard one.test/test_unattended_slot_guardrails.py::TestGatewayApprovalYoloReachesDashboardChatsOnly: through the turn runner, an unlinked dashboard turn auto-approves, while a Slack-linked slot's turn and a turn typed in Slack show the card and store noautopolicy.test/test_slack_gateway_run.py::TestInitDashboard::test_init_dashboard_creates_state: the orchestrator hands itsapproval_modetostart_dashboard.test/test_dashboard_server_composition_contract.pyandtest/test_state_parts_dashboard_state.py: the new_apply_startup_yolosignature and the newyolo_reachesmember.test/test_chat_mode_cron.pyandtest/test_chat_mode_security.pygive their override fakes the newis_cli_launchattribute.Determinism: the new tests and their files passed 20 runs at
-n0and 5 runs at-n 4 --dist loadgroupbesidetest_safety_override.py, and one shuffled run (122 ids, seed 31487).Proof: PROVEN test/test_channel_approval_meta.py::test_a_cli_grant_leaves_channel_agents_asking[cli-True], test/test_dashboard_chat_approval_mode.py::TestApiChatModePropagation::test_a_slot_pick_ends_gateway_approval_yolo[trust_reads], test/test_dashboard_chat_approval_mode.py::TestApiChatModePropagation::test_a_slot_pick_ends_gateway_approval_yolo[trust], test/test_dashboard_server_composition_contract.py::test_the_moved_names_keep_their_base_shapes, test/test_slack_events_coverage.py::TestHandleYolo::test_the_cli_grant_is_not_slacks[renew] (head 6efb4c7118bf; since then only rebased and black-formatted, now ffc14e3)
Manual verification
Not run against a live gateway. To check by hand:
KIROCREW_HOME=$(mktemp -d) kirocrew gateway --test-mode --approval yolo, open a dashboard chat and ask it to runsleep 1; echo ok. The command runs with no card and the status bar shows auto-approve on.Screenshots / video
N/A — no file under
website/changes.Related Issues
Closes #29697
Sibling sweep
Swept: git grep -n "safety_override().is_active()|is_yolo_mode()|state.is_yolo_active()" -- src/kiro_crew
Sibling: src/kiro_crew/slack/handler_runtime/access.py:214 -- changed here
Sibling: src/kiro_crew/slack/events_slash.py:233 -- changed here
Sibling: src/kiro_crew/slack/handler_runtime/commands.py:226 -- changed here
Sibling: src/kiro_crew/dashboard/chat_api/slot_approval.py:451 -- changed here
Sibling: src/kiro_crew/slack/gateway_runtime/subagent_wiring.py:331 -- changed here
Sibling: src/kiro_crew/channel.py:1571 -- changed here
is_yolo_modecovers the Slack queue, permission ladder, commands and home tab;/yoloand!yoloread and renew only Slack's view; a slot-scoped Reads or Trust pick ends acligrant as it ends a declared one; Slack's subagent spawn gate ignores acligrant, and a dashboard parent passes it on through its stored session policy; a dashboard channel agent (channel.py, which does not read the flag) keeps asking under acligrant.Sibling: src/kiro_crew/slack/gateway_runtime/turn_approvals.py:302 -- not affected -- that path already auto-approves on the flag itself
Sibling: src/kiro_crew/telegram/gateway.py:72 -- not affected -- reads the flag in _resolve_approval_mode on every message, as do the discord, feishu, imessage, teams, webex and wecom gateways
Sibling: src/kiro_crew/dashboard/chat_turn/turn_ending.py:390 -- not affected -- it reads yolo only to downgrade a recovery to a notice, which is the safer reading
Pattern harvest
Not generalizable: one launch flag had two consumers reading two different switches; no syntactic shape marks a flag whose second consumer was never wired.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license (see the Licensing section of CONTRIBUTING.md).