Skip to content

fix: peer transport wrapper completion contract (0.0.36) - #35

Merged
okisdev merged 2 commits into
mainfrom
fix/peer-wrapper-transport-contract
Jul 22, 2026
Merged

fix: peer transport wrapper completion contract (0.0.36)#35
okisdev merged 2 commits into
mainfrom
fix/peer-wrapper-transport-contract

Conversation

@okisdev

@okisdev okisdev commented Jul 22, 2026

Copy link
Copy Markdown
Owner

summary

  • 0.0.35 expanded the SubagentStop matcher to codex:codex-rescue, grok:grok-rescue, and grok:grok-review-runner for peer identity backfill, but completionContract() kept defaulting them to the verification contract, so completedReport() tested their relays against EXECUTION_END_MARKER (delivery: complete plus verification: passed), which a verbatim companion envelope ending in state: done can never satisfy
  • every foreground peer delivery therefore burned the single truncation recovery retry arguing with the gate, got a false failureKind delivery, and was terminalized as incomplete, which the notification reconcile guard skips, so notification driven auto collection broke and the main session hit a stop collection block on every peer package
  • peer wrappers now carry a dedicated transport completion contract: completedReport() accepts a relay whose footer parses through peerJobIdFromCollectedResult (the same parser settlement identity backfill uses), grok:grok-review-runner is always deliverable because its terminal output may be raw JSON validated by the review consumer, and retryInstruction() gains a matching transport retry message for genuinely truncated relays
  • records created before this fix keep working after a hot deploy because the guards also match the agent type, not only the stored contract value

test plan

already verified

  • node --test tests/fusion-worker-lifecycle.test.mjs tests/fusion-worker-state.test.mjs tests/fusion-stats.test.mjs -> 184 passed, 0 failed (six new regression cases: transport contract recording, codex and grok envelope relays completing without a retry, retry exhaustion to incomplete plus failureKind delivery, stale verification contract records, review runner raw JSON)
  • full npm test -> single red in the known codex-exec INT reap flake that predates this branch; isolated rerun node --test tests/codex-exec.test.mjs -> 42 passed, 0 failed

reviewer should verify

  • dispatch any codex:codex-rescue or grok:grok-rescue package on a plugin build carrying this fix and confirm the wrapper's SubagentStop no longer injects the "not deliverable yet" retry after a verbatim companion relay, the job record keeps retryCount 0 with no failureKind, and the result auto collects from the completion notification without a stop block

notes

  • observed live in the first 0.0.35 session: two of two peer packages ate the false retry while twenty nine peer packages on 0.0.34 sessions earlier the same day were clean; installed caches pick this up at the next release plus cache refresh

@okisdev okisdev changed the title fix: peer transport wrapper completion contract fix: peer transport wrapper completion contract (0.0.36) Jul 22, 2026
@okisdev
okisdev merged commit f7d6e04 into main Jul 22, 2026
5 of 6 checks passed
@okisdev
okisdev deleted the fix/peer-wrapper-transport-contract branch July 22, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant