Repository navigation
fix(acp): add an opt-in to move unrequested claude sessions out of auto - #30308
Conversation
|
Merge order: please merge this before #30226 (the fix for #30169). #30226 lets a session that asked for The two PRs touch the same docstring field list in |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes on fbb78ba for one blocking point. CI has not run yet on this head (the fork workflows are waiting for approval), so I read the whole diff and checked what it changes against main.
The change moves claude sessions out of the mode they start in today, for people who did not ask for it.
On main, _pin_claude_starting_mode only runs on the exclusion path, on a Side Chat session and for a zero-tool spec. Any other claude session starts in whatever mode the user's own settings name, for example a defaultMode: auto in ~/.claude, and keeps it. With this PR the pin also runs on every session whose start sent Crew's MCP array. If that session reports auto, bypassPermissions or no mode, and Crew did not request that mode, it is sent session/set_mode default. Three behaviors change for existing users:
- A session that runs in
autotoday stops running inauto. Its tool calls now go through Crew's permission prompt where they did not before. - A
session/loadis pinned too, so a resumed session loses the mode its transcript was left in. - If the pin fails, or the adapter reports no mode and the call fails, the session is stopped with an
AcpError. That is a new way for a session that starts today to be refused.
This is added strictness that nobody asked for, so it should not be the default.
Please keep today's behavior when nothing requested a mode: sessions with no requested mode start and stay as they do now. If you want the broader pin, put it behind a setting that is off by default, and have the spec and the tests describe both states. A test that mounts a session with Crew's MCP array, a user auto start and no request, and asserts it is not pinned with the setting off, would pin the default.
The docs edits describe the stricter behavior as if it were already the rule, so they need to follow whichever default you keep. I have no other blocking points yet. I will take a full pass once CI has run.
|
Thanks for the careful read. I will keep today's behavior as the default: when nothing requested a mode, a session starts and stays in the mode it starts in, on The broader pin will move behind a setting that is off by default. The spec, the docs and the tests will describe both states, including the test you describe: a session that sent Crew's MCP array, a user I will push that once it passes the same local gates. |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level blocker: the setting is off by default and adds no new mechanism, only reusing the existing Notes
[DESIGN-REVIEWED] 8f4cc5e Description read[DESCRIPTION-READ] 4857025d9bccdc684bc4c15f97201b4d10a872857b71095e15a3baa62a5f4284 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 |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the new pin is off by default, the pins on main are kept, and the opt-in test moved rather than being deleted. One overlap with an existing helper and a Notes
What this change shipsInventory (6 items) — 4 justifiedIntent: let an operator stop Claude sessions that carry Crew's tools from starting in
[FIRST-PRINCIPLES-REVIEWED] 8f4cc5e Description read[DESCRIPTION-READ] 2908cc4b4fdb224dd820046ad8d2cd45f3f77f337063e40bc40878b13014c925 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
@bolichen97 I pushed the change you asked for (head The default is now today's behaviour: with nothing requested, a session starts and stays in the mode it starts in, on Your test is The spec, the host contract, |
fbb78ba to
5d19835
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Thanks, the opt-in setting is what I asked for. KIROCREW_CC_PIN_INHERITED_MODE is off by default, the old behavior stays for everyone who does not turn it on, and the tests cover both states. One small blocking point is left at 5d19835: two required checks are red on it for the same reason, and I confirmed it in the diff.
test/test_acp_claude_mode_pin_seam.py, the _setting_on fixture
_setting_on(self, monkeypatch, no_ambient_pin_setting) is an autouse fixture that requests the shared monkeypatch. The repository's determinism rule forbids a newly added autouse fixture that takes the shared monkeypatch, and the diff-only Semgrep scan reports it as an error (the SAST check is red), and the GPT 6.1 Review check blocks on the same line.
Fix: request _floor_monkeypatch instead of monkeypatch and use it for the setenv call, the way the other autouse fixtures in this PR already do (the conftest changes in this diff use it).
Everything else I read looks right to me. CI is still running on this head, so I have not judged the test results yet. I will approve once these two checks are green and the shards pass.
5d19835 to
0db2050
Compare
|
@bolichen97 Fixed in |
0db2050 to
a5b9b87
Compare
A claude session that requests no permission mode gets a seed with no permissions.defaultMode, so claude-agent-acp starts it in the mode the user's own settings name. With defaultMode auto or bypassPermissions in ~/.claude, tool calls run without session/request_permission and never reach Crew's gate. A resumed session starts in the mode its transcript was left in, so it comes back the same way. The default stays as it is: _pin_claude_starting_mode reads the starting mode back only on the project-owned-file path and on Side Chat, and every other session keeps the mode it started in. KIROCREW_CC_PIN_INHERITED_MODE, off by default and resolved by resolve_cc_pin_inherited_mode, extends the pin to every other claude session whose start sent Crew's MCP array, after session/new and after session/load. An auto, bypassPermissions or unreported mode is moved to default before the first prompt, and a failed pin stops the session. plan and acceptEdits are kept, and so is a reported mode that is the one Crew requested. A session that sent no Crew MCP array keeps the adapter's mode. A truthy value turns the setting on; any other value leaves it off, and one that is not a falsy spelling logs a warning. With the setting on, the pin reads the array the start sent, not a new projection: the re-seed after the start clears the projection cache, and projecting again would read the spec and settings files on the event loop. A session the setting brings in on an adapter below CLAUDE_ACP_SETTING_SOURCES_MIN_VERSION, or one that reports no version, keeps the mode it started in. The seed bytes are unchanged.
a5b9b87 to
8f4cc5e
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving 8f4cc5e. Both points from my earlier reviews are fixed.
What I checked on this head:
- The pin of an inherited starting mode is now behind
KIROCREW_CC_PIN_INHERITED_MODE, which is off by default. A session that asked for no mode keeps the mode it starts in today. The default behavior is not tightened. - The pin on the exclusion path and on a Side Chat session is unchanged, and the pin only moves
autoorbypassPermissionstodefault. - The seam tests run with the setting both on and off, and the shared
monkeypatchproblem in the autouse fixture is gone (it uses its own_floor_monkeypatchnow). - The docs (acp client, agent host contract, claude code provider, configuration) describe the off-by-default setting and the default behavior.
- A scan of the added lines for
re.compile,re.search,re.match,re.sub,re.findallandRegExpfinds none. - This head is a rebase onto current main. Fork CI ran on it: E2E, Integration, Coverage Combine and Coverage Gate passed, all 8 backend shards and the frontend shards passed, and 0 checks are red. Only PR Readiness is still pending, and it waits on Issue Gate.
Auto-merge is set to wait for PR Readiness.
Problem / Motivation
Goal: with a new setting,
KIROCREW_CC_PIN_INHERITED_MODE, turned on, a Claude session that carries Kiro Crew's tools never reaches its first prompt inautoorbypassPermissionsunless Crew requested that mode, whatever the user's own Claude Code settings or a resumed transcript say (claude-agent-acp 0.84.0 or newer). The setting is off by default, and with it off every session behaves as on main.A claude session that requests no permission mode gets a seeded
<work_dir>/.claude/settings.local.jsonwith nopermissions.defaultMode. claude-agent-acp then takes the starting mode from the user's own settings, so"defaultMode": "auto"in~/.claude/settings.jsonstarts the Crew session inauto. Inauto, Claude's classifier approves tool calls, and an approved call sends nosession/request_permission(docs/system-specs/modules/claude-code-provider.md, "What Crew gates on this harness"). Crew's deny rules, sensitive-path checks, approval card and SEL decision record never see it. AbypassPermissionsthere does the same for every call.A resumed session starts in the mode its transcript was left in, so a session that ran in
autocomes back inauto.The spec says a session opens past the asking mode "only on purpose", and nothing in Crew asked for it here. The host contract's Auto mode row on main reads "a session that carries Crew's tools and starts in
bypassPermissionsorautowithout Crew asking for it is pinned todefaultbefore its first prompt, and stopped if the pin fails" (docs/system-specs/modules/agent-host-contract.md), but_pin_claude_starting_modedoes that only on the project-owned-file path and on Side Chat.Why it matters
Anyone whose own Claude Code default is
autoorbypassPermissionsand who selects the claude backend has every Crew claude session that carries Crew's tools and is neither on the exclusion path nor a Side Chat (chat, subagent, cron, crew member) decided by Claude instead of Crew: inautofor every call the classifier approves, inbypassPermissionsfor every call. No Crew setting changes that. The unasked-call audit does not record these calls either: it runs only when Crew itself requestedauto.Not a goal
planoracceptEdits. The pin moves only the modes that approve calls without asking Crew (auto,bypassPermissions), as on the exclusion path today.acceptEditsapproves the file edits it covers without asking, and a userautoon a model without Auto support starts inacceptEdits, where edits under the work dir run without asking Crew. Moving it would override a posture the user chose, and is a separate change."tools": []helper or a session whose array was withheld.test_a_session_without_crews_array_gains_no_pinrecords "No Crew tools, no pin: the adapter's own mode is left alone", and this change keeps that decision; its built-in calls still run unasked under a userauto. Whether such a session should be pinned too is a question for a maintainer, because it reverses that recorded decision.planthrough ExitPlanMode.autoopt-in start inauto. On claude-agent-acp 0.97.0 and 0.100.0 the SDK drops anautothat comes from thelocaltier, soKIROCREW_CC_PERMISSION_MODE=autostarts a new session indefault, before and after this change. That is claude backend: KIROCREW_CC_PERMISSION_MODE=auto starts the session in default mode, and turns off the user's own auto #30169.autoorbypassPermissionsin a Crew session. claude_code: do not silently write .claude/settings.local.json; let users add models to availableModels #24870 asks Crew to write less intosettings.local.json; this change writes nothing new there, and it moves only the two modes that skip Crew's gate.permissions.allowrules inherited from~/.claude, the rest of the spec's "Known gap: the user's global~/.claudeis inherited".What changed (motivation → approach → change)
Symptom: a claude session that carries Crew's tools and requested no mode starts in the user's own
autoorbypassPermissions, onsession/newand onsession/load. Root cause: the seed omitsdefaultModewhen nothing was requested, so the user's settings and the transcript choose the mode, and_pin_claude_starting_modereads the mode only on the exclusion path and Side Chat. Both are still true on main ata3a737b65.Approach: a maintainer asked that today's behaviour stay the default, so the broader pin is an operator opt-in in the style of
KIROCREW_CC_PERMISSION_MODE: the environment variableKIROCREW_CC_PIN_INHERITED_MODE, declared asCC_PIN_INHERITED_MODE_ENVand resolved byresolve_cc_pin_inherited_mode()inagent_sdk/backends_models.py(re-exported fromagent_sdk/backends.py).1,true,yesoronturns it on; anything else leaves it off, and a value that is not0,false,noorofflogs a WARNING. Like that lever it has no config key and no Settings row. The pin reads it when a session starts.Setting off (the default): the pin returns at its first check for every session that is not on the exclusion path, a Side Chat or a zero-tool spec, as on main, and those three keep main's behaviour.
Setting on: the pin also runs on every other claude session that carries Crew's MCP array, after
session/newand a successfulsession/load. It reads that from the array the start sent (_mcp_mount_servers), so it projects nothing on the event loop.auto,bypassPermissionsor no reported mode getssession/set_modedefaultbefore the first prompt, unless it is the mode Crew requested (never kept on Side Chat or the exclusion path); a failed call stops the session. A session this brings in on an adapter belowCLAUDE_ACP_SETTING_SOURCES_MIN_VERSION, or with no reported version, is left as it started. The same call and stop have run on the exclusion path since #14981 and on Side Chat since #19059, and the adapter reports the mode on 0.84.0, 0.94.0, 0.97.0 and 0.100.0 (test/fixtures/claude_mode_pin/,test/fixtures/acp_frames/claude/session.jsonl, Manual verification).No pin on main is reversed:
test_a_crew_authored_session_is_not_pinnedstays, now on both paths, and the spec's "The pin runs only on this path and on a Side Chat session" and "Known gap: the user's global~/.claudeis inherited" stay true by default, each followed by what the setting changes.Docs: comments and docstrings that described the broader pin as the rule now name the setting (the pin, the seed writer,
client_class.py,resolve_cc_permission_mode, the mirror ruling inproviders/mirrors/claude_code.py);backends_routing.py,types.pyand the unrecognised-mode warning are reworded to hold in both states.configuration.mdgains a row for the setting, and itsKIROCREW_CC_PERMISSION_MODEaudit caveat is corrected: a classifier-approved call skips Crew's tool-call hook and permission-decision record and gets atool_invocationrecord only after it finishes (_maybe_audit_unasked_tool_call).claude-code-provider.md,agent-host-contract.md(its Auto mode row now names which sessions are pinned by default and which the setting adds) andacp-client.md(which said the seed writesdefaultMode: default) describe both states. The same note inagent_sdk/tool_gate.pyis left for a maintainer, because it is a sensitive path.Backwards compatibility
Compatible: with
KIROCREW_CC_PIN_INHERITED_MODEunset, the default, no session changes behaviour, and no key, field or value main accepts is rejected; no seed byte changes.Log text: the WARNING the pin logs and the error a failed pin raises now say the mode approves calls without asking Crew's gate or was not reported, instead of "while carrying Crew's tools", and the
KIROCREW_CC_PERMISSION_MODEunrecognised-value warning says the session runs as if no mode was requested. Both pin messages can appear by default only on the exclusion path and Side Chat, where they appear on main.With the setting on, on claude-agent-acp 0.84.0 or newer: a claude session that carries Crew's tools and whose start response names
auto,bypassPermissionsor no mode, other than the mode Crew requested, getssession/set_modedefaultbefore its first prompt, and is stopped if that call fails. A failed start is retried once with a new process, as any start failure is; the resume id is consumed on the first attempt, so a resumed session whose pin fails comes back as a new conversation, as on the exclusion path today. An adapter that one day reports nomodesand also refusessession/set_modewould stop these sessions. A session that starts indefault,planoracceptEdits, or carries no Crew MCP array, gains no call. Such an operator's Crew claude sessions then ask Crew about each call no rule decides: a dashboard chat innormalapproval shows a card, and a cron withoutapproval_mode: automeets the same request. Crew's own trust approval, orapproval_mode: autoon the cron, approves those calls without asking; Crew's deny rules still apply. An opt-in session that starts or resumes inautokeeps it; one that starts or resumes inbypassPermissions, or reports no mode, is moved todefault.Removes nothing: no key, record, path or public function is removed; the change adds one environment variable, off by default, and one resolver.
Tests
Driven by the recorded claude-agent-acp 0.84.0 answers in
test/fixtures/claude_mode_pin/. The pin on a session that carries Crew's tools and is neither excluded nor a Side Chat is tested in a new module,test/test_acp_claude_mode_pin_seam.py, so the seam module stays under the 1,600-line target. The recorded transports it shares with the seam module (_pin_harness,_recorded_results,_adapter_transport) move intotest/acp_session_mcp_helpers.pyas plain functions; only theclsargument of_adapter_transportis dropped. The helpers module also gainsno_ambient_pin_setting, an autouse fixture both pin modules import, which clearsKIROCREW_CC_PIN_INHERITED_MODEso the test host's environment cannot decide a result, and spells the variable's name asconfiguration.mddocuments it.test/test_acp_claude_mode_pin_seam.py::TestUnrequestedModePinruns with the setting on (a class fixture sets it to1):test_a_crew_authored_session_is_pinned_off_an_approving_mode(autoandbypassPermissions, onsession/newandsession/load): the seed names nodefaultMode, onesession/set_modedefaultis sent, and the session keeps Crew's MCP array.test_a_crew_authored_session_in_a_mode_that_asks_gains_no_call(default,plan,acceptEdits,dontAsk, both paths): nosession/set_mode.test_a_crew_authored_session_that_reports_no_mode_is_pinned: a response with nomodesis pinned.test_a_failed_pin_stops_a_crew_authored_session: a failingsession/set_modestops the harness.test_a_load_that_did_not_take_is_pinned_once_on_the_new_session: asession/loadwith nomodesfalls through tosession/new, which is pinned once.test_a_failed_pin_on_a_resumed_session_is_not_taken_for_a_failed_load: a failed pin after a load stops the harness and sends nosession/new.test_the_deny_re_read_stays_on_the_exclusion_path: a checked-in project deny rule does not stop a session whose file Crew wrote.test_an_opt_in_session_that_starts_or_resumes_in_bypass_is_pinned(both paths): the opt-in keepsautoonly, so a requestedautothat reportsbypassPermissionsis pinned.test_a_crew_opt_in_mode_is_not_overridden(moved, now on both paths): a requestedautothat starts inautois not pinned.test_the_pin_does_not_project_the_array_again(both paths): through the real start, the projection cache is cold when the pin runs, and the pin makes no projection of its own.test_a_sent_array_is_pinned_though_a_new_projection_withholds_it(both paths): a session that sent Crew's array is pinned even when any later projection returns no servers.test/test_acp_claude_mode_pin_seam.py::TestUnrequestedModeKeptByDefaultruns with the setting off:test_a_user_auto_start_with_crews_array_is_not_pinned(both paths), the case the review asked for: a user~/.claudedefaultMode: auto, Crew's MCP array sent on the wire, no requested mode. Nosession/set_modeis sent and the session is not stopped.test_the_setting_reaches_the_pin_from_its_env_var(1,trueandOnpadded with spaces pin;0,offand2do not): the value in the environment at the start decides whether a userautostart is pinned.test/test_acp_claude_mode_pin_seam.py::TestResolveCcPinInheritedMode: the variable has its documented name; unset is off with no warning;1,true,TRUE,yes,onand1padded with a space and a newline are on; empty,0,false,noandoffare off with no warning;2,enabled,autoanddefaultare off and logged with the variable's name.In
test/test_acp_session_mcp_client_seam.py::TestClientSeam:test_a_crew_authored_session_is_not_pinned(main's test, now onsession/newandsession/load): with the setting unset, a session whose file Crew wrote keeps a userbypassPermissionsand gains nosession/set_mode.test_a_side_chat_opt_in_is_still_pinned: a Side Chat session is pinned even withautorequested.test_an_adapter_below_the_floor_is_not_pinned(both paths, setting on): 0.83.0 and an unreported version keep today's behaviour and are not stopped.test_a_session_without_crews_array_gains_no_pin(both paths, setting on and off): a session with no Crew MCP array keeps the adapter's mode.A mutation check of the pin and the resolver killed all 19 mutants against these three modules and
test_claude_zero_tools.py: ignoring the setting either way, any non-empty value turning it on, no trimming or lower-casing, no warning, a warning on a falsy value, and the 13 pin mutants of the previous round.Determinism: the changed tests (60 ids) passed 20 runs at
-n0, 10 runs at-n 4 --dist loadgroup --max-worker-restart=2besidetest_acp_session_mcp_client_seam.pyandtest_acp_session_mcp.py, and one shuffled order (seed 21983, 60 ids).Gate proof: tree 54ddafb98af8; ran 24; skipped none
Proof: PROVEN test/test_acp_claude_mode_pin_seam.py::TestUnrequestedModePin::test_a_crew_authored_session_is_pinned_off_an_approving_mode[new-auto], test/test_acp_claude_mode_pin_seam.py::TestUnrequestedModePin::test_a_crew_authored_session_is_pinned_off_an_approving_mode[new-bypassPermissions], test/test_acp_claude_mode_pin_seam.py::TestUnrequestedModePin::test_a_crew_authored_session_is_pinned_off_an_approving_mode[load-auto], test/test_acp_claude_mode_pin_seam.py::TestUnrequestedModePin::test_a_crew_authored_session_is_pinned_off_an_approving_mode[load-bypassPermissions], test/test_acp_claude_mode_pin_seam.py::TestUnrequestedModePin::test_a_crew_authored_session_that_reports_no_mode_is_pinned (head 8f4cc5e)
Manual verification
Tested against claude-agent-acp 0.84.0, 0.90.0, 0.97.0 and 0.100.0 (Claude Code CLI 2.1.318 on 0.100.0). Each case used a fresh
CLAUDE_CONFIG_DIRwhosesettings.jsonheld only the case'spermissions.defaultMode,model,env.AWS_REGIONand the credential export. Where a prompt ran, it asked for one Bash call that writes a file in the session's temp directory.This revision, Crew's own
AcpClienton 0.100.0 throughensure_ready(), over main at4194602e6, userauto, no requested mode, an agent spec with one stdio MCP server,session/new, no prompt:KIROCREW_CC_PIN_INHERITED_MODEunset: seed{},session/newcarriedkirocrew-core,kirocrew-cronand the stdio server, the adapter reportedauto, nosession/set_modewas sent, and the start completed. This is main's behaviour.KIROCREW_CC_PIN_INHERITED_MODE=1: the same start, and the projection cache was cold when the pin ran; Crew logged the WARNING pin line, sentsession/set_modedefault, and the start completed.The runs below were made on earlier revisions of this change, where the broader pin ran by default. That is the code path the setting now turns on, so "the broader pin" below means this change with the setting on.
Raw adapter over stdio on 0.84.0, 0.90.0 and 0.97.0,
_meta.claudeCode.options{}, the same results on all three versions:auto,session/new,{}insettings.local.json(the seed shape with no request):modes.currentModeIdwasauto, and the Bash call ran with nosession/request_permission.session/loadof that transcript, same{}seed: reportedauto. Aftersession/set_modedefault(answered{}, then aconfig_option_updatenamingdefault), the next Bash call raisedsession/request_permission.bypassPermissions,session/new,{}seed on 0.84.0 and 0.90.0 (no seed file on 0.97.0): started inbypassPermissionsand the call ran unasked;session/set_modedefaultanswered{}, and the next call raisedsession/request_permission.Crew's own
AcpClienton 0.97.0, real_spawn()and_initialize_session(), no prompt, the broader pin:auto, no requested mode: wrote{}, logged the WARNING pin line, sentsession/set_modedefault(answered{}), stayed up, and the adapter then reporteddefault.plan, no requested mode: nosession/set_mode, stayed inplan.autorequested, userdefaultor userauto: seededdefaultMode: auto, the session started indefault, and nosession/set_modewas sent.Crew's own
AcpClienton 0.100.0, throughensure_ready()andsend_message(), userauto, and an agent spec with one stdio MCP server, sosession/newcarried Crew's MCP array (kirocrew-core,kirocrew-cronand that server):e33330f8f(and before at4a546774f), no requested mode: seed{},session/newreportedauto, nosession/set_modewas sent, and the Bash write ran with nosession/request_permission. The file was written.{},session/newreportedauto, Crew logged the WARNING pin line and sentsession/set_modedefault(answered{}, then aconfig_option_updatenamingdefault). The Bash write then raisedsession/request_permission, and Crew's gate refused it (no approver in that run), so the file was not written. Run three times with the same result.session/loadof the transcript main had just left inauto: the load reportedauto, Crew sentsession/set_modedefault, and the Bash write raisedsession/request_permission. A second load of the same transcript, with no prompt and with the user tier changed todefaultMode: default, still reportedauto, so a loaded session takes its mode from the transcript, not from the user's settings.KIROCREW_CC_PERMISSION_MODE=auto,session/new: seeddefaultMode: auto, the session started indefault(the SDK drops alocal-tierauto, see Not a goal), nosession/set_modewas sent, and the Bash write raisedsession/request_permission.KIROCREW_CC_PERMISSION_MODE=auto,session/loadof a transcript main had left inauto: the load reportedauto, the mode Crew requested, so nosession/set_modewas sent, and the Bash write ran with nosession/request_permission.Related Issues
Part of #29909
This no longer closes #29909 by default. A maintainer asked that a session with no requested mode keep starting and staying in the mode the user's own settings or its transcript name, so the default stays as on main, and the fix reaches only operators who turn on
KIROCREW_CC_PIN_INHERITED_MODE. Whether #29909 should stay open for the default, or be closed as answered by the setting, is a maintainer's call.Related: #12743 (open: no host check before a classifier-approved call in a session that opts in to
auto), #12692 (with no opt-in the seed writes nodefaultMode), #14981 (the read-back on the exclusion path), #19059 (the read-back on Side Chat), #24870 (open: write less intosettings.local.json; this change writes nothing new there).Overlap: #30093 (merged) changed
_pin_claude_starting_modetoo; this change is rebased on it and keeps its zero-tool floor stop and its no-pin return. #26459 (open) also edits that function. #30226 (open, applies a requestedautowithsession/set_mode) conflicts with this change inagent-host-contract.md,client_claude_seed.py,client_claude_session.pyandconfiguration.md; each conflict is textual, so whichever lands second needs a rebase. #30226 asked to merge after this change because this change re-pinned a resumed session; with the setting off by default it no longer does that by default (see #30226).Question for a maintainer: should a session that carries no Crew MCP array, or one on an adapter that reports no version, be pinned too when the setting is on? Both are left as they start (Not a goal), which keeps the recorded decision in
test_a_session_without_crews_array_gains_no_pin.Sibling sweep
Swept: git grep -nE "_verify_goose_routing(|_pin_claude_starting_mode(|_verify_opencode_routing|seeded_setting_issue(|ACP_BACKEND_FORBIDDEN_MODES" -- src/kiro_crew/acp
Sibling: src/kiro_crew/acp/client_claude_session.py -- changed here
Sibling: src/kiro_crew/acp/client_permissions.py -- not affected --
_verify_goose_routingreads goose's mode back after every session/new and session/load, and_tripwire_session_configstops a session that reports a mode inACP_BACKEND_FORBIDDEN_MODES(copilot's autopilot)Sibling: src/kiro_crew/acp/harness/opencode.py -- not affected --
_verify_opencode_routingreads the harness's resolved permission config back on every sessionPattern harvest
Rule candidate: review-prompt
Pattern: a harness permission mode Crew does not set comes from the user's own config or a resumed transcript; reading the reported mode back on every session, instead of trusting an omitted settings key, is the check, and turning it on where users did not ask for it needs an opt-in.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement