Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep queued subagent status in sync #21487

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/21487/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Problem

Queued subagent runs could leave their parent task cards in a stale status after a thread stopped or recovered. Cancelling a delegated task also left its held queued run in place.

Change

Update parent task projections when delegated runs enter queued, starting, or terminal states. Recovery now reconciles held runs to idle, and queue resume restores their active status. Cancelling a task removes its own queued run, even when the queue is held, while preserving other queued work.

Scope and approval

This is a focused fix for stale delegated-task status and cancellation behavior in the server's existing subagent workflow.

Verification

Added regression coverage for pausing, recovery, and resuming queued subagent follow-ups, plus integration coverage for cancelling a held delegated run. Tests were not run.

    1. juliusmarminge added labelsmacroscope-review

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 9bc73ac

      Macroscope's review found this PR approvable — This is a focused orchestration bug fix that synchronizes held and queued subagent statuses and cancels queued task turns, with targeted integration and unit coverage. Production changes remain localized and introduce no schema, deployment, security, billing, default, or static-analysis configuration changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB4.9 KiB−23 B (−0.5%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB−23 B (−1.9%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.8 KiB−41 B (−0.2%)29.3 KiB✅
      CodexLive turn messages21−1 (−50.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: ab6be13 · PR result: 9bc73ac · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Sign in to join this conversation.