Repository navigation
fix(acp): identify a todo_list result by its cached call name - #11922
Conversation
|
Intent: Make a live Not a goal: any change to the crew log emitter or to |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the child-ownership record only needs the KAS gate — a kiro-backend frame carrying [DESIGN-REVIEWED] f823392 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the child-ownership guard's KAS-only scope: no other backend flat-mirrors child tool frames whose cached name the new fallback would now resolve. Not justified as shipped
What this change shipsInventory (6 items) — 5 justifiedIntent: FIX — make an agent's todo_list results reach the task panel and the crew log, which every live call misses today (fixes #11915; the base fixture
Pin deletions are declared with checkable evidence: the removed allowlist reason ("chat_runner does not inspect it") is contradicted on base by [FIRST-PRINCIPLES-REVIEWED] f823392 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsThe change is a coherent, well-scoped bug fix with matching tests. I traced the child-id set write/read scoping, the filter loop's interaction with the stat branches (a No findings. [OPUS-REVIEWED] f823392 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 5.6 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 5.6 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/acp/session_handle.py:4795 -- child call-ID retention has no count bound
Adjudication (Opus 4.8) — is blocking on each finding proportionate?F1 — I opened session_handle.py:4795 (the
[ADJUDICATION] f823392 total=1 uphold=0 downgrade=1 False positive or not applicable? A repository writer can comment: |
kiro-cli puts _meta.kiro.toolName on the tool_call frame alone. The tool_call_update frame that carries rawOutput has no _meta at all, so parse_todo_snapshot asked the result frame for an identity it never holds and dropped every live todo_list snapshot. Fall back to the name the preceding tool_call cached under this call id, read through scoped_tool_cache_key so the entry stays origin-bound. A frame that does assert an identity is still believed as it stands. Two more drops sat on the same path. AcpProvider._to_llm_event rebuilt the event without todo, so the snapshot died at the provider boundary and chat_runner cleared the panel instead of filling it; the parity allowlist excused that with a reason that was false. And because the result frame carries no _meta, a native subagent's own todo result has no agentSubtaskId either, so it fell through to the parent-scope parse and the new fallback let a child's list overwrite the parent's plan. The todo event now carries its call id and the handle drops one whose call id belongs to a tagged native child. Fixes #11915
eda93c4 to
f823392
Compare
|
self-added: yes
|
|
self-added: no
|
|
self-added: yes
|
|
self-added: no
|
bolichen97
left a comment
There was a problem hiding this comment.
Approved after verification: PR Readiness success on this head, no active change requests or unresolved threads, mergeable against current main.
…tdev#11922) kiro-cli puts _meta.kiro.toolName on the tool_call frame alone. The tool_call_update frame that carries rawOutput has no _meta at all, so parse_todo_snapshot asked the result frame for an identity it never holds and dropped every live todo_list snapshot. Fall back to the name the preceding tool_call cached under this call id, read through scoped_tool_cache_key so the entry stays origin-bound. A frame that does assert an identity is still believed as it stands. Two more drops sat on the same path. AcpProvider._to_llm_event rebuilt the event without todo, so the snapshot died at the provider boundary and chat_runner cleared the panel instead of filling it; the parity allowlist excused that with a reason that was false. And because the result frame carries no _meta, a native subagent's own todo result has no agentSubtaskId either, so it fell through to the parent-scope parse and the new fallback let a child's list overwrite the parent's plan. The todo event now carries its call id and the handle drops one whose call id belongs to a tagged native child. Fixes kirodotdev#11915
Problem / Motivation
An agent's task list never shows up. The task panel above the chat composer stays
empty for a whole session, and the crew log has no
plan/updatedentry for anytodo_listcall.Observed live on 2026-09-18 (gateway
1ae8f6ee48, kiro-cli 2.22.1,KIROCREW_CREW_LOG=1): twotodo_listcalls in one session,createthencomplete. The log carriestool/calledandtool/completedfor both (seq277/278 and 346/347) and zero
plan/updated. No warning anywhere, becausenothing was dropped downstream: the event was never produced.
Why it matters
Every
todo_listcall is silent, on every session, for both consumers at once. Auser watching the panel sees an agent that never plans; a reader of the crew log
sees a session with no plan in it. The tool call itself renders normally, so
nothing looks broken.
What changed (motivation -> approach -> change)
todowas not in the copied field listkiro-cli splits one tool call over two frames. The
tool_callframe carries theidentity in
_meta.kiro.toolName; thetool_call_updateframe carries theresult in
rawOutputand no_metaat all. The captured corpus showsexactly that: in
test/fixtures/acp_frames/kiro/session.jsonlthe onetool_callframe has_meta.kiro.toolName, and bothtool_call_updateframeshave no
_metakey.parse_todo_snapshotinsrc/kiro_crew/acp/_dispatch.pyread_metafrom theresult frame, the only frame it sees, so it answered
""and dropped thesnapshot. It now falls back to the name the preceding
tool_callcached underthis call id, read through
scoped_tool_cache_keyso the entry stays bound tothe session that wrote it. A frame that does assert a name is still believed as
it stands.
Two more drops sat behind that one, so fixing the parse alone changed nothing a
user could see.
AcpProvider._to_llm_eventinsrc/kiro_crew/providers/acp.pyrebuilds each event from an explicit field list and
todowas not on it, so thesnapshot arrived at
chat_runnerasNoneand cleared the panel instead offilling it. A structural guard exists for exactly that class, and it was
disarmed by an allowlist entry whose stated reason (that
chat_runnerdoes notread the field) was false.
The third is the one this PR's own premise creates. A native subagent's
tool_callis flat-mirrored with_meta.kiro.agentSubtaskIdand parsed for itscaches under the PARENT scope, but its result frame carries no
_meta, so it hasno subtask tag either and falls through to the parent's own parse. The new
fallback would resolve it there and hand a child's task list to the parent as the
parent's plan. So the todo event now carries its call id, and
src/kiro_crew/acp/session_handle.pyrecords the call id of every tagged nativechild and drops a todo event belonging to one. Ownership is a standing fact, not
a token spent on first use: one
tool_callcan be followed by severaltool_call_updateframes, and the per-turn clear beside the sibling per-callcaches is what bounds the record.
.github/black-baseline.txtloses one line, because the reformatted test file isnow black-clean and the gate requires graduated entries pruned.
Backwards compatibility
Compatible: the two new
parse_todo_snapshotparameters are optional and defaultto no cache, the todo event gains a field rather than losing one, and the
provider copy forwards one more field. The parse only widens what is recognised.
The one event now dropped is a native child's todo result, which no build has
ever emitted as a parent event.
Tests
test/test_todo_list_surface.pyis rewritten onto the real two-frame shape; itshand-built frame put
_metaon the result, a shape no kiro-cli sends, which iswhy the file stayed green while the parse was broken for every real call.
TestTwoFrameDispatchfeeds the realtool_callthentool_call_updatethroughparse_session_updatewith one dispatcher's caches and asserts exactly oneEVENT_TODO_UPDATEcarrying the task text, under acache_scopeas well aswithout one; a result frame whose call frame the dispatcher never saw must stay
unidentified. The cache is read for this call id only and only under the scoped
key. A frame asserting
fs_readstays a non-match even withtodo_listcached.Every prior intent is kept: title prose alone never identifies the tool, an empty
list is a snapshot rather than a non-match, task text is capped and
credential-redacted.
test/test_acp_provider.pyaddstest_to_llm_event_preserves_todo_snapshotandempties the intentionally-dropped allowlist, so the existing parity guard now
covers every field.
test/test_kas_subagent_progress.pyaddstest_child_todo_result_cannot_replace_parent_todo: a tagged childtool_callthen its untagged result emits no
EVENT_TODO_UPDATE, a repeat of that resultframe emits none either, and the parent's own two frames still emit exactly one
with the parent's tasks. That last assertion is what stops the guard from
silently reverting the fix.
test/acp_frame_replay_harness.pypasses the name cache the way production does,so
test_acp_frame_replay.pycovers the change over the captured corpus.Mutation, on head
f823392eda, one fix at a time:TestTwoFrameDispatch::test_call_then_result_emits_todo_updatewithassert 0 == 1todo=e.todo:test_to_llm_event_preserves_todo_snapshotred withassert None == {'description': 'Repair provider boundary', ...}test_child_todo_result_cannot_replace_parent_todored withassert [AcpEvent(...)] == []All restored: 178 passed across the five files.
Manual verification
N/A -- the dispatch tests replay the wire order and frame shapes a live session
sends, and the frame shape is read off the captured corpus rather than asserted:
test/fixtures/acp_frames/kiro/session.jsonlhas_metaon itstool_callframe and none on either
tool_call_update.Related Issues
Fixes #11915
Pattern harvest
Rule candidate: review-prompt
Pattern: an identity is read from a terminal frame that only its opening frame
carries, and the miss reads as "not my tool" rather than as an error -- including
the second-order form where a field-parity allowlist keeps excusing the drop on a
justification that has since become false.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)