Repository navigation
feat(pi): accept native Codex ultra effort with progress-aware supervision - #4038
Conversation
…d by this PR. The shard ran the default-on live guard tests/fm-pi-branch-responsiveness-live-e2e.test.sh, whose idle arm loads .pi/extensions/fm-branch-supervision.ts into a scratch project with a fixed list of copied libs. This PR added `import { registerFirstmateTool } from "./lib/fm-native-contract.ts"` to that extension and updated every other loading fixture's copy list, but missed this guard. Pi 0.85.1 therefore refused to load the extension ("Cannot find module './lib/fm-native-contract.ts'"), never drew its TUI, the test failed with "Pi 0.85.1 never drew its TUI in the idle arm", and the job hit its 20-minute cap. Fix (one line): added fm-native-contract to the lib copy loop in tests/fm-pi-branch-responsiveness-live-e2e.test.sh. Swept all other suites referencing fm-branch-supervision.ts / fm-primary-pi-watch.ts; the remaining ones without the new lib only hash, path-reference, or string-match the files and do not load them into Pi, so no further fixture changes are needed. Verification: reproduced the mechanism against the installed Pi 0.85.1 by building the lab copy with the old lib list (load error as above) and the fixed list (loads cleanly). tmux is not installed on this machine, so the live guard itself gate-skips locally ("skip: live: tmux absent") and could not be run end to end here; CI (which has tmux and Pi) will exercise it. shellcheck is clean on the edited file
|
Speaking as Kun's firstmate: Triage: HEAD Classing evidence:
VISION (per rule):
contract-class: opt-in. New unconfigured default path does not select ultra; progress/native-tools activate only for native Codex paths. Security: no tip beyond ordinary adapter surface. Auto-merge now. |
|
Speaking as Kun's firstmate: this is merged. Thank you @3264studios — really appreciate you taking the time on this. |
* fix(bin): refuse test runs in the primary checkout when a task marker is set (#3891) * fix(bin): refuse the behavior suite in the repository primary checkout A task worker's isolated worktree placement is verified exactly once, when its task starts, and nothing re-checks it afterwards. A worker that later changes directory into the repository's primary checkout runs its Git commands, and this branch-switching suite, against the one checkout every linked worktree resolves against and every landing merges into. A run that dies mid-suite can leave that checkout on a stray branch. bin/fm-test-run.sh now refuses that case. When FM_TASK_ID marks a task worker and the runner resolves to the primary checkout, every executing mode exits non-zero before selecting a suite, with one line naming the primary path and pointing at the assigned task worktree. The predicate is the one bin/fm-spawn.sh already uses for launch placement: the working tree's own git dir is the repository's common git dir, which separates the primary from every linked worktree even when their top levels differ. A run with no FM_TASK_ID set is unchanged, and so are the inspection modes, which execute nothing. When git resolves neither directory - a non-repository fixture, a detached copy - nothing proves this is the primary, so the run proceeds. bin/fm-spawn.sh sets the marker: ship and scout launches export FM_TASK_ID into the pane shell on the same pre-launch channel as GOTMPDIR, and the name joins the sanitized launch environment allowlist so an isolated launch keeps it. * no-mistakes(review): clear inherited task marker in test lib; name resolved ROOT * no-mistakes(document): docs: record FM_TASK_ID marker and runner placement refusal --------- Co-authored-by: Talon Stark <[email protected]> * fix(bin): bound stale alarms for backlog captain holds (#3842) * fix(bin): bound a stale alarm with the backlog hold, not only the status line A legitimate wait has two records and the stale alarm reads only one. `status_is_paused_or_captain_held` takes a status line, so it sees a wait the worker declared. It cannot see the wait firstmate records when it hands work to the captain: `bin/fm-captain-hold.sh hold` writes that into the backlog and leaves the status log alone, so a delivered task keeps `done: PR ...` as its last line for the whole time the captain is deciding. Both stale branches were blind to it, and each churned a new pane hash back into its own alarm: a `done:` line is captain-relevant and reaches the terminal-
Intent
Firstmate documents worker effort as a concrete harness axis, but the shared enum rejects native Codex
ultrabefore Pi can launch it.Native activity inside a long Pi turn also fails to refresh the watcher age bound, and native tool execution cannot discover Firstmate's guarded controls.
Accept
ultraonly for explicitcodex-native/<model>selections on Pi or Pi-signed and emit--codex-effort ultra, never--thinking ultraormax.Preserve that effort through batch dispatch, guarded relaunch, and local or remote secondmate restart; refuse unsupported and raw launches before lifecycle changes.
Refresh a generation-bound progress marker independently of semantic busy state and turn completion, so observable native activity prevents false wedge escalation while stale incarnations remain unable to refresh their replacements.
Expose the registered Firstmate tools and operational-message types through
firstmate:native-tools, retaining the original execute callbacks and ownership checks without exposing Pi built-ins.When the primary itself runs native Codex, its background supervision branch remains an independent ordinary Pi agent.
It follows the same model through
openai-codex, never inherits the main native thread, refuses acodex-nativebranch pin, and returns the wake to main if the ordinary model is unavailable.The branch builder and
/supervision-modelpicker share one resolution rule, so the picker reports the model that will run or the exact refusal.Reproduction and validation
On upstream base
b84e0e362face25f3dd8945297a3df1320d7668c, the native Ultra spawn fails with--effort must be one of low, medium, high, xhigh, max.Running the expanded dispatch test with the base
bin/also fails its new Ultra cases.On this branch, the expanded suite passes: native Pi and Pi-signed launches emit
--codex-effort ultra, metadata retainseffort=ultra, and invalid profiles and raw launches are refused.Targeted spawn, relaunch, restart, bootstrap, busy-state, adapter, watcher, and Pi extension tests pass.
Shell syntax, canonical ShellCheck, workflow lint, strict Pi typechecking, and documentation checks pass.
The default-on native guard passes against installed Pi 0.85.1 and pi-codex-native 0.2.1, including initial, operational, and resumed Ultra turns; observable adapter progress; guarded tool execution; and durable outcome acknowledgement with duplicate refusal.
Its App Server peer and watcher-close process are deterministic fixtures; it does not test a live model or real backend.
The broad portable run completed 151 scripts with six capability skips and the pre-existing macOS fixture failure disclosed below.
A separate live-harness run completed 26 scripts with zero failures and 24 capability or opt-in skips; real Herdr lifecycle checks were not exercised.
The responsiveness guard now copies
fm-native-contract.tsinto its isolated Pi fixture.The missing dependency caused Pi to reject the extension; the corrected fixture loads successfully, and its serial CI job passes.
Baseline disclosures
The unchanged turn-end fixture in
tests/fm-turnend-guard.test.shfails under BSD touch on macOS because GNU-styletouch -d @<epoch>is rejected, leaving the stale-beacon fixture fresh.The complete suite passes with GNU touch selected through an isolated PATH.
The test and guard sources match upstream, and this branch does not change that fixture or fix its portability issue.
The opt-in Pi branch SDK guard also fails identically on upstream main and this branch against Pi 0.85.1: its unpinned session-restore assertion observes
gpt-5.5instead of fixture modelfm-live-a.This branch does not change or fix that pre-existing failure.
Neither baseline failure is reported as a pass.
Upstream reconciliation
The busy-age documentation overlapped newer upstream pause and foreign-queue stall guidance.
The reconciliation preserves upstream pause behavior and the 180-second no-progress foreign-stall bound while adding native progress to the busy-age description.
Updates from git push no-mistakes