Commit Graph
2 Commits
Author SHA1 Message Date
NB 62d13d3067 Hold teammate answers until every teammate of the request is done (#961)
* Hold teammate answers until every teammate of the request is done

When an agent asked several teammates, it ran one turn for each answer. It answered the person
again after each teammate.

- An answer to a request that went to two or more teammates waits while another teammate of that
  request still has its copy queued, starting or running.
- When the last copy ends, all waiting answers start in one turn. The prompt says how many
  messages the turn has.
- If a copy ended with no answer (failed, interrupted or cancelled), the prompt names that teammate
  and tells the agent not to wait for it.
- A message from the person does not wait. It starts at once and takes the answers that are
  already in, so the agent does not answer twice.
- Each end of a copy, a failed start and a cancel from the queue schedules a drain for the agent
  that asked, so the held answers start.
- The waiting block shows "reads it next" only when the answers are no longer held.

* Release held answers after a process loss, and keep a batch start consistent

- When the own provider process of a teammate exits, its requesters get a drain, so the answers
  that they hold start.
- An answer whose attachment changed fails alone. The person's message and the other answers of
  the batch still start.
- A pending runtime refresh applies to a batch start. Before, the first held answer counted as a
  start that was not confirmed, and the refresh waited for the next drain.
- After a restart, each delivery of a batch that was not confirmed gets the state of the turn that
  its first message started. Before, the other answers showed as interrupted.
- interrupt_agent cancels the caller's requests only, not its answers, because the target can hold
  an answer until its other teammates answer.
- docs/ARCHITECTURE.md describes the hold rule.

* Return the answers of a batch to the queue when its start fails

Only the message that starts the turn fails. The provider did not read the other answers, so they wait for the next turn.

* Let interrupt_agent cancel a linked follow-up request

Only a linked answer that expects no reply stays in the queue. A linked message that asks for a reply is work that the caller gave.

* Hold and group only teammate answers, not linked requests

An answer is a linked agent message that expects no reply. A linked question asks for a reply, so it runs at once, and the queue shows it, not the waiting block.
2026-09-27 15:22:57 +02:00
NB af99355ec9 Show agent plans as task lists, and show teammate replies in a waiting block (#960)
* Show agent plans as task lists, and show teammate replies in a waiting block

An agent's plan was lost, and an agent that asked teammates showed nothing until the answers came.
The answers then showed in the queue like the person's own messages, with Steer and Edit.

- Each turn with a plan shows one task list in the chat. It updates in place and stays in history.
  Codex update_plan, Claude TodoWrite and TaskCreate/TaskUpdate, and ACP plans all feed it. The
  plan is saved in the message JSON, so there is no migration.
- Codex gets tools.update_plan. The Claude CLI gets CLAUDE_CODE_ENABLE_TODO_TOOLS, because without
  a terminal it gives the newer models no plan tool.
- A "Waiting for replies" block above the composer lists each teammate that the agent asked, and
  the child tasks of a waiting channel task. Each row shows asked, working, replied or failed. The
  answers leave the queue panel.
- A plan is never the preview, the unread count or the result that goes back to a teammate.
- Peers and mobile get the plan as checklist text. The Team API wire does not change.

* Leave plans out of the unread counts, and fix four review findings

- The agent and channel unread counts in the backend leave out plan rows, as the renderer does.
  The channel divider walk skips plans too.
- The activity line skips the plan row, which streams for the whole turn, so it still shows the
  latest commentary.
- A paused channel sub-task does not show as failed in the waiting block. It shows in the stopped
  tasks with Resume.
- A new Claude turn drops the finished tasks of earlier turns. A TaskUpdate with a subject for an
  unknown task, after a runtime release, adds it again.
- Remove two unused exports (knip) and the unused chat.taskList.state.failed key.

* Remove a turn's plan when the agent deletes its last task

An empty plan update was dropped, so the old list stayed in the transcript. Now it removes the plan message of the running turn.

* Accept a missing value in the optional task list and avatar props

The type ratchet found new exactOptionalPropertyTypes errors in the task list, the waiting block, and their callers.

* Lower the type baseline for the avatar callers that no longer fail
2026-09-27 15:02:58 +02:00