Skip to content

fix(server): reconcile stale tasks created by legacy steers - #104

Merged
BreakTheBeta merged 2 commits into
mainfrom
fix/stale-terminal-agent-status
Oct 19, 2026
Merged

BreakTheBeta merged 2 commits into
mainfrom
fix/stale-terminal-agent-status

Conversation

@BreakTheBeta

@BreakTheBeta BreakTheBeta commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Historical MCP steers could leave follow-up tasks permanently running after their child runs completed. This kept blue “Working” rows in the Agents sheet and a “Waiting on 4 subagents” banner beside the parent composer on desktop. The running provider could overwrite the follow-up's run binding from its startup snapshot, leaving multiple task registrations attached to a settled child thread.

Upstream commit afc12ab70a already prevents new steers from creating these tasks. It does not repair historical rows: recovery requires a run binding or a missing original result transfer, and finalization cannot resolve an unbound follow-up.

Recover those active legacy tasks using the exact command identity shared by their MCP message and task IDs, then use the message's recorded run and its restart continuations. Reconcile the task, execution node, and turn item through persisted events, preserving the recorded terminal time. Reuse existing result transfers and completion acknowledgements. This clears both the Agents rows and the shared web/desktop/mobile background-work aggregation without age cutoffs, deleting history, or assigning an unrelated newer run's outcome.

Validation:

  • Red before / green after: deterministic historical-steer regression through the real orchestrator and SQLite projections. It verifies four stale rows, the shared composer aggregation, shell projections, repeat recovery, acknowledged delivery, completed/failed/cancelled/interrupted outcomes, running/waiting work, restart continuations, and genuinely active newer runs.
  • vp test run apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts apps/server/src/orchestration-v2/ProjectionRecovery.test.ts apps/server/src/orchestration-v2/SubagentProjection.test.ts packages/client-runtime/src/state/threadExecution.test.ts apps/mobile/src/features/threads/threadAgentsPresentation.test.ts — 104 tests passed, including SQLite/memory recovery parity and nested-work coverage.
  • Team review corrections add red-before/green-after coverage for mixed bound/unbound duplicate registrations, partial task bindings across active/completed restart continuations, and unrelated newer pending retry effects. Legacy recovery has 12 focused scenarios.
  • vp run --filter t3 typecheck passed. Targeted lint passed with two existing warnings outside changed lines. Normal pre-push format/lint gate passed.

Read-only inspection found four stale historical registrations, each mapping exactly to a completed run. Public evidence uses synthetic fixtures; private chat screenshots and database contents are not included. No browser/device session was launched, and the running installation was not modified, restarted, or updated. This PR needs the normal maintainer release process before it can repair that installation's persisted state.

Model: GPT-6.1-Sol. Harness: Codex in T3 Code.

@BreakTheBeta
BreakTheBeta merged commit 089977b into main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant