Skip to content

fix: harden remote worker and supervision recovery - #2950

Open
V4f1k wants to merge 8 commits into
kunchenguid:mainfrom
V4f1k:fm/oracle-remote-job-worker-probe-fix
Open

fix: harden remote worker and supervision recovery#2950
V4f1k wants to merge 8 commits into
kunchenguid:mainfrom
V4f1k:fm/oracle-remote-job-worker-probe-fix

Conversation

@V4f1k

@V4f1k V4f1k commented Aug 24, 2026

Copy link
Copy Markdown

Intent

Diagnose and fix the Oracle-specific remote job worker readiness failure that prevents Firstmate from propagating inherited config and relaunching remote secondmates. The end-user reproduction must use the official path with the tracked worktree code and primary private registry/home: FM_HOME=/Users/computer/firstmate FM_ROOT_OVERRIDE="/Users/computer/.treehouse/firstmate-110893/2/firstmate" bin/fm-on.sh fleet-platform fm-remote-doctor.sh. The failure was reproduced before the fix as remote-job-worker=ok with remote-job-probe=fixable, while the independent isolarpv-ai path passed. Root cause evidence must explain how a Linux worker can remain running while its required-tool probe is stale: a serving worker can own the lock while a long-poll job output readers remain hung after the job target disappears, stopping the heartbeat; the lifecycle must distinguish owned process identity from readiness freshness so --fix stops the owned worker before replacement instead of launching a second supervisor behind the lock. Keep the readiness contract fail-closed. Preserve all required tool, code identity, transport, endpoint, ownership, quarantine, and fresh-probe checks. Do not bypass fm-on.sh, weaken the readiness gate, or invent an alternate control path. Use the smallest robust correction in the authoritative remote worker lifecycle owner and executable-interface regression coverage through the real fm-remote-doctor.sh interface. Review the supported Darwin and Linux lifecycle paths and the applicable worker backend behavior. The incident allowed host-local cleanup only for the exact previously recorded Oracle processes bound to job-p2TIjY: before each signal revalidate PID, actual parent, start time, cwd, cmdline, and job binding, and verify the postcondition after each step. Never use a broad kill, signal the supervisor process group for that cleanup, or expand the target set. That cleanup was completed and restored the real Oracle doctor. Verify a real post-fix official Oracle doctor pass and one ordinary remote command that previously failed through the job worker. The ordinary command is the idempotent official fm-on.sh fleet-platform fm-remote-inherit.sh absent config/trace-context 0 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 25, which completed with exit 0 and unchanged. Focused tests, the changed relevant test family, bin/fm-lint.sh, and bin/fm-doc-audience-check.sh must pass when applicable. Do not use Claude for any part of the task or pipeline.

What Changed

  • Separate remote worker ownership from readiness probing so Linux fm-remote-doctor.sh --fix can replace an owned worker with a stale heartbeat without launching a second supervisor.

  • Harden Linux Herdr server startup with descriptor isolation and bounded failed-start termination/reaping, with regression coverage for ready and never-ready server lifecycles.

  • Extend Claude supervision, helper cleanup, continuation, and Codex max effort contracts, with corresponding documentation and regression updates.

Risk Assessment

✅ Low: The Oracle lifecycle fix is small and preserves fail-closed ownership and readiness checks; the remaining issue is limited to test design.

Testing

Focused lifecycle and executable-interface checks completed. The live Oracle doctor remained fail-closed with a stale probe; the single authorized inheritance rerun exited 64 before execution. No lint or static analysis commands were run per phase constraints.

Evidence: Oracle live validation evidence

Source: Oracle live validation evidence

inherit_rc=64 error: remote job worker did not report ready after startup

Oracle live validation evidence
===============================

Route and code contract
-----------------------
FM_HOME=/Users/computer/firstmate
FM_ROOT_OVERRIDE=/Users/computer/.treehouse/firstmate-110893/2/firstmate
route=fleet-platform
remote registry home=/home/firstmate/homes/fleet-platform
remote registry root=/home/firstmate/src/firstmate

Pre-command official doctor
---------------------------
command: FM_HOME=/Users/computer/firstmate FM_ROOT_OVERRIDE="/Users/computer/.treehouse/firstmate-110893/2/firstmate" bin/fm-on.sh fleet-platform fm-remote-doctor.sh
exit=1
check remote-job-worker=ok: the Linux remote job worker is running
check remote-job-probe=fixable: the remote job worker has not reported a fresh probe
error: this host is not ready for a remote second mate; unresolved: remote-job-probe

