Skip to content

feat(delegation): skip the wake for a completion the parent already read - #639

Merged
rynfar merged 4 commits into
pylonfrom
feat/consumed-wake
Sep 18, 2026
Merged

rynfar merged 4 commits into
pylonfrom
feat/consumed-wake

Conversation

@rynfar

@rynfar rynfar commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

A parent that waits for a child inside its own turn and gets the finished result was still woken by the follow-through reactor once that turn ended. The wake carried nothing new and cost a full parent turn each time. This removes it.

Seen live with a paired Claude lead: it called pair_await, verified the executor's work, answered, and was then woken to say "already completed".

How

The reactor already skips a child whose stored delegation.child-state receipt has the current noticeKey and baseline: true. The tools now write that same receipt.

  • consumedDelegationObservation (pure): an observation counts as read only for a finished attempt: completed, error, or interrupted. A running child and a child that needs the user return null, so those wakes still happen.
  • delegationObservationReceipt (pure): the one place the receipt's id and payload are built. The reactor uses it too, so the two writers cannot drift.
  • markDelegationObservationConsumed: dispatches one thread.activity.append on the parent with a deterministic command id. It never fails a tool call; if the write fails, the cost is the old redundant wake.
  • Called from pair_await once the executor is not running, and from delegated_thread_status and delegated_thread_result.

Activities are stored by id, so the tool's receipt replaces what the reactor recorded while the parent was busy, and either order of the two writes ends the same way. No contract, decider, projector, or migration changes.

Verification

  • vp test run on delegationFollowThrough.logic.test.ts, DelegationFollowThroughReactor.test.ts, and the pair and delegation toolkits: 172 passed. New cases: the pure rules, one receipt per finished pair_await / delegated_thread_status and none for a running child, and a reactor test where a child finishes while the parent is busy, the receipt is rewritten with baseline: true, and the idle parent is not woken.
  • Typecheck t3: 0 errors. vp run knip:check: clean.
  • Live, isolated server, Claude lead with a Claude executor: before, one brief produced two assistant turns and a delivered wake; after, one brief produced one assistant turn, the receipt is stored with baseline: true, and no wake was delivered.

Built test-first: the contract and the failing logic tests were written by the lead and left unchanged (blob 6131d97c), the implementation and handler tests by an Antigravity executor, the reactor test, review, live check and prose by the lead.

Part of #622.

Model: Claude Fable 5.1 (lead) with an Antigravity executor, 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:26pm UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 18, 2026
@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 −8 B (−0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB +4 B (+0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB −12 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 13.9 KiB −46 B (−0.3%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB +6 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.7 KiB −52 B (−0.8%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.9 KiB 58.8 KiB −44 B (−0.1%) 66.4 KiB ✅
Claude Live turn messages 9 8 −1 (−11.1%) 21 ✅

Baseline: 6468f56 · PR result: d326bf3 · 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.

This branch was successfully deployed

1 active deployment
Preview — d326bf3b 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:L 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