Repository navigation
fix(server): settle finished agent-only threads - #123
Merged
Merged
Conversation
Finished agent-only work stayed in the agent inbox until someone settled it by hand. A completed, interrupted, or cancelled agent-only thread now settles when its run ends, when its parent has the subagent result, and when the last pull-request watch ends. Founder and shared inboxes are never auto-settled, and a failed agent thread stays unsettled. The existing startup sweep backfills threads that are already finished. Model: grok-4.7 Task: fix Agent: Codex
A provider subagent copies its latest message into result while it is still running, and a later follow-up can sit beside an older delivered result. Settlement now requires a terminal task with no open follow-up, settles a subagent only when it is idle or finished, and keeps a pending monitor. Model: grok-4.7 Task: fix Agent: Codex
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Finished agent-only threads stayed in the agent inbox after their runs ended, so done work piled up until someone settled it by hand. The agent inbox should hold only work that is not done.
A completed, interrupted, or cancelled agent-only thread now settles when the run ends, when a subagent's parent has the result, and when the last pull-request watch ends. The existing startup sweep backfills threads that are already finished and skips ones already settled. Kameron, Jeff, and shared inboxes are never auto-settled, including by the day and merge settings. Failed agent threads stay unsettled. A pending watch, monitor, request, snooze, or queued message still holds the thread.
Tests cover each rule and those holds.
apps/servertypecheck passed. Localvp lintcannot load the TypeScript oxlint plugin on Node v22.22.1, so lint is left to CI.Not in this change: suppressing a stale lane-ended alert when a newer run is already going. That alert path is the one t3code#113 is already editing.
Deploy: fleet
Model: grok-4.7
Task: fix