Repository navigation
Open
Labels
followupDefect or gap found after merge or on the daily serverpstack-paritypstack parity plan workstreams
Description
Xum created this issue on behalf of @ibetitsmike.
Part of moving the pstack lead ("Pstack General", Xum workspace 8ac7791132) to a Coder Agents chat on this fork.
Risk
Today the lead runs in Xum, outside the server it deploys. As a Coder Agents chat it runs inside that server: each merge to main makes autodeploy restart coderd under the lead and every workstream chat. The lead wrote 168 merge records in five days, so this happens many times a day.
What is known:
- Autodeploy waits up to 30 minutes for chats in
running,interruptingorrequires_action, then restarts anyway. A lead family is always busy, so every deploy would wait the full 30 minutes and then cut turns off. - After a restart, a chat is picked up again once its heartbeat is older than 30 seconds (
coderd/x/chatd/ARCHITECTURE.md, Acquisition loop). - Missed interval and cron wake-up slots are never replayed (
coderd/x/chatd/fork_wakeups.go:335). - A workflow run lives in a chatd goroutine until the durable run journal lands (W12 PR2a, pstack W12: Starlark workflows and saved workflows #226).
What nobody has checked is a whole family across a restart: in-flight tool calls, wait_agent in a parent, wait_for_events watches, queued child messages, subagents that wait for capacity, and background processes in the workspace.
Wanted
- A test that restarts coderd under a root with a running coordinator and two running workers, and checks that every chat finishes its work with no lost child result and no duplicate spawn.
- The same check on the daily server through one real autodeploy.
- A decision on the drain: skip the 30-minute wait for chats that resume safely, or have the lead pause its family before a merge.
- A fix for each case that loses work.
Acceptance
- The test passes in fork-ci.
- One autodeploy runs under a live family of at least four chats, and each chat's transcript shows the turn continued or restarted without a repeated side effect.
Metadata
Metadata
Assignees
Labels
followupDefect or gap found after merge or on the daily serverpstack-paritypstack parity plan workstreams
Activity
ibetitsmike commentedon Nov 12, 2026
Tracked in #255.
ibetitsmike commentedon Nov 13, 2026
Triage (Coder Agents maintainer, 2026-11-13): ready. A workstream started on this issue. Progress and PRs will be posted here.
ibetitsmike commentedon Nov 13, 2026
#279 (TestChatFamilySurvivesRestart) merged as 607a95b. #280 and #282 merge next, one per deploy, after each is brought up to main and gated again.
ibetitsmike commentedon Nov 14, 2026
#280 (replay-safe spawn_agent) merged as 5c34d7e. #282 is next after this deploys.
ibetitsmike commentedon Nov 14, 2026
#282 (message_agent dedupe) merged as 94caf1e. All three PRs for this issue are now on main: #279 (607a95b), #280 (5c34d7e), #282 (94caf1e).
Follow-up: #287 (same overlapping-replay race in message_family_chat).
Drain recommendation from the workstream, for Mike and ops: once 94caf1e is deployed, cut the 30-minute busy-chat drain to a short grace period. #279 shows a busy family survives a restart with nothing lost or duplicated; #280 and #282 remove the known duplicates from replayed spawn_agent and message_agent calls. The drain was about 30 of the 46 minutes of the #281 deploy.