Skip to content

fix(pair): no argument turns pair_await or delegated_thread_status into a poll - #654

Merged
rynfar merged 2 commits into
pylonfrom
fix/pair-polling-guards
Sep 18, 2026
Merged

rynfar merged 2 commits into
pylonfrom
fix/pair-polling-guards

Conversation

@rynfar

@rynfar rynfar commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

Two guards so neither waiting tool can be used as a poll.

  • pair_await: a lead may read a running executor instantly (maxSeconds: 0) twice in a row. A third instant read waits the whole cap instead. Any wait, or finding the executor not running, clears the count.
  • delegated_thread_status: omitted or 0 reads the state; any positive waitSeconds waits the whole 45 seconds. It already returns the moment the child changes, so a shorter wait gains nothing.

Both tool descriptions say so.

Why

#640 made positive pair_await waits run to the cap after a live Codex lead looped on 10 to 20 second waits, but left two holes: a loop on maxSeconds: 0, and the same short-wait loop on the fan-out status tool. Each return from either tool is a model turn.

How

  • pairAwaitPlan (pure) returns the wait budget and the next instant-read count; the handler keeps the count per executor in memory beside the protected-path record.
  • delegatedStatusWaitSeconds (pure) and MAX_STATUS_WAIT_SECONDS move the cap into delegation/logic.ts.

Verification

  • vp test run on apps/server/src/mcp/toolkits and apps/server/src/orchestration: 958 passed. Five tests were written first and seen failing: both pure rules, a handler test where the third instant read reports waitedSeconds: 45, and the fan-out test that used to return after 5 seconds.
  • Typecheck t3: 0 errors. Format and vp run knip:check clean.

How it was built

This is the first change made through pair mode itself on a real install (nightly .201): a Claude lead paired with an Antigravity executor (gemini-3.8-flash-high) sharing one worktree. The lead wrote the contract and tests and listed the four test files as protectedPaths; one pair_handoff; Pylon woke the lead when the executor finished; pair_await reported protectedPaths: { checked: 4, changed: [] }; the lead read the diff, re-ran everything above, and wrote the docs and this text. One executor turn, no corrections needed.

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 vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 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:08pm UTC

@github-actions

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 −3 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.8 KiB 6.7 KiB −9 B (−0.1%) 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 10 9 −1 (−10.0%) 21 ✅
Claude Total thread wire 14.0 KiB 13.9 KiB −17 B (−0.1%) 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.7 KiB +1 B (+0.0%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.9 KiB 58.9 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: 4be539f · PR result: bbbc4c2 · 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 16c373e into pylon Sep 18, 2026
19 checks passed
@rynfar
rynfar deleted the fix/pair-polling-guards branch September 18, 2026 22:11

This branch was successfully deployed

1 active deployment
Preview — bbbc4c2e 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