Repository navigation
fix(coderd/x/chatd): keep wait_agent waiting on a paused child - #29292
Merged
Merged
Conversation
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
2 times, most recently
from
September 15, 2026 10:39
f383243 to
390e952
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
September 17, 2026 15:19
28604ca to
c188dec
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
3 times, most recently
from
September 18, 2026 15:48
49b952e to
7eaa8eb
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
September 22, 2026 13:45
738bfa2 to
b1c103e
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
from
September 22, 2026 13:49
7eaa8eb to
b9d6842
Compare
mafredri
marked this pull request as ready for review
September 23, 2026 11:28
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
September 28, 2026 19:36
b1c103e to
e39136c
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
from
September 28, 2026 19:36
b9d6842 to
5534e79
Compare
Contributor
Documentation CheckUpdates Needed
Automated review via Coder Agents |
jakehwll
approved these changes
Sep 29, 2026
jakehwll
left a comment
Collaborator
There was a problem hiding this comment.
This looks fine... not sure why it landed on agents-frontend team 😅
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
October 2, 2026 13:43
e39136c to
1ba2bd6
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
from
October 2, 2026 13:43
5534e79 to
1e231c0
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
October 2, 2026 14:44
1ba2bd6 to
cfdf0a0
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
from
October 2, 2026 14:46
1e231c0 to
c0fa601
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
October 2, 2026 17:35
cfdf0a0 to
23b1d9c
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
2 times, most recently
from
October 5, 2026 08:21
a892700 to
88fd17e
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
October 5, 2026 08:21
23b1d9c to
4804321
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
from
October 5, 2026 09:13
88fd17e to
323b32c
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
October 5, 2026 11:51
1e63c30 to
ab006da
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
2 times, most recently
from
October 12, 2026 09:05
9e90e08 to
85d02b6
Compare
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
October 12, 2026 09:05
ab006da to
4cbb257
Compare
Move the editing migration to 000634 after main's 000633, and keep the paused archive refusal message in main's shared chat update path.
The paused resume delete guard and the paused auto-archive candidate test repeat checks that TestQueuedMessagePromotionRequiresSingleDelete and TestAutoArchiveCandidateQueriesAgree already make through the same code. TestQueueAdvanceKeepsLastError and the last_error column of TestEditing_LeavingPaused seed last_error by a direct row write onto R, I, and P chats. No transition stores last_error outside error: every exit from E0, E1, and E1P clears it, so those inputs never occur. The matrix already covers their state outcomes and queue links.
Main added migration 000634_aibridge_interception_organization, so the queued-message editing_since migration and its test move to 000635. Regenerate the chat API docs for main's project_id parameter change.
A queued content edit links its files, but dropping that LinkFiles call failed no test.
Only FinishError and ReconcileInvalidState store a last_error, both in error, and every transition out of E0, E1, and E1P clears it. The chats that advanceQueue sees (R, I, P) therefore never carry one, so promoteQueuedRow can clear it for all callers and the last_error parameters on promoteQueuedRow and advanceQueue go away.
Editing a row that was already sent or removed returned 404 while other rows were queued, but 409 with the internal transition error in Detail once the queue was empty, because the state check runs before the row lookup. Every unarchived, valid state that refuses the edit has an empty queue, so the row is gone in that case too.
queue_wait runs from the queued row's created_at to its promotion, and editing a queued row does not change created_at, so a row's time under edit counts toward queue_wait.
Renumber the editing_since migration to 000638 after main's 000637 and regenerate the database wrappers.
A paused child finished a turn with a queued message under edit and continues when the edit ends. checkSubagentCompletion treated any status other than running or interrupting as done, so wait_agent returned the child's partial report as its result. paused is now not-done: the parent waits, and on timeout receives status "paused" with timed_out. The list_agents status legend gains the value. Closes CODAGT-1026. Co-authored-by: Coder Agents <noreply@coder.com>
The list_agents legend and the wait_agent description name the chat statuses; paused goes last like every other status list, and the wait_agent sentence states what a paused timeout means.
An interrupted child whose next queued message is under edit finishes the interruption in paused, not waiting or running, so the interrupt_agent description lists that outcome.
This branch only adds the paused sentence to the wait_agent description. The other two sentences TestWaitAgentToolSchema checked were already there and untested on main.
mafredri
force-pushed
the
mathias/codagt-971-queue-hold-backend
branch
from
October 30, 2026 13:10
7954fdb to
5eb7389
Compare
mafredri
force-pushed
the
mathias/codagt-1026-wait-agent-paused
branch
from
October 30, 2026 13:10
62ba452 to
7023358
Compare
Base automatically changed from
mathias/codagt-971-queue-hold-backend
to
main
October 30, 2026 13:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #29215, which adds the
pausedchat status.checkSubagentCompletiontreated every status exceptrunningandinterruptingas done, sowait_agenton a paused child returned the child's last assistant message as its final report while a queued message was still under edit. A paused child is not done:wait_agentkeeps waiting, and on timeout returnsstatus: "paused"withtimed_out: true. Thewait_agentandlist_agentsdescriptions say that a paused timeout is expected.Closes https://linear.app/codercom/issue/CODAGT-1026