Skip to content

feat(agents): mark agents the provider runs in the background - #196

Merged
badcuban merged 1 commit into
mainfrom
feat/agent-background-mark
Aug 28, 2026
Merged

feat(agents): mark agents the provider runs in the background#196
badcuban merged 1 commit into
mainfrom
feat/agent-background-mark

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

The Agents tab could not tell a background agent from one the turn was waiting on, even though the Claude SDK reports this on every agent task.

What changed

  • The roster gains an optional isBackgrounded flag: new nullable column on projection_thread_subagents (migration 049). NULL/0/1 is mapped at the row boundary the same way the message streaming flag is, in one shared helper used by the repository and the snapshot query.
  • The Claude adapter sends the flag with the depth at task_started, and again when a task_updated patch moves a foreground agent to the background.
  • Live rows show background in the meta line after the model and effort. Finished rows do not; how an agent was launched no longer matters on a receipt. Codex never sets the flag, since its agents always block the parent.
  • Also fixes a latent projection bug this exposed: a subagent.metadata update that carried no depth information reset the agent's depth to 0. A payload now only sets depth when it knows it.

Testing

  • Typecheck clean in contracts, server, web.
  • Server 152/152 across the projection, persistence, migration, and Claude adapter suites. New projection test covers unknown, foreground, and a later move to background, and pins the depth-reset fix.
  • Web 191/191. New panel-logic test: background appears on a live backgrounded row, not on a live foreground one, not on a finished one.
  • Existing installs pick up the column on next start via the migration; rows recorded before this have no flag and show nothing new.

The Agents tab could not tell a background agent from one the turn was
waiting on, even though the Claude SDK reports it on every agent task.

The roster gains an optional isBackgrounded flag (new nullable column on
projection_thread_subagents, migration 049; NULL/0/1 mapped at the row
boundary the same way message streaming flags are). The Claude adapter
sends it with the depth at task start and again when a foreground agent
is moved to the background. Live rows show "background" in the meta line
after the model and effort; finished rows do not, since how an agent was
launched no longer matters on a receipt. Codex never sets it.

Also fixes a latent projection bug the move exposed: a metadata update
that carried no depth information reset the agent's depth to 0.
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
threadlines Skipped Skipped Aug 28, 2026 6:28pm

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Aug 28, 2026
@badcuban
badcuban merged commit ffd44a4 into main Aug 28, 2026
16 checks passed
@badcuban
badcuban deleted the feat/agent-background-mark branch August 28, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant