The ACP brief carries the description but never the work item's identity — sessions orient on whichever WI code is most salient in thread history #612
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
toasterson/Anima!612
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/wi-01a005fc-the-acp-brief-carries-the-description-bu"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Anima work item
01a005fc-8c42-78b3-82e5-e6a31d2faa6d.Moved here from akh-medu WI-256 (
019f9f56-52f3), which had the diagnosis right and the repo wrong. This is runner/server work, not engine work.Symptom
Agent sessions narrate and commit against a different work item than the one they were dispatched for. Both observed 2026-07-26:
019f9e7cdispatched on WI-252 closed with "I have successfully implemented WI-250".019f9eeadispatched on WI-254 committed "Add post-condition guard for idle agentic turn completion (WI-249)".Neither number is random: WI-249, WI-250 and WI-252 are real, adjacent akh-medu items whose threads and branches earlier sessions touched.
The immediate cost is traceability — a commit citing the wrong item breaks the audit trail the whole phase model depends on. The deeper cost is that a session which has mis-identified its task will satisfy the remembered brief rather than the given one.
It is not hypothetical or rare. The two akh-medu sessions that attempted to fix this reported implementing WI-254 and WI-253 while dispatched on WI-256. The bug reproduced itself inside its own fix, twice.
It is not KG leakage
The obvious hypothesis is knowledge-graph recall substituting prior work-item facts. The evidence rules that out for these cases: both sessions ran on the
claude-codeexecutor, which has no akh knowledge graph at all.The actual mechanism — verified in this repo on
dc3a5f9aThe dispatch path already does the right thing with the content.
assemble_brief(crates/anima-server/src/scheduler.rs:3078) is called with title and description:and builds:
which
anima_ai::prompt::assemble(crates/anima-ai/src/prompt.rs:52) renders as# Intent\n\n{title}\n\n{description}, plus File references / Review feedback / Prior lessons / Phase prompt. The runner then prepends the worktree preamble and sends the whole thing asfirst_promptover ACP (crates/anima-runner/src/slot.rs:794).So the full description is already delivered via the ACP prompt. That part works and needs no change.
What the assembled brief does not contain, anywhere, is the work item's identity: no
WI-nnncode, no UUID.intentis title + description, and a title is prose.item.codeexists on the model (crates/anima-db/src/repo/workitem.rs:97,pub code: Option<String>) and is simply never passed toassemble_brief.That is the whole bug. The session is handed a prose title, while the thread history and any inherited PR it can see are saturated with explicit
WI-nnncodes belonging to other items — because these work items routinely reuse pre-existing PRs from earlier attempts (#256 and #240 were reused rather than created). When the model needs to name its task, the most salient work-item identifier in its context belongs to someone else, and nothing in the brief contradicts it.The same omission is in the reviewer path:
assemble_reviewer_brief(scheduler.rs:2910) writes**Title:** {title}with no code and no id either.Required change
assemble_briefandassemble_reviewer_brieftake the code and the work item UUID alongside title and description. Both are already in scope at their call sites.# Intent\n\n**WI-256** (019f9f56-52f3-7872-8025-f785dd2ccf1e) — {title}— so it is the first work-item identifier the model reads, not the twentieth.Why not fix it on the akh-medu side
akh-medu WI-256 tried, and it was the wrong repo. Its round-2 attempt wired
akhomedto detect an Anima session viaANIMA_RUNNER_TOKENand then call themcp__anima__get_work_itemMCP tool at init to fetch its own identity. The reviewer rejected it — correctly on the mechanics (it calledagent.call_tool(), which does not exist onAgent, so it did not compile) and correctly in principle:What that reviewer could not know, reviewing inside akh-medu, is that the runner already does exactly that for title and description — the transport is the ACP prompt itself, and it has been all along. The missing piece was never a delivery mechanism. It was two fields.
An MCP round-trip at akhomed init would also be strictly worse: it needs auth before the session is usable, and it introduces a failure mode where the lookup fails and the akh boots with no identity at all.
Acceptance
assemble_briefandassemble_reviewer_briefassert the identity is present (the existingassemble_reviewer_brief_*tests inscheduler.rs:3626+are the pattern to follow).Related
019f9f56-52f3) — origin; cancelled in favour of this itemSessionContext; unrelated but frequently confused with this in the threads.2fe74b2ae9to22f674af3b22f674af3bto12452888e1WIP: The ACP brief carries the description but never the work item's identity — sessions orient on whichever WI code is most salient in thread historyto The ACP brief carries the description but never the work item's identity — sessions orient on whichever WI code is most salient in thread history