Repository navigation
feat(conductor): drop the chat context at a round close - #18113
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsInventory (9 items) — 8 justifiedIntent: let a long-running goal conductor drop its own chat at each round close, so quiet patrol wakes stop paying for an ever-growing context. ADDITION, covered by
[FIRST-PRINCIPLES-REVIEWED] fe92431 Description read[DESCRIPTION-READ] 25e9b7a4ea0a85c9ec2df91a2e9f9032d864ff83c305ca00a088db8da49a792c That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS A wake's queued reset can land several turns after the round close that justified it, so it may wipe context the ledger never captured. Watch
[DESIGN-REVIEWED] fe92431 Description read[DESCRIPTION-READ] 26e710dc6f28b7219230a53ce995e287d8741bdd1210b29d5432b3b497ef093d 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 |
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: |
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: |
|
|
|
8199d48 to
9c95512
Compare
|
|
|
|
|
9c95512 to
ac5b50b
Compare
ac5b50b to
4ed12b0
Compare
4ed12b0 to
d9c6047
Compare
d9c6047 to
fe92431
Compare
|
|
|
Problem / Motivation
Goal: A goal conductor drops its own chat at each round close, so a patrol that runs for days stops paying for an ever-growing context on every quiet wake.
Every patrol wake re-sends the conductor's whole conversation. The state it needs already lives in the work ledger and its session ledger, and each wake already carries their snapshot. But the conductor could not reset: the tool was not in its grants, and the directive consumer refused
reset_conversationfrom any turn a person did not start, so a patrol wake was always refused.Why it matters
A conductor that runs for days pays the cost of its whole chat on every wake, even when nothing changed. That cost grows each round and buys nothing the ledgers do not already hold.
Not a goal
kirocrew-conductorgainingreset_conversation.set_projectorchat_tag. They stay human-only.What changed (motivation → approach → change)
Decision recorded in rfc-conductor-round-reset.md (#18097).
src/kiro_crew/agent.py,src/kiro_crew/agent_materialization/conductor_agents.py)reset_conversationadded forkirocrew-conductoronly, and to its shipped-grant history so a regenerated spec keeps it as Crew'ssrc/kiro_crew/dashboard/session_directive_apply.py)kirocrew-conductor(or its deprecated alias), its loop is the slot's current, active loop, the self-arm trust record says the slot armed it itself, and no question card or tool approval is pending; otherwise refused and audited. The loop is re-read after the off-loop trust read. Each admitted wake reset logs a WARNING with the loop idsrc/kiro_crew/dashboard/chat_runner.py,src/kiro_crew/dashboard/state.py)src/kiro_crew/autonudge_authz.py,src/kiro_crew/autonudge_selfarm.py)src/kiro_crew/builtin_skills/goal-conductor/SKILL.md,src/kiro_crew/agent.py)goal,next(open item ids, worker keys, PRs) andpatrol_base, then reset as the last call. Never mid-round or with a question openThe tool description in
src/kiro_crew/mcp_tools/control.pyand the specs indocs/system-specs/modules/session.mdanddocs/system-specs/modules/learn-cron-dashboard.mdname the wake case. Two pinned tests change on purpose, each with a comment saying why.Why the ledger write before a reset is prompt-enforced
The gateway checks who may reset and that nobody is waiting on an answer. That the ledger was written first is left to the skill and prompt: the work ledger already holds every item, worker binding and PR, so a reset after a failed
session_ledger_recordcosts one wake that rebuildsnextfrom it. A gateway check would need turn-scoped ledger provenance, a new mechanism for a cost that small.Backwards compatibility
Compatible: a person's turn resets exactly as before; cron, sub-agent and unvouched wake turns are refused as before; crew/member self-arm rules are unchanged.
Removes nothing: the change only admits one new caller and writes one more trust entry.
Tests
test/test_conductor_wake_reset.py(new): a vouched wake queues the reset and logs the loop id; refused for no loop id, no loop, a different current loop, a stopped loop, an unrecorded loop, a down store, a pending question card, a pending slot approval, a pending coordinator approval; a settled approval does not refuse; a turn with neither mark is still refused; a wake still cannotset_project; a person's turn keeps its old path; a Pause landing inside the trust read refuses; only a wake reset is marked to wait at the boundary; a non-conductor agent's wake is refused and the deprecated conductor alias is admitted. Authorizer: a conductor's self-arm is recorded, an outside arm and other agents' self-arms are not, a down record still arms, and a record for an arm that failed is forgotten.test/test_chat_runner_coverage.py: a wake's queued discard waits while a question is pending and lands once it clears; a person's discard does not wait.test/test_conductor_agent.py,test/test_autonudge_member_self_arm.py,test/test_agent_refactor_contracts.py,test/test_agent_refactor_spec_bytes.py: updated on purpose for the new grant and prompt (the conductor and alias spec golden digests change because theirallowedToolsgain one entry).Manual verification
N/A — the effect is a gateway decision on a directive; the tests drive
apply_session_directiveandauthorize_and_add_nudgedirectly.Related Issues
Closes #18093
Checklist