Skip to content

fix(delegation): observe completed children as completed and suppress bookkeeping rows - #623

Merged
rynfar merged 6 commits into
pylonfrom
fix/delegation-observation-truth
Sep 18, 2026
Merged

rynfar merged 6 commits into
pylonfrom
fix/delegation-observation-truth

Conversation

@rynfar

@rynfar rynfar commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Delegated children whose turns complete before a server restart or the idle reaper were being observed as interrupted by DelegationFollowThroughReactor because observeDelegatedChild prioritized a stopped session status over terminal turn states. In addition, changed child observations at startup could trigger stale wake turns, and internal delegation bookkeeping activity rows (delegation.child-state and delegation.follow-through.delivered) were rendering as clutter in web and mobile work logs.

What changed

  • Task 1: Reordered state precedence in observeDelegatedChild (apps/server/src/orchestration/delegationFollowThrough.logic.ts) so terminal turn states (completed, interrupted, error) take precedence over a session stopped afterwards by a restart or the idle reaper, matching deriveDelegatedThreadState.
  • Task 2: Updated DelegationFollowThroughReactor.ts to baseline any child observation whose notice key changed while the server was down (startupPass && work.liveChildId !== child.id), preventing historical turns from triggering stale wakes.
  • Task 3: Added delegation.child-state and delegation.follow-through.delivered to the web work log skip list in apps/web/src/session-logic.ts, keeping reactor bookkeeping hidden while leaving the user-facing delegation.follow-through.paused notice visible.
  • Task 4: Added the same bookkeeping activity kinds to the mobile feed skip list in apps/mobile/src/lib/threadActivity.ts.
  • Task 5: Documented accurate delegation boundaries and observation precedence in docs/internals/delegation.md, and appended durable fact 2026-09-18-delegation-follow-through-observation to .agents/durable-facts.jsonl.

Verification

  • vp test run apps/server/src/orchestration/delegationFollowThrough.logic.test.ts: PASS (13 passed)
  • vp test run apps/server/src/orchestration/DelegationFollowThroughReactor.test.ts: PASS (15 passed)
  • vp run -F t3 typecheck: PASS (exit 0)
  • vp test run apps/web/src/session-logic.test.ts: PASS (95 passed)
  • vp run -F @t3tools/web typecheck: PASS (exit 0)
  • vp test run apps/mobile/src/lib/threadActivity.test.ts: PASS (112 passed)
  • vp run -F @t3tools/mobile typecheck: PASS (exit 0)
  • vp fmt --check <modified files>: PASS (correct format)
  • vp lint <modified code files>: PASS (0 errors, 0 warnings)
  • Guard-rail diff check against origin/pylon for prohibited files: PASS (empty diff)

Not covered

No live provider runs; PR #620 files untouched.

Part of #622.

Planned and verified by Claude Fable 5.1 in Claude Code; implemented by Gemini 3.8 Flash (High) in Antigravity, as a Pylon delegated child.

@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:18am UTC

@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
@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 +14 B (+0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB −7 B (−0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB +21 B (+0.3%) 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 −4 B (−0.0%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB +11 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.8 KiB 6.7 KiB −15 B (−0.2%) 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: a85762e · PR result: 6400031 · 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.4 KiB

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

@rynfar
rynfar merged commit 2a63f7b into pylon Sep 18, 2026
20 checks passed
@rynfar
rynfar deleted the fix/delegation-observation-truth branch September 18, 2026 14:46

This branch was successfully deployed

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