Skip to content

feat(harness): add opt-in local Claude worker runtime - #3724

Closed
o2themar wants to merge 23 commits into
kunchenguid:mainfrom
o2themar:fm/firstmate-local-model-harness
Closed

o2themar wants to merge 23 commits into
kunchenguid:mainfrom
o2themar:fm/firstmate-local-model-harness

Conversation

@o2themar

@o2themar o2themar commented Sep 4, 2026 •

Copy link
Copy Markdown

Intent

Make the captain local model usable as a firstmate worker runtime for explicit, short-context, local work, verified empirically before adapter code rather than assumed. Use the claude CLI against LM Studio at http://127.0.0.1:1234 with model qwen3-coder-next-mlx, and record observed launch, trust, semantic busy or honest unknown, turn-end, interrupt, exit, resume, skill invocation, and end-to-end Anthropic-compatible tool use, marking anything unestablished rather than guessing. Wire only the harness-adapter owners for detection, launch, semantic busy, shared composer classification, control, hooks, model discovery, and verification evidence, without changing existing harness dispatch or duplicating shared classifier shapes. Enforce the captain constraint of local and short-context work only with a bounded launch context and a loud refusal when the harness baseline, brief, or task exceeds usable headroom. Detect both a stopped LM Studio server and an unloaded or evicted model with clear actionable failures instead of silent stalls. Keep claude-local explicit opt-in only, unavailable from static defaults, unavailable for secondmates, and refused for no-mistakes shipping; ordinary shipping behavior must remain unchanged. Provide behavioral tests proving opt-in, context refusal, endpoint and model disappearance diagnostics, and public adapter behavior, with colocated tests and shellcheck-clean scripts. Preserve the empirical conclusion that no supervised local-model turn completed: claude-local is not trustworthy for unattended work, and unestablished turn-end, exit, resume, and skill behavior remain labeled unestablished rather than overstated. Let the no-mistakes pipeline perform the rebase onto current main and land the branch without changing global review timeout configuration or retrying if the review stage again reaches its 30-minute bound.

What Changed

  • Add the opt-in claude-local harness, which launches Claude CLI against a loopback LM Studio endpoint, validates the selected loaded model, and enforces a bounded local-context budget.
  • Integrate the adapter with dispatch validation, shared Claude busy classification, lifecycle control and relaunch safeguards; refuse static-default, secondmate, no-mistakes, non-loopback, unavailable-model, and insufficient-headroom use.
  • Document the empirically established and unestablished runtime behavior, and add coverage for local-model diagnostics, dispatch/control boundaries, watcher handling, and PR-check safety.

Risk Assessment

⚠️ Medium: The implementation is well-contained and its lifecycle safeguards are extensively covered, but an accepted zero timeout can defeat the runtime's bounded failure handling.

Testing

