Repository navigation
fix(chat): resync the task checklist after a native restart, let a person tick rows - #14912
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS A person's tick is told to a live agent only once, even though tick confirmation is observable — an ignored sync block diverges silently. Watch
[DESIGN-REVIEWED] da0a494 Description read[DESCRIPTION-READ] beee4610eab6607910e7ef094a933361eb54b5e35059772bbd447687462c81d6 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 (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The untick-held-forever machinery rests on an unverified provider claim — "kiro-cli's todo_list has no un-complete command" — that nothing checkable pins. Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: FIX — the checklist pill stays live and hand-editable after the agent's native conversation restarts (reproduced defect, error text quoted, kiro-cli 2.25.0).
More than 10 differences ship; the remainder are mandated companions (i18n catalogs, feature-map and security.md rows updated same-commit) and a screenshot harness matching the 658 existing [FIRST-PRINCIPLES-REVIEWED] da0a494 Description read[DESCRIPTION-READ] 7f7ce20591c8afe52324069b857ea190ff1ba80fd2e116d5c1a8b2ef961804fd That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The two person-mark glyphs read as one icon at 13px — the blind reader told done from not-done only by the text strikethrough. Watch
Suggestions
[UX-REVIEWED] da0a494 Description read[DESCRIPTION-READ] 400be0751b12ec834cbbbd58297995cb11431181881e6a36726c285735e1fde5 That sha256 names everything this verdict read: the PR description, plus the 10 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 |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. — one advisory item below. FINDING — src/kiro_crew/dashboard/state.py:4181 — [OPUS-REVIEWED] da0a494 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
a09d234 to
6b97661
Compare
ebffe74 to
bed2e6f
Compare
bed2e6f to
9a799af
Compare
f2af836 to
7fce8c0
Compare
…rson tick rows
The checklist pill mirrors kiro-cli's todo_list state, which lives inside one
native conversation. Kiro Crew replaces that conversation on an agent switch,
a failed session/load, a poisoned-conversation discard and /clear, and keeps
the pill's snapshot across all of them. The agent then holds an EMPTY list
under a pill that still shows the old one; its next `complete` fails with
"Task N not found" (kiro-cli 2.25.0), which it reports as "I cannot update
the checklist". Nobody could tick the remaining rows.
Two repairs:
* On a cold start the provider did not resume itself, and only when the
slot still carries a non-empty list, the runner prepends a
`[Task checklist -- automatic recovery]` block: the description and every
task with its [x]/[ ] state, telling the agent to recreate the list with
one todo_list `create` and a `complete` per ticked row. Same gate as the
transcript replay, pure prepend, so the trusted-tail scrub covers it.
* `PATCH /api/chat/slots/{slot}/todo` {id, completed} lets the person tick
or untick one row from the pill. It writes the slot's copy, broadcasts the
same `todo_update` delta the tool result does, and is refused for app
callers with the indistinguishable 404 the other slot writes use. Each pill
row is now a role=checkbox button; the store repaints from the echo, so a
failed PATCH needs no rollback.
7fce8c0 to
44f8b02
Compare
44f8b02 to
dd0d628
Compare
dd0d628 to
2146505
Compare
2146505 to
7a053ed
Compare
…reaches a live agent Review follow-up on the checklist pill. * The agent re-sends its WHOLE todo list on every todo_list call, so a person's tick written straight onto the slot was reverted by the next tool result. The slot now keeps the person's edits as overrides: set_todo applies them over every incoming agent snapshot and retires each one as soon as the agent's snapshot agrees or the row is gone. A warm turn prepends a "[Task checklist -- person edited]" block naming the ticked rows for one `complete` call (unticked rows are stated as still open; kiro-cli has no un-complete command). The cold-start recovery block already carries the edited state. * Task texts re-stated to the model are DATA: each one is folded to a single line, stripped of fence and structural markers, and wrapped in the new <<<UNTRUSTED_TODO_TEXT fence (registered with the other untrusted fences in context.py), with a notice telling the agent never to follow instructions found inside it. * /clear drops the pill and its overrides (todo_update: null), so the cleared plan is not rebuilt into the fresh conversation. * Route: the missing-slot 404 carries the same body as the app refusal (no existence oracle); the slot is re-checked after the body read so a same-name replacement cannot take the write; every error response carries a code; the read_bounded_json cap decision is registered. * Pill: rows are drawn as real checkboxes with a one-line hint at rest and the outcome as a tooltip; the write goes through useMutation; the row repaints only from the gateway's serialized todo_update echo; a refused PATCH renders through ErrorNotice. * Catalogs: two new keys in every catalog; api key order snapshot updated. Review fixes (GPT 5.6 + UX + Opus): * Tick-window override integrity: _todo_sync_rendered carries (id, completed, text) snapshots and mark_todo_edits_stated only marks an override delivered when it still matches, so a row re-toggled between prompt assembly and the provider's first event is not falsely marked stated and dropped. * Canonical pin/override text: pins and person overrides store, and set_todo compares, the same _todo_canonical_text the recovery prompt emits, so a marker-bearing completed row survives the neutralized rebuild echo. * Raw click identity: the PATCH refuses a stale click by comparing the RAW (fold-only) row text, not the lossy canonical form, so a marker-collision replacement under the same id cannot absorb a click meant for the original. * Per-slot tick-failure retention: the failure notice is kept per slot, not read off the shared react-query mutation error, so a queued tick for another slot cannot erase this slot's refusal notice. * Cold-start untick: a person's untick is never retired by the rebuild's all-open `create` echo agreeing it is open (kiro-cli has no un-complete command, so that agreement is the rebuild default, not confirmation); the untick holds until the row is gone or its text is replaced. * Recovery emits an empty description unchanged, not the literal "(none)" placeholder that the agent would echo back and set_todo would store. * UX: the tick refusal codes caller_unattributable / todo_task_stale are mapped to plain-language detail in the notice (raw server wording read as gibberish to a first-time reader), a spinner shows while a row's PATCH is in flight, and read_only_hint is reworded. New i18n keys across every catalog; en-XA regenerated. Regression tests added and mutation-verified for each fix.
7a053ed to
da0a494
Compare
buluoray
left a comment
There was a problem hiding this comment.
LGTM. I checked this at head da0a494.
The new PATCH /api/chat/slots/{slot}/todo route is registered beside /pin and /folder (routes/sessions.py:96). It therefore gets the same dashboard token auth, and has no exemption.
The handler in dashboard/chat_todo.py checks, in order:
refuse_unattributable_callermember_slot_write_refused- an app fence that refuses every app caller with an indistinguishable 404 and logs it to SEL
remote_bound_refusal- body type validation
state._slots.get(name) is not slot, re-checked after the body await, so a slot recreated in that window is refused instead of taking the write
Disabling the app fence fails test_app_caller_is_refused_with_the_indistinguishable_404, test_an_app_caller_cannot_tell_a_remote_bound_slot_from_a_missing_one and test_missing_slot_and_app_refusal_are_byte_identical.
Task text and ids sent to the model are fenced and canonicalized, and the new fence and TASK CHECKLIST markers are added to _UNTRUSTED_FENCE_RES / _STRUCTURAL_MARKER_RES. The sync and recovery blocks are marked delivered only when a read-proving event arrives.
Tests: 152 pass across test_todo_pill_resync.py, test_todo_list_surface.py and test_json_object_body_guard.py.
On the lane CONCERNS: the design point that a tick is stated to the agent only once is accurate. It trades that against prompt noise, and a cold start re-syncs the list. The first-principles and UX points are about sizing and cosmetics. None of the three blocks.
Non-blocking follow-up, reproduced with a probe on _ChatSlot:
- What happens: a person ticks and then unticks a row the agent still holds open, which leaves
{completed: False, person: True}.untick_survives_rebuild(state.py:4181) then stops the "snapshot agrees" retirement. - Effect: when the agent really completes the row, the pill still shows it open with a person mark. A re-tick recovers it.
- Suggested fix: record the agent's own flag when the override is created, and let an untick outrank an agreeing snapshot only while that flag is unchanged.
Problem / Motivation
Goal: The task checklist above the composer stays editable after the agent's native conversation restarts, and a person can tick a row directly.
Bug report: a session's checklist pill sat at "3 of 7" while the agent said "I can't tick those four items off in the dashboard checklist from this session, but the work behind all four is done." Asking it again did not help, and there was no control in the dashboard to tick the rows by hand.
Root cause, reproduced against kiro-cli 2.25.0: the pill mirrors the
todo_listtool's state, and that state lives inside ONE native conversation. Kiro Crew replaces the native conversation on an agent switch, a failedsession/load(four retries then a fresh session), a poisoned-conversation discard and/clear-- and keeps the slot's pill snapshot across all of them. The agent then holds an empty list under a pill that still shows the old one; its nextcompletefails withTask 1 not found: No such file or directory (os error 2), which the model reports as "I cannot update the checklist". Same-directory--resumekeeps the list; a new conversation loses it.Why it matters
Anyone whose long session was cold-started once (a model or agent switch is enough) loses the ability to track progress on the plan the agent made, and gets a confusing "I can't" from an agent that did the work. Neither the agent nor the person had any way back.
Not a goal
todo_listtool has no such command, so an untick is held on the dashboard side and stated to the agent as an open row.What changed (motivation -> approach -> change)
Symptom: pill frozen, agent says it cannot tick. Cause: pill snapshot outlives the native conversation that owns the list. Change, two parts:
Resync on cold start.
chat_runner._run_chatprepends a[Task checklist -- automatic recovery]block to the first prompt of a fresh native session -- same gate as the transcript replay (_context_is_new and not _provider_has_history), only when the slot still carries a non-empty list, never on a slash command. The block carries the description and every task with its[x]/[ ]state and tells the agent to recreate the list with onetodo_list createand acompleteper ticked row (_ChatSlot.todo_recovery_prompt). It is prepended after the egress scrub (see 3), and the tool result that follows repaints the pill through the normaltodo_updatepath.A person can tick a row.
PATCH /api/chat/slots/{slot}/todowith{id, text, completed}(dashboard/chat_todo.py) flips one task on the slot (_ChatSlot.set_todo_task_completed), broadcasts the sametodo_updatedelta the tool result does, and answers the refreshed payload. It applies the unattributable-caller and member fences the other slot writes use, refuses app callers with a 404 byte-identical to the missing-slot 404, re-checksstate._slots.get(name) is slotafter the body read so a same-name replacement cannot take the write, and refuses with 409todo_task_stalewhen the id's stored text no longer matches the text the click carried (ids are positional; the agent can replace the list under a click). The click's text is compared to the stored text RAW (line-folded only): the person clicked the text they saw, and the marker neutralizers are lossy, so a canonical comparison could let a replacement task that differs only inside a marker span take the click. The remote-bound refusal is checked AFTER the app fence, so an app caller sees the same 404 on a remote-bound slot as on any other. InTaskProgressBar.tsxeach row of a LOCAL session is arole="checkbox"button drawn as a real checkbox (a remote-bound session only relays the peer's list, so its rows are read-only and the route answersremote_bound_refusal), with a one-line hint at rest that states the consequence and its reversibility ("Click a row to mark it done or not done. Nothing changes for the agent until its next turn, and you can click again to undo until then. Done rows the agent will not redo; not-done rows it treats as still open. Rows you set show a person mark until the agent confirms them.") and the same consequence in each row's tooltip and aria label; the write goes throughuseMutation; the row repaints only from the gateway's serializedtodo_updateecho (the PATCH response is deliberately not applied, so two quick clicks cannot land out of order and an older response cannot restore an obsolete list); clicks are queued and sent one at a time (a clicked row is held until its PATCH settles, other rows stay clickable, a failure clears the queue and the next click is sent, not greyed out under the old notice); a refused PATCH renders through a blockErrorNoticeunder the list (outside its scroll box, so it is readable at any scroll position) with a human lead that names the row and says why a retry is safe (""" did not update; the row keeps its old state. Clicking again is safe: a row only changes when the list shows it."), so a refusal after a landed tick cannot be read as the tick being lost and, below it, the refusal in plain words keyed on the gateway'scode(caller_unattributable-> "The dashboard lost track of who is clicking. Reload the page and click again.",todo_task_stale-> "The list changed while you were clicking, so this row is a different task now...",todo_task_not_found/todo_absent,remote_action_unsupported); the server's own text stays on the tooltip, and an unmapped failure shows it directly. A held row keeps its glyph, dims in place and shows a small "Sending" at its right edge while its PATCH is queued or in flight (a spinner read as the agent working on the row). A row the person set carries a person glyph (UserCheck/UserX) and a tooltip lead ("You marked this done; the agent has not confirmed it yet.") until the agent's own list agrees, so a person's override cannot be mistaken for the agent's completion; the payload carriesperson: trueon such rows and never on a cold-start pin; plus the ask-agent hand-off and a dismiss. The notice and the queue are per slot: a failure in one session neither shows in nor drains another session's clicks. Read-only rows (remote-bound session) use circle glyphs, not checkboxes, and the hint says whose checklist it is. Task ids in the warm-turn sync block ride inside the same fence as their text.The tick outranks the agent's stale copy and reaches a live agent. The agent re-sends its whole list on every
todo_listcall, so a plain write would be reverted by the next tool result. The slot keeps the person's edits as overrides (_todo_overrides):set_todoapplies them over every incoming agent snapshot and retires each one the moment the agent's snapshot agrees (or the row is gone). An override is bound to its row's raw line-folded text. A cold-start recovery block hands the agent the CANONICAL text (markers neutralized), so the rebuilt row comes back in that form: from the block's delivery (provider's first event) until the agent's next snapshot the canonical forms are compared too, and that snapshot rebinds the override to the rebuilt text; outside that window a canonical match is refused, so two different marker-bearing texts cannot pass one override between them. The recovery block itself is a DEBT (todo_recovery_pending): armed when built, settled on the first model-output event of the turn that carried it (never by a terminal-only stream) (a slash command or warm turn that ran while it was owed does not settle it), dropped by/clear; so a turn that dies before delivery re-sends the block. A person's untick is never retired by an agreeing snapshot (kiro-cli cannot un-complete, so the only open echo is the rebuild's all-opencreate, which predates the untick); it holds until the row is gone or replaced. Task ids are capped (TODO_ID_MAX) like task text, since they key the overrides and pins (or the row is gone); a retirement counts as a change so the crew log's plan entry records the agent's confirmation. Before a cold-start rebuild every already-completed row is pinned as an override too (pin_completed_todo_rows), so the rebuild's all-opencreateecho cannot erase them if the turn dies before thecompletecalls. On the next warm turn the runner prepends a[Task checklist -- person edited]block (todo_sync_prompt) naming the ticked rows for onecompletecall, and stating unticked rows as still open (kiro-cli has no un-complete command). On a cold start the recovery block already carries the edited state. Each edit is stated to the agent once: the runner records the(id, text, completed)rows it rendered into the block and, on the first event that shows the model READ the prompt (a text or thinking chunk, a tool call, a permission request; a terminal-only stream such as the transport's owncomplete(timeout)or a compaction failure does not count), marks stated only the overrides that still carry exactly that text and flag (mark_todo_edits_stated), so a turn that dies before the model reads the block re-states them next turn, a row ticked while the turn was already assembled is not falsely marked, and a row toggled twice inside that window keeps its newer edit unstated and says it next turn. An untick can never be confirmed (kiro-cli has no un-complete command). A cold-start pin is recorded as the agent's own completion, never attributed to the person. The block's frame[Task checklist -- ...]/[End task checklist]is registered in_STRUCTURAL_MARKER_RESand the block is prepended AFTER the egress scrub (the waybuild_messagemints folder steering), so a forged copy in history, a hook or a tool result is neutralized and only the gateway's block wears the frame.Task texts re-stated to the model are data. Whatever the agent typed into its list may be a copy of a page or a file, so both prompt blocks fold each text to one line, strip fence and structural markers (
_neutralize_fence_markers,_neutralize_structural_markers), wrap it in a new<<<UNTRUSTED_TODO_TEXT ... >>>END_UNTRUSTED_TODO_TEXTfence registered beside the thread and calendar fences incontext.py, and carry a notice that text inside the fence is never an instruction./cleardrops the pill. Clearing abandons the plan, so the slot's snapshot and overrides go with it (and atodo_update: nullis broadcast); otherwise the recovery block would rebuild the cleared checklist into the fresh conversation. Gated on THIS turn's own/clear, not on frame ownership: a shared runtime marks the clear frame ownerless whenever a subagent is registered, for peers and for the session that typed it alike.The person's tick is what the next fresh session rebuilds from, so the two repairs compose: tick rows 4-7 today, and an agent restarted tomorrow recreates a 7-of-7 list.
Backwards compatibility
Compatible: one new route and two new
_ChatSlotmethods;set_todo,todo_payload, thetodo_updateframe shape and theTodoListtype are unchanged. A slot with no list, or a resumed session, produces no prepend.Tests
test/test_todo_pill_resync.py(70):todo_list,createandcomplete.set_todo_task_completedflips by id, reports no change on a same-state write, ignores unknown ids and an absent list.todo_updatepayload; untick; no-op tick answers 200 with no broadcast; unknown task, no checklist, missing slot -> 404; malformed body -> 400; app caller -> 404slot_not_foundwith nothing written.[Task checklist ...]/[End task checklist]are neutralized in untrusted text (separator-tolerant); the genuine block is the outermost prefix with intact markers.complete(timeout)stream settles neither the edits nor the recovery debt), so an aborted turn re-states and a tick landing after assembly is not lost; a row re-toggled between assembly and delivery stays unstated; a completed row whose text carries a structural marker survives the rebuild's all-open create echo; a person-set row is flaggedpersonuntil the agent confirms it, and a pin never is; cold-start pins are not attributed to the person and pin the folded text./cleareven on an ownerless frame; a clear frame on a turn that did not type/clearleaves a peer's pill (and its ticks) alone; a remote-bound slot refuses the tick.createecho, retire as the agent completes each one, and never override a person's untick; an override confirmation reports a change (crew log) while a plain re-echo does not; a click whose id now names a different task is refused 409 with nothing written.todo_sync_promptnames ticked rows forcompleteand unticked rows as open; empty without pending edits.changed=False; a multi-line task text is compared line-folded (no false 409); the remote-bound refusal is answered after the app fence; a slot replaced during the body read is refused 404 with nothing written; the missing-slot and app-refusal 404 bodies are byte-identical._run_chat, mocked provider): cold start with a pill prepends the recovery block (with the person's ticks folded in) and keeps the builder prompt as the tail; a warm turn with a pending tick prepends the sync block; resumed session, warm turn without edits and cold start without a pill get no block;/cleardrops the pill and broadcaststodo_update: null.website/src/test/TaskProgressBar.test.tsx(+15, 32 total): clicking a row PATCHes(slot, id, !completed); the hint and per-row tooltip name the consequence at rest; three quick clicks are sent one at a time in order with every clicked row held; the row does not repaint from the PATCH response, only from thetodo_updatedelta; a rejected PATCH renders anErrorNoticewith the human lead and the server text and leaves the row unchanged; a click after a refusal is sent; a refusal in another slot neither shows nor drains this slot's queue; each mapped refusal code renders in plain words with the server text on the tooltip (4 cases); held rows show a visible Sending; a person-set row wears the person glyph and tooltip; a queued tick PATCHes the slot it was clicked in after a session switch; a remote-bound session renders rows read-only with no hint.Existing
test_todo_list_surface.py,test_context_marker_neutralization.py,test_error_code_contract.py,test_json_object_body_guard.py,test_chat_slot_pin_ownership.py,test_s32_dashboard_mutating_routes_owner_gate.py,test_check_feature_map.pypass (226 in the touched suites).node scripts/i18n-check.mjsandtsc --noEmitclean.Manual verification
--resumekeeps it, a new conversation in the same directory answersTask 1 not foundoncompleteand an empty list onlist.node scripts/capture-todo-pill-tick.mjs(added) drives the built SPA: 3 of 7 -> click row 4 -> the stubbed PATCH echoestodo_update-> 4 of 7, row 4aria-checked=true, header advances to the next task; then the stub refuses the next PATCH and the failure notice renders with row 5 kept open; then the stub holds a PATCH open and the clicked row shows its pending state; then the session is remote-bound and the rows render read-only. Both themes.Screenshots / video
Dark, expanded, before the click (the reported state):
After clicking row 4 (the person glyph says this mark is the person's until the agent confirms it):
A refused tick (the gateway answered 403
caller_unattributable; the row keeps its state; the notice says a retry is safe and the reason in plain words, server text on hover):A tick in flight (the clicked row is dimmed and says Sending until its PATCH settles; other rows stay clickable):
A remote-bound session (the peer owns the checklist: circle glyphs, no checkboxes, read-only hint):
A row the person UNTICKED (the undo half: the agent had it done, the person marked it not done; the person glyph and tooltip say so until the agent's list agrees):
Light theme
Related Issues
Reported in Slack by a user whose session returned "I can't tick those four items off in the dashboard checklist from this session". No issue filed.
Pattern harvest
Rule candidate: review-prompt
Pattern: a dashboard-side copy of provider-owned state has two writers (the person, the provider's full snapshot) and no reconciliation rule, so one writer silently reverts the other; the pill here, the same shape as the MCP report the runner already nulls on reset.
Checklist