Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The change is limited to deriving subagent display liveness in the web UI, preserving active-turn behavior while using the server’s restart-cleared background signal to stop stale agents from appearing active. It introduces no schema, deployment, security-sensitive, or configuration-default changes. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesAgent session liveness
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: 🔵 Low · up to The Agents panel can still show a dead subagent as running while unrelated monitoring work continues. This is a bounded status inconsistency; merge with owner awareness or follow up on agent-specific liveness. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Dismissing prior approval to re-evaluate 7ceba40
|
Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition. This PR changes ChatView agentSessionLive and deriveAgentPanelModel using V1 backgroundLiveness. Those paths are absent from current ChatView; V2 projects child lifecycle on the server. Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved. |
Problem
When the T3 server restarts while a background subagent is running, the restart kills the provider process and the subagent with it. The sidebar correctly stops showing the thread as Working. The Agents panel still shows the dead agent as running: its timer keeps counting, the footer reads "1 working", and the timeline says "Kicked off 1 subagent". The panel and the sidebar disagree, and the panel is the one that is wrong.
To reproduce:
Agentwithrun_in_background) and let the main turn end.Change
foldSubagentActivitiesalready marks active agents as interrupted whensessionLiveis false.ChatViewsetsessionLiveonly from the session phase, so it went false only for a stopped or failed session. Server startup reconciliation leaves idlereadysessions as they are, because they resume on the next message. After a restart, the session still readsreadyand the dead agents stay live.The panel now treats agents as live while the turn is running or connecting, or while the shell reports
backgroundLiveness. The sidebar and the "agent working" composer banner already read that server signal. The server fills it from the sametask.*events the fold reads, and it starts empty after a restart. One signal now drives all three surfaces, so they cannot disagree.Mobile has no Agents panel, so this change does not affect it.
Scope and approval
This is a very small, focused fix for an obvious bug. A dead agent shows as working forever, and the code already intends to prevent that (see the
sessionLivecomment insubagentRuntime.ts). The change is one condition inChatView.tsx, with no server or contract changes.Verification
I ran a dev server from this branch against a copy of a real database. The copy contains a thread whose subagent was killed by a restart: it has a
task.startedrow with no terminal row and areadysession. I drove the web app with a headless Chromium.main): the Agents panel shows the dead agent running at 31m 37s and climbing, with "1 working". The sidebar shows no Working state.sleep 90subagent and ended. The sidebar showed Working, the banner showed "1 agent working", and the panel showed the agent running. I repeated the check with Codex (GPT-6-Astra) and got the same result. After the subagent finished, the panel settled to idle.tsc --noEmitinapps/webpasses.vp test run packages/client-runtime/src/state/subagentRuntime.test.ts: 47 of 47 tests pass.I did not add a unit test. The change is one condition inside a component, and the fold's interruption behavior already has tests. I did not test mobile, because it has no Agents panel.
Done with Claude Opus 5.5 in Claude Code, running inside T3 Code.