fix(server): resumed background agents show in the Agents panel again - #173
Merged
Merged
Conversation
A background agent the model revives by sending it a message keeps working under its original task id, but reports that work under the call that resumed it. The roster matched only on the spawning tool call, so the row stayed settled and the Agents panel showed nothing while the agent ran. Agent task starts and progress now re-open a settled row, matched by the transcript link the task stream established. Update-only: a task that names no known agent still creates no row.
Every path that settles a background agent stops at the task and item ids it has already seen finish, so a SendMessage resume was swallowed: no new start edge, no second completion, and the agent's live text and final result had nowhere to land. The adapter now remembers which spawn owns each launched agent id and, when the model sends that agent a message, clears the bookkeeping the previous run left behind and reports the agent as running again. A target that is not a background agent of this session is ignored, so no row is invented for an agent the thread cannot show.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
A thread could sit at "waiting" while a background agent worked, with the Agents panel insisting no agents exist. Resuming a background agent by sending it a message (SendMessage with its agent id) never touched the agent's roster row: the row settled after the first run and nothing recognized the revival, including across a provider session restart, where the in-memory launch records are gone entirely.
Two layers, matching how the identity survives:
Task snapshots now keep the spawning call as their tool id (first writer wins), so a resumed run's completion replays onto the original spawn item instead of minting a duplicate row keyed by the resuming call.
Known limitation, deliberately out of scope: after a provider restart, a resumed agent's live commentary text does not stream into the panel (the launch record it routes through is gone); the row's status lifecycle is correct. Codex has no resume-by-message equivalent, so nothing applies there.