Repository navigation
fix(context): load Crew steering on opencode and pi - #38452
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the fix adds members to the one set that gates Crew's steering load, and the folder dedup and steering list read that same set. Notes
[DESIGN-REVIEWED] 27f21c3 Description read[DESCRIPTION-READ] 2b2f19e188f07759f47fc39f66a218965b1b20d9545f028d5ec3041798f6c84e 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Two set memberships close a measured, issue-linked gap (#38451, R-SPEC-6). The AGENTS.md dedup and the folder-steering skip both follow from that one gate. Not checked: whether opencode 1.19.1 and pi 1.4.0 read the cwd What this change shipsInventory (4 items) — 4 justifiedIntent: opencode and pi users'
[FIRST-PRINCIPLES-REVIEWED] 27f21c3 Description read[DESCRIPTION-READ] e3c1259d8a5eafe9585a2542e22ff548441a646cedb35413316b60efd14a21e5 That sha256 names the PR description this verdict read. 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: |
1ef9610 to
27f21c3
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier 2: design-doc-gate: D. Adds opencode and pi to ACP_BACKENDS_CREW_LOADS_SPEC_STEERING and ACP_BACKENDS_NATIVE_PROJECT_AGENTS_MD. Every place that reads these sets follows consistently: the steering load gate, folder dedup (default agent only), the steering list, and the custom-agent notice. The per-file off switch stays Claude Code only. Neither harness nor any mirror loads .kiro/steering itself, so nothing is sent twice. Both harnesses start in the session folder, which matches how Codex already leaves AGENTS.md out. Only the author's live run shows each harness reads AGENTS.md from there. New tests cover fresh and post-compaction delivery on both harnesses plus exact set membership; CI is green. Tier: 2, held for a person: design-doc-gate: D. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved. I checked this head: PR Readiness is green. The only code change adds opencode and pi to two named ACP_BACKENDS_* sets in agent_sdk/backends_routing.py, and the kiro and KAS paths are unchanged. The context assembly, folder dedup and dashboard steering list all read those same sets. A run of the two changed test modules passed on the head, and 9 tests failed when the head tests ran against the base code. Putting ACP_BACKENDS_NATIVE_PROJECT_AGENTS_MD back to codex only turns 5 tests red, so the AGENTS.md exclusion is pinned on its own. Done well: tests that used opencode as the "no path" example now use deepseek, so the no-path branch still has real coverage.
The design is signed off under the standing maintainer sign-off for changes by team members.
- Optional:
docs/architecture/harness-gap-analysis.mdchanges the R-SPEC-6 cells, but R-SPEC-6 is still in the opencode and pi "Unknown" lists, and the section headers and per-harness summary counts were not updated. - Optional: parametrize the codex folder-dedup builder tests over opencode and pi as well, and update the module docstring of
test/test_folder_steering_provider_dedup.py, which still says OpenCode has no path. - Optional: #38661 adds mimocode to the same frozenset. Whichever PR lands second needs to keep both sets of members.
Problem / Motivation
Goal: Steering files reach the model on the opencode and pi backends, the same way they do on Claude Code and Codex.
On opencode and pi, a Kiro Crew default-agent chat gets none of the user's steering: neither
~/.kiro/steering/*.mdnor<project>/.kiro/steering/*.mdreaches the model. Measured on main433d99bfwith marker files, the first model request held the global and project markers 0 times each; Claude Code and Codex on the same rig held each once, with theinclusion: autodocument withheld.Why it matters
Every opencode or pi user who keeps rules in
.kiro/steeringhas those rules silently ignored. Harness requirement R-SPEC-6 (docs/architecture/harness-requirements.md).Not a goal
spec_steering_read_nowhereto read, so a custom agent's ownfile://steering gets no notice. That predates this change.What changed (motivation → approach → change)
Symptom: no steering on opencode and pi. Root cause: neither harness reads
.kiro/steeringitself (nothing inacp/harness/opencode.pyoracp/harness/pi.pynames it), and both are outsideACP_BACKENDS_CREW_LOADS_SPEC_STEERING(agent_sdk/backends_routing.py), so Crew's load (context_assembly/inclusion.pysteering_resources_part) skips them.Change: add
opencodeandpitoACP_BACKENDS_CREW_LOADS_SPEC_STEERING. Both also joinACP_BACKENDS_NATIVE_PROJECT_AGENTS_MD, because each loads the project'sAGENTS.mdfrom its working directory (the ACPcwdCrew sends); Crew's load then leaves that file out so it is not sent twice. Folder steering reads the same set (_project_steering_delivered), so a folder chat on opencode or pi now skips the two trees as delivered. Prose naming the steering-load harnesses is updated to match (docstrings,agent-spec-fields.md,steering-and-hooks.md,context-management.md,harness-gap-analysis.md,providers.md,memory-skills-hooks.md, feature map).Backwards compatibility
Compatible: two backends gain a prompt section they lacked; nothing main accepts is rejected or renamed.
Removes nothing: the change only adds members to two sets; folder steering on opencode and pi stops duplicating trees that Crew's load now sends.
Tests
test_opencode_and_pi_receive_project_and_global_steering_once_and_not_agents_md(opencode and pi, fresh and after compaction): global and project rule once each, noautodocument, noAGENTS.md.test_crew_loads_spec_steering_names_exactly_the_harnesses_handed_no_spec: both sets' exact membership.test_project_steering_delivered_names_every_existing_path: opencode and pi rows now delivered; deepseek kept as the no-path row.test_a_cold_chat_lists_global_steering_as_its_harness_receives_it: opencode and pi listyes.Proof: PROVEN test/test_chat_steering_plan.py::test_a_cold_chat_lists_global_steering_as_its_harness_receives_it[opencode-yes-], test/test_chat_steering_plan.py::test_a_cold_chat_lists_global_steering_as_its_harness_receives_it[pi-yes-], test/test_folder_steering_provider_dedup.py::test_project_steering_delivered_names_every_existing_path[opencode-False-True], test/test_folder_steering_provider_dedup.py::test_project_steering_delivered_names_every_existing_path[pi-False-True], test/test_folder_steering_provider_dedup.py::test_opencode_and_pi_receive_project_and_global_steering_once_and_not_agents_md[opencode-fresh] (head 1ef9610)
Manual verification
Live, on this branch, with a loopback stub model logging every request (opencode 1.19.1; pi-acp 0.0.34 + pi 1.4.0), project steering, global steering, an
inclusion: autodocument and a projectAGENTS.md, each with a marker: the main model request held global 1, project 1, auto 0,AGENTS.md1 (the harness's own read) on both. Before the change, on main433d99bf: 0, 0, 0.Related Issues
Fixes #38451
Sibling sweep
Swept: git grep -nE "ACP_BACKENDS_CREW_LOADS_SPEC_STEERING|crew_loads_spec_steering|reads_project_agents_md" -- src/
Sibling: src/kiro_crew/context.py:1092 -- not affected -- folder dedup reads the same set, so it follows the change
Sibling: src/kiro_crew/steering_plan.py:125 -- not affected -- steering list reads the same set, so it follows the change
Sibling: src/kiro_crew/dashboard/handlers/chat_steering.py:143 -- not affected -- steering list loader reads the same set
Pattern harvest
Not generalizable: a harness membership left out of one capability set; the set is the single gate, so adding the members is the whole fix.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.