Read-only pre-state attempt through the official route
-------------------------------------------------------
command: FM_HOME=/Users/computer/firstmate FM_ROOT_OVERRIDE="/Users/computer/.treehouse/firstmate-110893/2/firstmate" bin/fm-on.sh fleet-platform fm-remote-file.sh get config/trace-context 128
exit=64
error: remote job worker did not report ready after startup
The target file state could not be read because the worker became the blocker.

Authorized exact inheritance command
-------------------------------------
command: FM_HOME=/Users/computer/firstmate FM_ROOT_OVERRIDE="/Users/computer/.treehouse/firstmate-110893/2/firstmate" bin/fm-on.sh fleet-platform fm-remote-inherit.sh absent config/trace-context 0 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 25
exit=64
error: remote job worker did not report ready after startup
The remote command did not reach fm-remote-inherit.sh, so no unchanged result was emitted.

Post-command official doctor
----------------------------
command: FM_HOME=/Users/computer/firstmate FM_ROOT_OVERRIDE="/Users/computer/.treehouse/firstmate-110893/2/firstmate" bin/fm-on.sh fleet-platform fm-remote-doctor.sh
exit=1
check remote-job-worker=ok: the Linux remote job worker is running
check remote-job-probe=fixable: the remote job worker has not reported a fresh probe
error: this host is not ready for a remote second mate; unresolved: remote-job-probe
- Outcome: ⚠️ 1 warning across 2 runs (41m23s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⚠️ **Rebase** - 1 warning

Push main to origin, or rebase your branch onto origin/main, before gating.

🔧 Fix applied.
1 warning still open:

Push main to origin, or rebase your branch onto origin/main, before gating.

⚠️ **Review** - 1 warning
  • ⚠️ tests/fm-brief.test.sh:213 - New assertions here and in the added brief checks at lines 259, 365, 735, and 780 only grep natural-language sentences from generated brief.md; this does not establish agent behavior and violates the supplied test-quality rule. Remove or replace them with executable contract/state/side-effect checks.
⚠️ **Test** - 1 warning
  • ⚠️ The required idempotent fm-remote-inherit.sh absent ... 25 command was not run because it may mutate the external primary remote home, outside this phase's write boundary. Local inheritance and lifecycle tests cover the behavior, but not that live Oracle state. Smallest next step: run the exact command in an authorized environment and capture exit 0 plus unchanged state.
  • FM_HOME=/Users/computer/firstmate FM_ROOT_OVERRIDE="/Users/computer/.treehouse/firstmate-110893/2/firstmate" bin/fm-on.sh fleet-platform fm-remote-doctor.sh
  • bash tests/fm-remote-doctor.test.sh
  • bash tests/fm-on.test.sh
  • bash tests/fm-remote-job.test.sh
  • bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh
  • bash tests/fm-remote-secondmate-trace-context.test.sh
  • bash tests/fm-remote-job-orphan-reap.test.sh

🔧 Fix: Oracle inherit rerun blocked by readiness; state unchanged
1 warning still open:

  • ⚠️ The authorized Oracle inheritance command exited 64 before executing fm-remote-inherit.sh because the remote worker did not become ready. The post-check doctor still reports a stale probe, so exit 0 and unchanged state were not demonstrated.
  • bash tests/fm-remote-doctor.test.sh
  • bash tests/fm-remote-job.test.sh
  • bash tests/fm-on.test.sh
  • bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh
  • bash tests/fm-remote-job-orphan-reap.test.sh
  • Official Oracle doctor check, read-only state probe, authorized inheritance command, and post-check doctor.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

V4f1k added 6 commits August 14, 2026 20:59
* fix: odpojit Linux Herdr server od zděděných deskriptorů

* no-mistakes(review): fix: Zombie-safe liveness predikáty v Linux regresním testu

* no-mistakes(document): Aktualizována dokumentace bounded Herdr startu

* test: počkat na vlastnictví setsid skupiny
* fix(brief): preserve worker decision and evidence contracts

* no-mistakes(review): Fix brief continuation and pipeline-entry contracts

* no-mistakes(review): Fix post-response pipeline driving contract

* no-mistakes(document): Align ask-user guidance with same-turn waiting
* fix(brief): require same-turn helper cleanup

* no-mistakes(document): Align Codex task status documentation
* fix: povol max effort pro Codex

* no-mistakes(document): Konsolidace Codex effort ověření
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Reviews (2): Last reviewed commit: "no-mistakes(document): Document remote w..." | Re-trigger Greptile

@V4f1k
V4f1k force-pushed the fm/oracle-remote-job-worker-probe-fix branch from b5848e4 to a64c772 Compare August 24, 2026 13:38
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