Skip to content

fix(pair): pair_await waits the whole cap so a lead cannot poll - #640

Merged
rynfar merged 1 commit into
pylonfrom
fix/pair-await-floor
Sep 18, 2026
Merged

rynfar merged 1 commit into
pylonfrom
fix/pair-await-floor

Conversation

@rynfar

@rynfar rynfar commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

pair_await no longer lets the lead pick a short wait. Any request except an explicit 0 waits the lead's whole cap (45 s, or 150 s where Pylon sets the provider's tool timeout). 0 still reads the state and returns at once.

Why

In a live run a Codex lead called pair_await with maxSeconds: 10 and 20 in a loop, twelve calls in four minutes against an executor that never finished. Each return is a model turn, which is the polling cost pair mode exists to remove. The call already returns the moment the executor stops or needs the user, so a long wait loses nothing.

The old default was also wrong: leaving maxSeconds out meant "do not wait", so the most natural call returned instantly and invited a loop.

How

  • pairAwaitBudgetSeconds(requested, cap) in pair/logic.ts: 0 gives 0, anything else gives the cap. The handler uses it in place of Math.min(requested ?? 0, cap).
  • The parameter description now says to leave it out, that values above 0 are raised, and that 0 is a state read.
  • Two handler tests that encoded "omitted means no wait" now ask for maxSeconds: 0.

Verification

  • vp test run apps/server/src/mcp/toolkits/pair: 55 passed, including the new rule.
  • Typecheck t3: 0 errors. Format check clean.
  • Not run live after the change.

Known limits

  • A lead can still loop on maxSeconds: 0. Nothing counts repeated reads yet.
  • delegated_thread_status still honors short waits; the fan-out tools are being superseded by pair mode, so they are left alone here.

Part of #622.

Model: Claude Fable 5.1, 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.

@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 5:40pm UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Sep 18, 2026
@rynfar
rynfar merged commit 2d75ab3 into pylon Sep 18, 2026
19 checks passed
@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 13.9 KiB −13 B (−0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB 0 B (0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB −13 B (−0.2%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 58.0 KiB 58.0 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 9 9 0 (0.0%) 21 ✅
Claude Total thread wire 14.0 KiB 14.0 KiB 0 B (0.0%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB −2 B (−0.0%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.7 KiB +2 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: 6468f56 · PR result: c2f2084 · 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.7 KiB
  • Claude decoded thread snapshot: 116.3 KiB

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

This branch was successfully deployed

1 active deployment
Preview — c2f20842 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:S 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