Skip to content

feat: background shell wrappers, 900s codex flights, stop gate (0.0.73) - #93

Merged
okisdev merged 28 commits into
mainfrom
handback-delivery-long-flights
Nov 11, 2026
Merged

okisdev merged 28 commits into
mainfrom
handback-delivery-long-flights

Conversation

@okisdev

@okisdev okisdev commented Nov 11, 2026

Copy link
Copy Markdown
Owner

summary

  • forwarder agents launch their companion in a background shell and wait on it with a new shared await-output operation in slices of at most 100 seconds, then return one report. claude code can deliver a subagent report through SubagentHandback, which delivers once: on a host with that harness 13 of 17 wrappers handed back their waiting on <id> line and the real output never reached the orchestrator. shared/companion/await-output.mjs holds the logic, every companion and job-collect.mjs route to it, and the five forwarder agent files carry the protocol.
  • a report delivered through SubagentHandback is read from the transcript and counts as collected at SubagentStop for fusion's own workers (9 of 10 claude workers on that host were recorded as missing_final_text). a peer wrapper's handed back placeholder stays uncollected.
  • the stop gate stops asking for collection once a verdict is recorded (one session took 87 stop blocks, 75 for tasks already settled, and replayed 32.85M tokens), and the in flight notice is a systemMessage: as hook context it forced another turn each time, 269 in a week on one host, 265 of them a one line heartbeat at 376k tokens of context.
  • a codex task launched by a rescue wrapper flies for 900 seconds through the fixed option --transport-background-shell; a foreground bash call keeps 570. over seventeen days 15.6% of codex jobs timed out and those flights with their wind downs took 35% of codex wall clock, while the event ledgers show the jobs working, not hung.
  • the codex flagship lane default is gpt-6.1-sol at xhigh. gpt-6-astra at xhigh timed out on 40% of flights at 68.8 credits per job against 21% and 23.1, and beside four or more concurrent codex jobs more than half of its flights timed out.
  • a devin run survives the agent's request_scope call, which the companion used to end at the announcement (both write runs on devin 3000.12.43 in linked worktrees failed this way). burst briefs tell the engine to leave changes uncommitted.
  • dispatch: consult only roles stage read only without a header, hooks stop loading the stats graph, an ordinary bash call reads no worker records, and the peer capacity check opens only records that can be live.
  • visibility: /fusion:stats adds a last 7 days line to verification evidence and a wrapper delivery by plugin version section; verification recognition covers timeout, env, turbo, and nx; the breaker check reads only job files inside its lookback window, raises a wrapper delivery advisory, and asks a companion for host blockers through host-check (grok first).
  • upkeep: job monitors scan every 60 seconds while idle, the codex monitor ledger and observation sidecars are pruned, grok, cursor, and devin prune terminal job records after 90 days, session reminder markers are swept after 48 hours, cursor and devin share one job state module (1,624 lines to 245 plus the shared file), the codex lock scavenges orphan owner directories, and the grok and codex footers carry the lines the contract names.
  • release 0.0.73 across every plugin and the marketplace, with a changelog entry. rules-manifest.json is generated output.

test plan

already verified

  • npm test: three full runs of 1969 tests each ended 1965 pass, 3 skipped, and one failure that was a different timing sensitive monitor test each time and passed alone. those tests waited on scans that the idle cadence had made four times slower; with their scan interval restored, node --test tests/codex-jobs-monitor.test.mjs passed 62 of 62 three times in a row
  • claude plugin validate passes for codex, grok, cursor, devin, fusion, and claude plugin validate . --strict for the marketplace root; node shared/sync.mjs --check and node bench/manifest.mjs --check pass
  • harness probe: a subagent bash call with timeout: 600000 moved to the background at 180 seconds and ran to 700 seconds with exit code 0, so a background shell is not bound by the 600 second tool limit
  • replay: the handback reader against 27 real subagent transcripts from the handback host read 14 of 14 handed back reports and missed none
  • live devin 3000.12.43 probes: request_scope arrives as an announcement followed by a permission request; refused, the turn ended end_turn; a write run in a plain repository committed
  • hook latency on a snapshot of a 25,000 file data directory: 35 to 42 ms per hook, 33 of it node startup, 1 to 5 ms more than an empty directory
  • a grok review of the branch returned four findings: two fixed here (the peer placeholder rule, a 10 second quiet period before a footer alone counts as complete), one false (the 900 second deadline is assigned and asserted in tests/codex-deadline.test.mjs), one declined (the 90 day rule matches the one codex already applies)

reviewer should verify

  • after refreshing the plugin cache, /fusion:smoke passes, a codex dispatch that runs past 180 seconds returns its report with no waiting on notification, and /fusion:stats shows the wrapper delivery section

notes

  • rules checklist: it never executes a work package becomes a change that passes that gate is not a work package, and the main session never executes one, which states the same invariant and removes its conflict with the inline gate. the 570 second wording becomes one flight, with the clocks sentence naming 900 seconds through a wrapper and 570 from a foreground call. so a larger spec grade package uses gpt-6.1-sol at xhigh is replaced by the flagship lane default and the one package rule for gpt-6-astra. the runtime guard paragraph is shorter and keeps every fact a model acts on. added: a delegated review checks the quality floor without authoring, the panel's third seat follows the skill's two triggers, a lane's single flight slot excuses sequential dispatch, a filtered verification starts with set -o pipefail;, and a burst brief leaves changes uncommitted. no invariant in CONTRIBUTING.md changes; its foreground wrapper line now also says how the wrapper waits.
  • the acceptance advisory at stop still arrives as hook context on purpose: 16 of 22 led to a settlement.
  • open risk: the forwarder protocol depends on the harness appending [exited with code N] to a background shell's output file. without that line a terminal footer that stays unchanged for 10 seconds counts instead.
  • follow ups: rules: trim repeated statements and mechanism prose from orchestration.md #88 the larger rules trim, codex quick lane: compare effort high against xhigh #89 quick lane effort comparison, breadth companions: share render, entry, and session end code #90 the remaining cursor and devin duplication, tests share the system temp root and can disturb live sessions #91 test isolation from the shared temp root, re-measure brief size against timeouts under the 900 second flight #92 the brief size gate under the new flight.

…thout an exit line, tests follow the new footers
@okisdev

okisdev commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

live check with the branch copies loaded through --plugin-dir in headless sessions: a codex wrapper launched task --transport-background-shell in a background shell, a 200 second job took three await-output calls with one await-output: pending in between, and the wrapper returned the marker with state: done and no waiting on line. the codex job records show timeoutMs: 900000 and request.backgroundShellBudget: true. a grok wrapper returned its marker the same way without the option. the local suite's last run ended 1965 pass and one monitor timing failure with the host at a load average above 600; the ubuntu run here is green.

@okisdev
okisdev merged commit 076d71d into main Nov 11, 2026
4 checks passed
@okisdev
okisdev deleted the handback-delivery-long-flights branch November 11, 2026 10:31
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