Skip to content

fix: run a task tool once when its activeForm write is refused - #469

Merged
github-actions[bot] merged 1 commit into
developfrom
bugfix/plugin-authoring-review
Oct 24, 2026
Merged

github-actions[bot] merged 1 commit into
developfrom
bugfix/plugin-authoring-review

Conversation

@a1exk-dev

Copy link
Copy Markdown
Owner

What changed

Docked with the todo section on, a refused activeForm write no longer makes core run TaskCreate or TaskUpdate a second time.

Refs: #449, #452

Summary

 on(tool.call TaskCreate | TaskUpdate)
   done = docked && todo on ? ctui's own $.tool.call(e) : next(e)
   if todo on and done succeeded
+    // once ctui's own call has replaced next, nothing later may throw
-    await keepActiveForm(...)
+    await keepActiveForm(...).catch(() => undefined)
     void loadTodo($).catch(() => undefined)
   return done

This is rule 3 of the refused-call policy (#460, docs/adr/0004-guard-every-engine-call.md). If the write is refused, the row shows the task's subject until the next TaskUpdate.

Evidence

Two new tests in the docked task scenario (tests/todo-sidebar.test.tsx). The test's own state.set hook answers { deny } for the activeForms key and passes every other key on.

  • Before: both failed. The engine reported ctui's tool.call hook was skipped: ctui: $.state.set: refused by acme. One TaskCreate answered Task #2 created successfully: alpha, so core had run it again. The TaskUpdate answer carried core's text too.
    After: both pass. Each answers { result } alone, callers lists only ctui (core did not run the tool again), and the list still reloads (󰄰 alpha, alpha). node scripts/check.ts exits 0.

Merge Danger

Door: two-way

Blast Radius: none

It only changes the path where the write is refused. Every other path, including the inline Sidebar, a subagent's call, Todo off and a deny from ctui's own call, is unchanged and held by the existing tests.

Reports

Live checks

N/A

Evals

N/A

Docked with Todo on, ctui runs TaskCreate and TaskUpdate itself, then keeps the task's activeForm in $.state. A refused write failed the hook with no next result to stand on, so core ran the tool again and one TaskCreate made two tasks. Both hooks now discard that failure; the row shows the subject until the next TaskUpdate.

Refs: #449, #452
@github-actions
github-actions Bot enabled auto-merge October 24, 2026 12:16
@github-actions
github-actions Bot merged commit a0ea6aa into develop Oct 24, 2026
3 checks passed
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.

1 participant