Skip to content

feat(pair): delete executors left behind by abandoned drafts - #656

Merged
rynfar merged 2 commits into
pylonfrom
feat/pair-orphans
Sep 18, 2026
Merged

rynfar merged 2 commits into
pylonfrom
feat/pair-orphans

Conversation

@rynfar

@rynfar rynfar commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

When the server starts, it deletes pair executors that nothing will ever brief.

Why

Turning Pair on in a draft creates the executor before the lead thread exists, because the first send creates the lead, its worktree and its first turn in one step. If the draft is abandoned, or its id changes before that first send, the executor stays forever as an empty "Executor · New thread" in the delegated group.

How

  • orphanedExecutorIds (pure) is deliberately conservative. A missing lead proves nothing on its own, since that is what every freshly paired draft looks like. An executor counts only if it is a pair executor, its lead is not among the active or archived threads, it never ran (no turn, no session), and it is more than a day old.
  • PairLifecycleReactor.start runs the sweep once before subscribing to events and dispatches thread.delete with a deterministic command id, so a restart replays harmlessly. A failed sweep logs a warning and never stops the reactor from starting.

Verification

  • vp test run on apps/server/src/orchestration and apps/server/src/mcp/toolkits: 957 passed. New, written first and seen failing: the pure rule with six "leave it alone" cases (existing lead, fresh draft, an executor that ran, one with a session, a fan-out child, an ordinary thread), and a reactor test where only the abandoned draft's executor is deleted while an executor whose lead is archived is kept.
  • Typecheck t3: 0 errors. Lint, format and vp run knip:check clean.
  • Not run against a real database.

How it was built

Second change made through pair mode on a real install: Claude lead, Antigravity executor, one shared worktree, tests protected (protectedPaths: checked 2, changed []). One lead correction after review: the executor had made production code fall back to the snapshot time when the clock read zero, to get past a test running under a test clock. The test now sets the clock and the reactor reads it plainly.

Part of #622.

Model: Claude Fable 5.1 (lead) with an Antigravity executor, paired in Pylon via the Claude Code harness.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@github-actions github-actions Bot added size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 18, 2026
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pylon-marketing Ready Ready Preview Sep 18, 2026 10:12pm UTC

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 14.0 KiB 14.0 KiB +5 B (+0.0%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB −6 B (−0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB +11 B (+0.2%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 58.0 KiB 58.0 KiB +44 B (+0.1%) 66.4 KiB ✅
Codex Live turn messages 9 10 +1 (+11.1%) 21 ✅
Claude Total thread wire 14.0 KiB 14.0 KiB −4 B (−0.0%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB −18 B (−0.2%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.8 KiB +14 B (+0.2%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.9 KiB 58.9 KiB +44 B (+0.1%) 66.4 KiB ✅
Claude Live turn messages 9 10 +1 (+11.1%) 21 ✅

Baseline: 16c373e · PR result: 098f6e9 · 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: 115.6 KiB
  • Claude decoded thread snapshot: 116.3 KiB

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

@rynfar
rynfar merged commit 1045c63 into pylon Sep 18, 2026
20 checks passed
@rynfar
rynfar deleted the feat/pair-orphans branch September 18, 2026 22:21

This branch was successfully deployed

1 active deployment
Preview — 098f6e9c Deployed Sep 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant