Skip to content

fix(context): load Crew steering on opencode and pi - #38452

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
ee-round12/r-spec-6-steering
Nov 17, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
ee-round12/r-spec-6-steering

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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/*.md nor <project>/.kiro/steering/*.md reaches the model. Measured on main 433d99bf with 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 the inclusion: auto document withheld.

Why it matters

Every opencode or pi user who keeps rules in .kiro/steering has those rules silently ignored. Harness requirement R-SPEC-6 (docs/architecture/harness-requirements.md).

Not a goal

  • Steering for a custom agent on opencode or pi (Crew's load serves the default agent only, as on Claude Code and Codex; the folder still carries the trees there).
  • The custom-agent notice on pi: pi has no mirror for spec_steering_read_nowhere to read, so a custom agent's own file:// steering gets no notice. That predates this change.
  • The per-file steering switch, which stays Claude Code only.

What changed (motivation → approach → change)

Symptom: no steering on opencode and pi. Root cause: neither harness reads .kiro/steering itself (nothing in acp/harness/opencode.py or acp/harness/pi.py names it), and both are outside ACP_BACKENDS_CREW_LOADS_SPEC_STEERING (agent_sdk/backends_routing.py), so Crew's load (context_assembly/inclusion.py steering_resources_part) skips them.

Change: add opencode and pi to ACP_BACKENDS_CREW_LOADS_SPEC_STEERING. Both also join ACP_BACKENDS_NATIVE_PROJECT_AGENTS_MD, because each loads the project's AGENTS.md from its working directory (the ACP cwd Crew 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, no auto document, no AGENTS.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 list yes.
  • Tests that used opencode as the "no path" example now use deepseek.

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: auto document and a project AGENTS.md, each with a marker: the main model request held global 1, project 1, auto 0, AGENTS.md 1 (the harness's own read) on both. Before the change, on main 433d99bf: 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 17, 2026 13:34
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • Leaving AGENTS.md out on opencode and pi assumes each harness reads it from the ACP cwd. Only the live run in Manual verification shows this (AGENTS.md 1). If a harness version stops reading it, the file silently stops arriving, so a pinned harness version or a harness-level check would hold the assumption in place.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 AGENTS.md themselves. Only the description's live run vouches for it.

What this change ships

Inventory (4 items) — 4 justified

Intent: opencode and pi users' .kiro/steering rules reach the model, as they do on Claude Code and Codex. FIX.

  1. Default-agent chats on opencode and pi now receive global and project steering at session start and again after compaction — justified
  2. On opencode and pi, Crew's steering load leaves out the project AGENTS.md, so the harness's own read is the only copy — justified
  3. Folder steering on opencode and pi stops re-sending the two .kiro/steering trees it now counts as delivered — justified
  4. Steering list in the chat panel shows global steering as yes on opencode and pi — justified

[FIRST-PRINCIPLES-REVIEWED] 27f21c3

Description read

[DESCRIPTION-READ] e3c1259d8a5eafe9585a2542e22ff548441a646cedb35413316b60efd14a21e5

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 27f21c3

Verdict parsed from the review's SHA-scoped output markers for commit 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 27f21c3

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 27f21c31e1b87cb1f1b1eef52023e356f8b0d7fb false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 17, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 17, 2026
@iamwhatever
iamwhatever force-pushed the ee-round12/r-spec-6-steering branch from 1ef9610 to 27f21c3 Compare November 17, 2026 14:53
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 17, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 17, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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 27f21c31e1 · 179 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 17, 2026 17:57

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md changes 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.

@KiroCrewCaptain
KiroCrewCaptain merged commit cf0dcb3 into main Nov 17, 2026
157 of 158 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the ee-round12/r-spec-6-steering branch November 17, 2026 17:58
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Steering files never reach the model on opencode and pi

2 participants