Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): threads settle right after a shell merge of an unlinked PR #24830

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/24830/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

When an agent merged a branch PR from its shell (gh pr merge) and never linked that PR to the thread, the thread showed up in the inbox and then disappeared up to a minute later. The settle check read the branch PR lookup cache, which keeps an open PR for 60s.

The settle service now notices a finished merge or close command, using the same per-host detection the PR sync already uses. On that thread's next settle check, it reads the branch PR fresh, so the settle lands inside the clients' 2s Working grace. Linked PRs were already refreshed this way in #24760.

Proved with a focused test. It times out on main, because the thread never settles, and passes with this change.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

    1. Approvability

      Verdict: Approved at 02e76bf

      Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that refreshes cached branch pull-request state after recognized shell merge/close commands, allowing existing auto-settlement behavior to occur promptly for unlinked PRs. The accompanying focused test covers the affected path, with no schema, deployment, security, billing, or default-setting changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    2. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire4.9 KiB5.0 KiB+30 B (+0.6%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB+30 B (+2.5%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.8 KiB20.9 KiB+41 B (+0.2%)29.3 KiB✅
      CodexLive turn messages12+1 (+100.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB+31 B (+0.6%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB+31 B (+2.6%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB+41 B (+0.2%)29.3 KiB✅
      ClaudeLive turn messages12+1 (+100.0%)8✅

      Baseline: e0b1940 · PR result: 02e76bf · 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.