Skip to content

fix(prime): restore follow-up input after stopping subagents - #606

Merged
rynfar merged 3 commits into
pylonfrom
fix/prime-stop-subagents
Sep 17, 2026
Merged

rynfar merged 3 commits into
pylonfrom
fix/prime-stop-subagents

Conversation

@rynfar

@rynfar rynfar commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Stopping a Prime Agent turn with active subagents could leave later messages rejected with “Prime Agent background work is still running,” even after the subagents stopped. The native busy flag waited for descendant completion confirmation that was not restarted after turn settlement or terminal background events. Correlated prompts also missed resuming the input queue after abort.

Re-arm the completion wait after busy turn settlement, child updates, idle compaction completion, and busy session resync. Resume the native queue before the next correlated prompt. Preserve authoritative terminal results and existing busy/recovery checks.

Validation: 523 tests passed across PrimeAgentDaemonAdapter.test.ts and PrimeAgentDaemonSessionRuntime.test.ts; server typecheck; scoped lint and formatting. Regression coverage verifies pending background work still blocks conflicting input, terminal events replace the completion wait, follow-up input succeeds after completion, and failed queue resume prevents prompt submission. No live provider/UI reproduction was run. This is shared Prime daemon server behavior; no wire schema or client changes.

Implemented by Antigravity (gemini-3.8-flash-high) through Pylon delegation; reviewed, corrected, and verified by Codex (GPT-6) in the Codex harness.


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

…nts stop

When a user interrupts Prime Agent while subagents are running:
1. Settle correlated turns as cancelled when cancellation was requested
   or prompt lifecycle cancellation returned too_late with a terminal
   phase, preventing the false "Prime Agent finished without sending a
   final response" warning.
2. Rearm the background RLM quiescence watch when active turns settle,
   subagents transition to terminal states (done/error/cancelled),
   compaction completes, or a resync occurs while input admission is busy.
   This allows the headless completion barrier to execute and clear
   nativeRunObservedActive / inputAdmissionBusy instead of rejecting
   subsequent turns with "Prime Agent background work is still running".
3. Resume daemon queue admission (resumeAfterAbort) on correlated prompt
   submissions following an abort.

Includes regression test verifying interruption during active subagents,
cancelled turn settlement, background quiescence completion, and successful
admission of follow-up input.
@vercel

vercel Bot commented Sep 17, 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 17, 2026 6:35pm UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Sep 17, 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 13.9 KiB −33 B (−0.2%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB +1 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB −34 B (−0.5%) 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 8 −1 (−11.1%) 21 ✅
Claude Total thread wire 13.9 KiB 13.9 KiB −13 B (−0.1%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB +10 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.7 KiB −23 B (−0.3%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.8 KiB 58.8 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 8 8 0 (0.0%) 21 ✅

Baseline: 2ed2480 · PR result: 651cbac · 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 ad33250 into pylon Sep 17, 2026
19 checks passed
@rynfar
rynfar deleted the fix/prime-stop-subagents branch September 17, 2026 18:45

This branch was successfully deployed

1 active deployment
Preview — 651cbac5 Deployed Sep 17, 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