Completed 1 recorded test check.

  • Outcome: ⚠️ 1 error across 3 runs (3h52m32s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

🔧 **Rebase** - 1 issue found → auto-fixed ✅
  • ⚠️ bin/fm-spawn.sh - merge conflict rebasing onto origin/main

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Review** - 1 warning
  • 🚨 bin/fm-spawn.sh:1402 - The raw-alias guard only examines the first non-assignment word. env claude-local --model local-coder (or command claude-local ...) sets HARNESS=env and is accepted as a generic raw launch, then executes claude-local without the canonical endpoint, model, or context-bound template. This contradicts the required “bounded launch context” / claude-local opt-in constraint; broaden the rejection to raw wrapper forms that execute claude-local, or explicitly authorize this escape hatch.

🔧 Fix: Reject wrapped raw claude-local launches
2 errors still open:

  • 🚨 bin/fm-spawn.sh:1405 - Required intent says claude-local must have a “bounded launch context.” The new wrapper guard still accepts effective local launches: env -- LOCAL=1 claude-local --model local-coder breaks at -- and treats LOCAL=1 as the executable, while env -S 'claude-local --model local-coder' is swallowed by the generic -* branch. Both execute raw claude-local without the endpoint/model/context template. Conservatively reject these env forms through the existing refusal path (rather than adding general shell parsing) and exercise them through fm-spawn.
  • 🚨 bin/fm-spawn.sh:1427 - Required intent says claude-local is “explicit opt-in only, unavailable from static defaults.” A configured crew-dispatch default can resolve claude-local and pass it as a concrete positional harness; HARNESS_EXPLICIT=1 then classifies it as explicit. The added adapter reference explicitly codifies the conflicting rule: “only an explicit per-spawn harness or a dispatch profile reaches it.” Deciding whether a dispatch-profile default is an authorized opt-in needs clarification; otherwise preserve selection provenance or reject claude-local from profile defaults.

🔧 Fix: Harden claude-local dispatch safeguards
1 error still open:

  • 🚨 bin/fm-spawn.sh:1428 - The new raw-wrapper guard still misses supported env split-string syntax: env --split-string='claude-local --model local-coder' is consumed by the generic -* branch, so the original raw command is sent to the pane and launches claude-local outside the canonical endpoint/model/context template. Conversely, env -S 'echo claude-local' is rejected just because a later argument contains the substring, changing an ordinary raw launch. This contradicts the required bounded, explicit-only claude-local path; recognize env’s attached/= split-string forms and identify only its effective executable.

🔧 Fix: Parse env split-string claude-local launches
2 issues (1 error, 1 warning) still open:

  • 🚨 bin/fm-spawn.sh:1408 - Required bounded launch context remains bypassable through env’s supported split-string grammar. env -S "X='two words' claude-local --model local-coder" is tokenized by line 1424 into a partial assignment and words'; line 1416 stops before claude-local, so the raw command is accepted and then the shell correctly runs claude-local unbounded. This contradicts the required “bounded launch context”; parse quoted assignment values within env split strings and add this observable refusal case.
  • ⚠️ bin/fm-spawn.sh:1535 - Matched claude-local dispatch profiles are advertised as an allowed opt-in at line 1535, but bootstrap’s shared profile validator still omits it from verified() (bin/fm-bootstrap.sh:1107). A rule profile selecting claude-local is therefore labeled CREW_DISPATCH: invalid ... unverified harness, while the added “matched rule” test merely passes --harness directly and misses the real consumer. Add claude-local to that validator and exercise the validator with a matched profile; static defaults remain refused by fm-spawn.

🔧 Fix: Validate matched claude-local dispatch profiles
1 warning still open:

  • ⚠️ bin/fm-spawn.sh:3453 - After a successful fresh backlog commit, trap - HUP INT TERM restores terminating signal behavior before LOCAL_MODEL_CHECK_PENDING is cleared. A SIGTERM in that window runs the EXIT cleanup, unregistering the watcher even though the task record and delivered worker are preserved; the worker can then silently stall on endpoint/model eviction. Clear the flag after the successful-status check but before restoring those signal traps.

🔧 Fix: Preserve watcher after successful fresh dispatch
2 errors still open:

  • 🚨 bin/fm-spawn.sh:1339 - claude-local launches the same claude fleet worker but omits the two feedback-draft suppressors retained for claude from incoming main commit 3034912. A local worker can therefore offer/create Claude feedback drafts, contrary to the selected rebase requirement to keep that incoming change. Apply CLAUDE_CODE_SEND_FEEDBACK=0 and the feedbackDrafts=off settings argument to this template too.
  • 🚨 bin/fm-spawn.sh:2046 - The required intent says local work only and specifies LM Studio at http://127.0.0.1:1234, but this hunk accepts any FM_LOCAL_MODEL_ENDPOINT and bakes it into the worker launch. For example, FM_LOCAL_MODEL_ENDPOINT=http://remote-host:1234 passes preflight and sends the task brief and tool traffic to that remote server without error. Decide whether remote endpoints are intentionally supported; otherwise enforce the local-only invariant at the shared fm-local-model.sh endpoint boundary (with an explicit test fixture allowance if needed).

🔧 Fix: Confine local-model endpoint to loopback, suppress feedback drafts
4 issues (1 warning, 3 infos) still open:

  • ⚠️ bin/fm-control.sh:814 - The pre-stop claude-local gates in do_relaunch cover kind, model, endpoint/model-loaded, and brief-fits, but not the --mode no-mistakes refusal that fm-spawn gate 3 enforces (bin/fm-spawn.sh:1546). Concrete sequence: a ship task recorded mode=no-mistakes with a live worker; fm-control <id> relaunch --harness claude-local --model local-coder passes fm_control_harness_supports_kind (kind is ship), passes the model gate (--model given), passes the preflight (endpoint healthy) and brief-fits, so fm-control records the note, stops the healthy worker, and only then fm-spawn reads MODE from the record (bin/fm-spawn.sh:1211) and refuses with "not verified for no-mistakes" - leaving no agent running. This is the same ordering hazard the user already ruled closed on the endpoint/model axis and the brief axis, left open on the mode axis; the new relaunch fixture even has to rewrite mode=no-mistakes to direct-PR (tests/fm-control-relaunch.test.sh, add_claude_local_task) to get past it, so the case is unexercised. The remedy is a new pre-stop gate in the control plane reading the recorded mode, which extends the change rather than correcting what it already does, so it needs authorization.
  • ℹ️ bin/fm-control.sh:842 - The pre-stop brief-fits preview always concatenates progress_note_block, but record_note (bin/fm-control.sh:795) returns early when $NOTE is empty, so a relaunch without --note is measured against ~400 bytes (~100 tokens) of boilerplate that will never be appended to the brief. On the reference configuration the allowance is 25% of ~5.5k headroom (~1.4k tokens), so a brief sitting in the top ~7% of the allowance is refused with "instructions plus this progress note exceed the local model's usable headroom" when the launch it predicts would in fact have fit - and there is no note. Gate the preview's note block on [ -n "$NOTE" ] so it measures exactly what record_note will write.
  • ℹ️ bin/fm-bootstrap.sh:1107 - Adding claude-local to the shared verified() list fixes the matched-rule case, but it also makes crew_dispatch_validate report a config whose DEFAULT profile names claude-local as valid, while every spawn that reaches that default is unconditionally refused (bin/fm-spawn.sh:1529 and 1013). The captain therefore gets a clean bootstrap for a configuration that can never dispatch, and the same config additionally turns a bare fm-spawn <id> --relaunch of an existing claude-local task (harness taken from the record, not from config) into a dispatch-default refusal. The smallest honest remedy is a new validator rule that distinguishes default from rule profiles, which extends the change beyond its stated intent and contradicts the standing ruling that only fm-spawn refuses static defaults, so the remedy - not the defect - is what needs authorization.
  • ℹ️ .agents/skills/harness-adapters/references/harness/claude-local.md:46 - "Three findings drive its design" now introduces four bullets: the loopback-host finding was inserted in the latest commit without updating the count. Say "Four findings" (or drop the count) so the reference does not misstate its own contents.

🔧 Fix: Gate claude-local relaunch on recorded mode and provenance
3 issues (1 warning, 2 infos) still open:

  • ⚠️ bin/fm-local-model.sh:115 - endpoint_host() ends the URL authority only at '/', not at '?' or '#', so the loopback confinement added in commit bab0e43 is bypassable. Verified by simulating the parser: ENDPOINT='http://[email protected]' and 'http://evil.example#@127.0.0.1' both yield host '127.0.0.1' and pass require_loopback_endpoint, while curl and Claude Code resolve the authority as evil.example. The value is then baked into the worker's ANTHROPIC_BASE_URL (bin/fm-spawn.sh:3277), so the brief, every file the worker reads, and its whole tool transcript are sent to the remote host with no error - the exact outcome the ruling 'fm-local-model.sh refuses any endpoint whose host is not loopback' required to be impossible. tests/fm-local-model.test.sh covers the userinfo form (http://[email protected]) but neither delimiter. Remedy is a correction inside the existing helper: truncate rest at the first '/', '?', or '#' before the '##*@' userinfo strip, and extend the refused-endpoint table with both forms.
  • ℹ️ bin/fm-spawn.sh:938 - clear_relaunch_harness_wiring runs fm-check-unregister.sh unconditionally when the PRIOR recorded harness is claude-local, and that script removes <id>.check.sh whatever occupies it (bin/fm-check-unregister.sh:48). Concrete reachable sequence: fm-pr-check now refuses a claude-local task while the eviction watcher is registered and tells the operator to run bin/fm-check-unregister.sh <id>; they do, arm the merge poll, and the record still says harness=claude-local. A later bin/fm-spawn.sh &lt;id&gt; --relaunch (a directly reachable entry point - tests/fm-control-relaunch.test.sh:1800 exercises exactly this form) deletes the poll shim, leaving <id>.pr-poll and <id>.pr-poll-registration orphaned and merge detection silently gone, then arms a fresh eviction watcher in the freed slot. fm-control's new pre-stop refusal (bin/fm-control.sh:808) covers only the control-plane path, so the accepted 'make the collision loud, nothing is silently overwritten' ruling does not hold on this one. The smallest honest remedy - retiring only a trust-registered custom check, the narrower retirement a prior round already named as the follow-up - changes shared retirement semantics rather than correcting what this hunk does, so the remedy, not the defect, is what needs authorization.
  • ℹ️ bin/fm-control.sh:846 - The latest commit gates the pre-stop brief preview's progress-note block on [ -z "$NOTE" ], but the preview only runs when RELAUNCH_BRIEF is non-empty, and RELAUNCH_BRIEF is set only in the ship|scout branch (bin/fm-control.sh:826), which dies at line 830 unless --note (or --note-file) supplied a non-empty NOTE. So NOTE is never empty where the guard is evaluated: the added condition is inert, and the accompanying instruction to 'cover a no-note relaunch near the allowance' has no reachable case to test (none was added). No functional risk - the preview still measures exactly what record_note writes - but the round-7 finding it answered rested on a premise the code does not permit, so no behavior actually changed.

🔧 Fix: Terminate endpoint authority and narrow check-slot retirement
2 issues (1 warning, 1 info) still open:

🔧 Fix: Validate endpoint authority shape and order slot conflict check
3 warnings still open:

  • ⚠️ bin/fm-local-model.sh:133 - endpoint_host() treats a scheme-less protocol-relative endpoint as having NO authority and accepts it. Verified by executing the function body: FM_LOCAL_MODEL_ENDPOINT='//evil.example:1234' prints an empty host and returns 0, so require_loopback_endpoint's ''-passes-as-file:// branch admits it. Root cause: ${ENDPOINT#://} is a no-op when the value contains no '://', and ${rest%%/} on a leading '//' then empties the string, so 'no authority' and 'authority the parser could not reach' are indistinguishable. The round-9 ruling for this helper was 'only a clean loopback host (127.0.0.0/8, ::1, localhost) with an optional port passes'; this shape passes without being one, and the refused-endpoint table in tests/fm-local-model.test.sh:370 covers no scheme-less form. This is not proven exfiltration - Node's URL constructor throws on '//host' as a base, so Claude Code fails rather than dialing out - but the whole point of the gate is that the verdict must not depend on each consumer's parser. Remedy is a correction inside the same helper: refuse an ENDPOINT that contains no '://' before the authority is parsed (case "$ENDPOINT" in ://) ;; *) return 1 ;; esac). file:///path still passes, so the file:// catalog fixtures in tests/fm-claude-local-harness.test.sh keep working; a scheme-less 127.0.0.1:1234 would now be refused, which is correct since it is not a usable ANTHROPIC_BASE_URL either. Extend the refused table with '//evil.example:1234'.
  • ⚠️ bin/fm-spawn.sh:938 - local_model_check_slot_is_ours decides ownership of state/<id>.check.sh from the mere PRESENCE of <id>.pr-poll-registration, but bin/fm-check-unregister.sh:48 removes only <id>.check.sh and <id>.check-trust, so that registration can outlive the poll it described. Concrete reachable sequence: a claude-local task has a merge poll in the slot; the new pre-stop gate (bin/fm-spawn.sh:2813) refuses the relaunch with 'could not arm the local-model watcher check for <id>' and names no alternative, so the operator runs the documented bin/fm-check-unregister.sh <id> to free the slot; <id>.pr-poll and <id>.pr-poll-registration are left behind; the relaunch now arms the watcher. From that point local_model_check_slot_is_ours is permanently false for the task, with two wrong outcomes: (a) every later claude-local relaunch is refused at line 2813 even though the slot holds this adapter's own watcher, each one requiring another manual unregister; (b) a relaunch onto a hosted harness (--harness claude, the natural recovery when the local model is gone) reaches clear_relaunch_harness_wiring at line 953, skips the unregister, and leaves the eviction watcher registered for a task no longer using the local endpoint - fm-watch then prints 'blocked: the local model server ... stopped answering' every FM_CHECK_INTERVAL for the rest of the run. bin/fm-control.sh:773 already answers the identical question with fm_pr_poll_artifacts_valid, which returns false in exactly this state (it cmp's check.sh against fm-pr-poll.sh and re-verifies the registration's recorded hashes and identities), and fm-pr-lib.sh is already sourced in fm-spawn. The remedy - replacing the presence test with ! fm_pr_poll_artifacts_valid &#34;$state&#34; &#34;$id&#34; &#34;$SCRIPT_DIR/fm-pr-poll.sh&#34; so both planes share one detector - deviates from the round-8 instruction's literal wording ('detected by a PR-poll registration being present'), so it is the remedy, not the defect, that needs authorization.
  • ⚠️ bin/fm-spawn.sh:805 - In spawn_abort_cleanup the else LOCAL_MODEL_CHECK_PENDING=0 fires whenever clear_relaunch_harness_wiring returns 0, but that function returns 0 both when it retired the watcher and when it SKIPPED the retirement because local_model_check_slot_is_ours was false (line 953). Concrete sequence, reachable via the stale <id>.pr-poll-registration described in the ownership finding: a claude-local relaunch finds the slot empty, arms the watcher (LOCAL_MODEL_CHECK_PENDING=1 at line 990), then aborts before the commit point; clear_relaunch_harness_wiring skips the unregister because the stale registration is present, returns 0, line 805 clears the flag, and the unconditional retirement block at lines 814-821 is skipped - so state/<id>.check.sh and .check-trust stay registered after a relaunch that never produced a worker, the exact orphan class rounds 3-5 were required to make impossible. The flag clear is only an optimization: a second fm-check-unregister after a successful retirement finds no files, rm -f succeeds and it exits 0. Remedy is a correction within the existing flag machinery: drop the else and its assignment (lines 804-805) so the unconditional block always decides retirement, independent of whichever ownership detector clear_relaunch_harness_wiring used. Cover it with an aborted claude-local relaunch that leaves no registered check behind.

🔧 Fix: Require endpoint scheme and share live-poll slot detector
1 warning still open:

  • ⚠️ bin/fm-control.sh:809 - The pre-stop slot gate and the post-stop slot gate test different predicates, so a slot occupant that is neither a valid poll nor this adapter's registered watcher is only discovered after the worker has been stopped. fm-control asks fm_pr_poll_artifacts_valid (line 809); fm-spawn asks check.sh exists &amp;&amp; ! local_model_check_slot_is_ours (bin/fm-spawn.sh:2814), which additionally requires fm_custom_check_registered. Concrete reachable sequence: a claude-local direct-PR task hands its slot over as bin/fm-pr-check.sh documents, so state/<id>.check.sh holds a byte-copy of bin/fm-pr-poll.sh; bin/fm-pr-poll.sh is then changed by an ordinary firstmate update, so cmp -s &#34;$template&#34; &#34;$check&#34; in fm_pr_poll_artifacts_valid (bin/fm-pr-lib.sh:594) fails and the poll reads as invalid. The captain runs fm-control relaunch &lt;id&gt; --note ...: the line-809 gate passes (no valid poll), preflight and brief-fits pass, safe_checkpoint runs, record_note appends, do_exit STOPS the healthy worker - and then fm-spawn refuses at bin/fm-spawn.sh:2814 because check.sh exists and slot_is_ours is false (poll invalid, but no check-trust either), so fm-control dies with 'the replacement agent for <id> could not be launched' and no worker is running. This is exactly the ordering hazard the accepted ruling closed for the poll and endpoint axes, left open for any other occupant of the slot. Remedy: have the pre-stop gate ask the same composite question fm-spawn's gate asks - refuse when state/<id>.check.sh exists and is not this adapter's own registered watcher. fm-control sources fm-pr-lib.sh but NOT fm-check-lib.sh, so the honest fix is to move local_model_check_slot_is_ours into a shared lib (fm-check-lib.sh) and call it from both planes rather than writing a second copy of the predicate. That widens the pre-stop refusal to a new class of state and moves a helper across an owner boundary, so it is the remedy, not the defect, that needs authorization.

  • ⚠️ bin/fm-local-model.sh:195 - FM_LOCAL_MODEL_TIMEOUT is passed directly to curl -m without validation. With FM_LOCAL_MODEL_TIMEOUT=0, curl disables its maximum-time limit, so a reachable but hung LM Studio endpoint can block preflight or the eviction watcher indefinitely—the silent-stall class this adapter is meant to surface. Validate a strictly positive bounded timeout before invoking curl.

⚠️ **Test** - 1 error
  • 🚨 tests failed with exit code 1
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated

🔧 Fix: Classify claude-local harness documentation
1 error still open:

  • 🚨 tests failed with exit code 1

  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated

  • 🚨 tests failed with exit code 1

  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated

✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

…odel

Adds `claude-local`: the verified `claude` CLI pinned to a local
OpenAI/Anthropic-compatible endpoint (LM Studio by default), for short
attended work the captain wants kept on his own machine.

It is deliberately not a second harness implementation. It is the same
binary, so its composer shape, trust dialog, lifecycle hooks, control
family, and semantic busy source stay claude's, reached through the
`claude*` prefix rule bin/fm-control-lib.sh already owns. No adapter
carries a private copy of a shape the shared classifier owns.

bin/fm-local-model.sh is the one owner of endpoint facts. Three verified
findings drive it:

- The endpoint does not honor the model id a request names: a request for
  an unloaded model returned HTTP 200 answered by whatever was loaded. The
  catalog's per-model state is therefore the only identity source, and no
  request can ever report an eviction.
- POST /v1/messages/count_tokens is not implemented, so no exact token
  count exists without spending a full prefill.
- The harness prompt, not the task, dominates the window. One `claude -p`
  turn with a one-sentence prompt sent ~60k tokens of system prompt and
  tool schema - about 96% of the 65,536-token window the reference model
  had loaded, leaving 5,536 tokens of headroom.

The short-context boundary is therefore enforced against that headroom
rather than the window, which alone would be theatre. A window the
harness prompt already fills is refused outright, naming the one action
that fixes it. bin/fm-spawn.sh enforces the rest as hard gates, each
naming its own reason: opt-in only (no home-wide default), crewmate/scout
only, never no-mistakes, an explicit model id, a reachable endpoint with
the model loaded, and a brief inside the headroom.

A stopped server and an evicted model each produce a distinct, actionable
line through `fm-local-model.sh check`, armed as the task's custom
watcher check. Both are otherwise silent: Claude Code retries rather than
exiting, and was observed sitting in a multi-minute backoff with no
request reaching the server at all.

Verification is recorded in docs/verification/runtime-backends.md with
the facts that were established - tool use over the Anthropic endpoint,
the semantic busy source firing, the trust dialog defaulting to "No,
exit", interrupt behaviour - and the ones that were not: turn-end signal,
exit, resume, and skill invocation were never observed, because no
supervised turn ever completed. The honest conclusion, recorded as the
standing boundary, is that claude-local is not trustworthy for unattended
work on the reference configuration.
…discovery

Applies the four findings the review step raised, plus the repo-local
Review-stage timeout raise. The pipeline's own fix rounds were killed twice
by an environment timeout, so these were applied locally between runs while
the branch was user_owned, per the documented between-runs path.

catalog shape is no longer confused with eviction (firstmate-approved).
A body that PARSES but is not shaped like a catalog took the absent-model
path, so `{"data":{}}` reported "the local model is no longer loaded" - a
confidently wrong diagnosis sending an operator to reload a model when the
real fault is that something other than the model server is answering on
that port. catalog_lookup now requires `data` to be a list, so such a body
takes the unreadable-catalog path instead. This is the other half of a
distinction that was previously only built for bodies that fail to parse.

relaunch keeps the exact recorded adapter and its model.
$HARNESS is the control FAMILY, which is correct for interrupt/exit tables
and wiring retirement, but the relaunch PROFILE was also using it. A
recorded claude-local task therefore hit the unreconstructable-alias guard
on an ordinary relaunch, and passing --harness claude-local reset the model
to default because the carry-over compared against the family. Both land on
the wrong side of the transaction: fm-control stops the running agent
before fm-spawn refuses, so the operator loses a live worker and only then
sees an error. The profile now keeps the recorded value whenever it is
itself a verified adapter; only a raw-command basename remains
unreconstructable, which is what that guard was for.

model discovery points at something that lists models.
The required-model refusal told operators to list ids with
`fm-local-model.sh probe`, but probe only confirms the endpoint answers and
prints nothing. Adds a `list` subcommand printing each served id and its
load state, and points the refusal, the absent-model refusal, the script's
Usage block, and the harness reference at it.

lint: quotes the deliberate empty ceiling assignment (ShellCheck SC1007).
The empty value is load-bearing - it proves an absent ceiling falls back to
a real bound rather than reading as unbounded - so only the assignment
form changed.

review_agent_timeout: 30m -> 60m, repo-local only.
Measured on this branch: the Review step recorded 2,236,972 ms (37.3 min),
of which the initial review gated in ~7.3 min and the review-fix turn
consumed the entire remaining 30m0s and was killed while still producing
output 1 second earlier. A healthy fix turn on the preceding run was still
progressing at 630,675 ms (10.5 min) and completed, so the default is
adequate on a responsive machine and fails only when it degrades. 60m is
twice the observed hard cut; the killed turn's true requirement is
unmeasured because it was cut off rather than finished.

Regressions: three wrong-shaped catalog bodies report unreadable and never
eviction, with a contrast case proving a well-formed catalog missing the
model still reports absent so the test cannot go vacuous; and a recorded
claude-local task relaunches with no explicit axes, keeps both, still
resolves to the claude control family, and is still refused for a
secondmate before anything is stopped.
review_agent_timeout is a GLOBAL-config-only key, absent from the repo
config schema entirely, so this override never had any effect. It was added
on the belief that a repo-local raise would take, and the branch then hit the
same 30m review-stage wall with the key committed - which is what exposed it.

Removing it rather than leaving it dormant. The setting carried a detailed
justification comment citing real measurements, and an inert key with a
confident rationale is worse than no key at all: the next reader would
reasonably conclude the bound is raised on this repository when it is not.

The measurements themselves stay useful and are preserved outside this file:
the Review step recorded 2,236,972 ms (37.3 min), of which the initial review
gated in ~7.3 min and the review-fix turn consumed the whole 30m0s bound and
was killed while still producing output; a healthy fix turn on an earlier run
was still progressing at 630,675 ms (10.5 min) and completed. They belong with
the run evidence, not in a setting that does nothing.

Raising this bound requires the global configuration, which is a decision
above this task.
@greptile-apps

greptile-apps Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (4): Last reviewed commit: "no-mistakes(ci): Fixed Greptile’s curren..." | Re-trigger Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Triage (tip 5c5b3e8d014e462c0cd5f5f20f88fcbcb502e8f2): CONFLICTING/DIRTY vs main — I will not rebase. Attestation marker matches this tip (MATCH). Stated intent is explicit opt-in claude-local (no static defaults, refused for secondmates / no-mistakes shipping). Greptile 5/5 on this tip, but the embedded no-mistakes review trail still lists open loopback-endpoint / slot-ownership residuals that need a clear close or captain ruling before this is otherwise-ready.

Contract-class: opt-in (if the launch path stays unreachable without an explicit harness / profile selection). Confirm no static default and no dispatch-profile path that silently selects claude-local without captain intent.

VISION: R6 (fleet outlives vendor / local harness) aligns when truly opt-in; R2 Authority aligns only while defaults stay off; R7 Scope OK as harness adapter.

Waiting on the author (not a captain hold): rebase onto current main to clear conflicts, then land or refute the remaining endpoint-authority and check-slot findings. I will not resolve conflicts from here while those residuals and the conflict itself remain. No CI to approve until the PR is mergeable again.

@o2themar
o2themar force-pushed the fm/firstmate-local-model-harness branch from 5c5b3e8 to 332cefa Compare September 4, 2026 18:34
@o2themar o2themar changed the title feat: add claude-local worker runtime feat(harness): add opt-in local Claude worker runtime Sep 4, 2026
…l` now rejects an occupied custom-check slot before stopping a claude-local worker, matching fm-spawn’s admission rule; added behavioral regression coverage. Focused test, ShellCheck (with project baseline exclusions), syntax checks, and diff check passed
…_TIMEOUT now must be a positive integer before dispatch, preventing curl -m 0 from disabling endpoint deadlines. Added behavioral coverage for zero/malformed timeout refusal and bounded default fallback. Verified with bash tests/fm-local-model.test.sh, ShellCheck, bash -n, and git diff --check. CI and Require no-mistakes are not currently reported on the PR; their supplied failures appear stale/superseded
@o2themar

Copy link
Copy Markdown
Author

Closing: the local runtime is no longer wanted. The PR's own evidence left turn-end, exit, resume and skill invocation unestablished, so it is not being carried forward.

@o2themar
o2themar deleted the fm/firstmate-local-model-harness branch September 29, 2026 22:52
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.

2 participants