Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): subagent threads stop publishing tombstones to the relay #15016

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/15016/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Problem

Subagent threads never project agent activity (projectThreadAwarenessV2 returns null for them), so the relay never holds a row for one. But every subagent event (subagent.updated, run.updated, …) still sent the relay a null state (a tombstone). The relay re-delivers the user's whole activity aggregate to every device on each publish, so each one was a chance to re-alert.

In production traces, one thread finishing with six audit subagents produced 107 tombstone publishes in an hour from a single environment. On push-only devices, those were what turned one completion into dozens of repeated "Done" alerts.

Fix

AgentAwarenessRelay skips the publish when a subagent thread has no published state to clear. Both provider-native subagents and MCP delegated tasks use relationshipToParent: "subagent", so both are covered.

The relay-side fix, which stops re-alerting even when tombstones arrive, is a separate PR. This change removes the pointless traffic.

Verification

Not visual; the before/after evidence is a regression test.

  • New test never publishes tombstones for subagent threads: fails on main (one null publish) and passes with this change (no publish).
  • vp test run src/relay/AgentAwarenessRelay.test.ts: 23 passed.
  • vpr typecheck (server): passed. vp lint / vp fmt on changed files: clean.

🤖 Generated with Claude Code

Model: Claude Opus 5.5 (1M context) · Harness: Claude Code in T3 Code


Devin Review
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. juliusmarminge added labelsmacroscope-review

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

      Approvability

      Verdict: Approved at 62197c3

      Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that suppresses redundant relay tombstones for unpublished subagent threads while preserving normal cleanup for any thread with published state. Regression coverage includes both live and archived subagents, with no schema, deployment, default, or static-analysis changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. 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 wire4.9 KiB4.9 KiB+40 B (+0.8%)6.8 KiB✅
      CodexThread snapshot wire3.7 KiB3.7 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.1 KiB1.2 KiB+40 B (+3.4%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.4 KiB20.4 KiB+41 B (+0.2%)29.3 KiB✅
      CodexLive turn messages12+1 (+100.0%)8✅
      ClaudeTotal thread wire4.9 KiB4.9 KiB−41 B (−0.8%)6.8 KiB✅
      ClaudeThread snapshot wire3.7 KiB3.7 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB−41 B (−3.4%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded20.8 KiB20.7 KiB−41 B (−0.2%)29.3 KiB✅
      ClaudeLive turn messages21−1 (−50.0%)8✅

      Baseline: 22e9d35 · PR result: 62197c3 · 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: 106.1 KiB
      • Claude decoded thread snapshot: 106.4 KiB

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

    5. juliusmarminge merged thisd668ffc

    6. juliusmarminge closed this

Sign in to join this conversation.