Skip to content

feat(bin): finish the cline harness adapter and raise grok's reasoning-effort ceiling - #7

Merged
adibirzu merged 6 commits into
mainfrom
fm/fm-cline-harness-integration
Aug 16, 2026
Merged

adibirzu merged 6 commits into
mainfrom
fm/fm-cline-harness-integration

Conversation

@adibirzu

Copy link
Copy Markdown
Owner

Intent

Finish the cline harness adapter in firstmate, then re-verify the cursor and grok adapters end to end. All gaps below were measured live by supervising real cline crewmates; they are observations, not theory.

Gap 1 - cline crewmates launched into Plan mode and never implemented. A cline crewmate spent 47,000 tokens reading and reasoning without writing a line. Requirement: a firstmate-spawned cline crewmate starts in Act mode deterministically, using a launch-time mechanism, and WITHOUT mutating the captain's own ~/.cline configuration, which his interactive cline session uses. Established during the work and accepted: the brief's premise was that globalState.json's mode = plan wins; on cline 3.0.55 the actual authority is planActMode in the settings file, and the machine carried the two disagreeing (globalState mode=plan, settings planActMode=act) while the TUI started in Act. There is no --act flag (-p/--plan only selects Plan), so the mechanism chosen is redirecting CLINE_GLOBAL_SETTINGS_PATH at a firstmate-owned per-task settings copy that forces act and carries the operator's other keys (telemetry, auto-update) across. That variable redirects only that one file, so credentials and provider config still resolve from the operator's own store. Deliberate: the spawn refuses rather than launching when operator settings exist but cannot be carried over faithfully, so a crewmate never silently starts in plan mode and the operator's telemetry choice is never silently reset.

Gap 2 - firstmate could not control a cline worker at all. fm-control refused cline outright as having no verified control mechanics. That refusal was correct behaviour for an unverified adapter: the fix is to verify the mechanics and register them, NEVER to loosen the refusal. Requirement: fm-control.sh interrupt|exit|relaunch works against a real cline worker with mechanics registered in the executable control plane rather than guessed. Verified live on 3.0.55: Esc cancels the turn, a single Ctrl+C EXITS the TUI (so Ctrl+C must never be used to interrupt), and Esc leaves the composer on its idle placeholder rather than restoring the cancelled prompt, so no composer clear key is recorded. cline is the first verified adapter with NO composer exit command at all, so the exit mechanism is tabled as a separate exit-KEY table beside the existing exit-command table rather than overloading one string - required because cline's exit key is grok's interrupt key. A second, distinct refusal was found during the work and fixed: cline runs as a bundled Node script reporting a bare node, so a live cline pane classified ambiguous and every lifecycle verb refused the endpoint as unattributable. Its identity is its install path, so cline joined the shared exact-executable-name list; that rule matches an exact cline path COMPONENT, never a substring, so an unrelated node process stays unattributed rather than being claimed as an agent.

Gap 3 - firstmate could not read a cline worker's state; fm-crew-state.sh returned unknown, so supervision was blind and a genuinely wedged worker went unnoticed. Requirement: fm-crew-state.sh reports a real busy or idle state for a live cline worker. A rendered-tail signature was explicitly the weakest acceptable source; a structural source was preferred, more than one independent signal was required so no single vendor string is load-bearing, and detecting the queued-but-unprocessed state was requested because that is the failure that actually bit. Implemented as a pull source folding cline's own per-session record (structural, not rendered), bound to the pane by a sidecar, with two independent signals: the record's status field, and, for the ambiguous idle, the turn log's last message role - which is what separates a finished turn from one accepted and never processed. Deliberate: the record's pid is NOT used for binding because it is the shared cline hub daemon's pid, verified live; binding is on workspace_root plus pre-existing-session exclusion. Deliberate: jq is required and its absence reports unknown rather than falling back to a formatting-dependent text read, because every unresolvable outcome must be unknown, never idle.

Also required and delivered: for every harness-dependent check added or changed, TWO tests - a portable regression in tests/ that pins the logic with no harness present, and a live opt-in guard in the live-harness-optin family that exercises the real installed harness and fails naming harness and version, refusing to pass when it checked nothing. Both cline and grok live guards run green against the real binaries. The harness-adapters skill is updated with what was verified, dated, patching existing language rather than appending a second description.

Re-verification of the other two adapters, as requested. grok: real drift found and corrected - the reasoning-effort ceiling moved, 0.2.99 rejected xhigh while 1.0.4 accepts it, so firstmate was silently downgrading tasks; max is still rejected and stays omitted. Re-verified unchanged and now pinned: the headless single-turn surface, the no-pty failure being an OS device error that names no credential problem (a test-harness artifact that must never be mistaken for an auth fault), and quota-axi resolving no grok quota window at all while grok auth reads usable - the pairing the credit selector must not price. The selector already handled that correctly, so the regression pins existing behaviour rather than changing it. cursor: recorded facts confirmed unchanged against the live catalog and account; the stale Grok-ladder claim had already been corrected by earlier work and was re-confirmed, not re-appended.

Scope boundaries the captain set and confirmed, which must not be treated as omissions: do not restructure the control plane, the busy library or the spawn path beyond what these gaps require; do not add a new harness; and never weaken a fail-closed refusal to make something pass - the refusals are correct and the fix is always to supply verified facts.

Explicitly excluded by the captain after being measured and reported, and filed as separate work (fm-composer-bare-row-idle) with instructions not to touch it: cline's composer has full-width rules but no side borders, so the shared screen classifier takes the bare-row path where an idle placeholder is deliberately not trusted, and a genuinely idle cline composer therefore reads pending. This is pre-existing on an unmodified baseline, Cursor's cursorless reclassification does not transfer because cline first resolves to the pi separated shape, and a submit that starts a turn is still confirmed by the submit core's busy fallback, so it should bite only when a delivered message starts no turn - most plausibly a ClinePass quota refusal. It is recorded with its measurements in the verification doc and the skill rather than fixed, because correcting it would change the one fleet-wide classifier's conservatism for every harness and every backend.

Also observed and documented rather than fixed: nothing surfaces a ClinePass quota limit, so a quota-blocked cline worker renders identically to one that finished a turn - the panel scrolls away and the pane returns to an ordinary idle composer - and quota-axi has no cline provider at all, which is also why cline is correctly absent from the credit selector's routable providers.

Known pre-existing and NOT introduced by this change, confirmed identical on the branch base and owned by another worker's in-flight branch (fm-restore-main-ci), which the captain instructed to leave alone: bin/fm-lint.sh exits non-zero on two SC2034 warnings (bin/fm-composer-lib.sh FM_COMPOSER_BARE_PROMPT_RE_DEFAULT, tests/fm-backend.test.sh archive), and the fm-spawn-capacity, fm-backend and fm-muse-harness suites fail identically on the base. This fork's GitHub Actions genuinely run but main has been red since 1 August, so a red CI result may not belong to this change.

What Changed

  • Completed the cline adapter across spawn, control, and busy state: fm-spawn.sh now writes a firstmate-owned <id>.cline-settings.json (operator settings carried over via jq, planActMode forced to act) that the launch points CLINE_GLOBAL_SETTINGS_PATH at, plus a <id>.cline-session sidecar binding the pane to cline's own session record by workspace_root and pre-existing-session exclusion — and it refuses to launch rather than dropping operator settings; both files are retired by fm-teardown.sh. fm-control-lib.sh registers cline's verified mechanics (Escape interrupt, no composer clear key) and adds a separate fm_control_exit_key table so fm-control.sh sends C-c to exit, refusing when the backend cannot deliver that exact key or when neither an exit command nor key is verified. fm-busy-lib.sh adds a structural cline-session pull source folding the record's status plus the turn log's last message role — reporting cline-session-stalled for a queued-but-unprocessed turn and unknown (never idle) for every unresolvable case, including missing jq; the herdr native-busy arm now falls through to that source once the staleness bound fires instead of returning unknown native-stale. fm-session-lock-lib.sh adds cline to the exact-executable-name list so a bundled-Node cline pane is attributable instead of ambiguous, and fm-composer-lib.sh adds cline's plan-mode idle placeholder.
  • Raised grok's --reasoning-effort ceiling in fm-spawn.sh from high to xhigh (verified accepted on grok 1.0.4, rejected on 0.2.99); max stays omitted as still-rejected.
  • Added portable regression coverage in tests/fm-cline-harness.test.sh, fm-control.test.sh, fm-crew-state.test.sh, fm-dispatch-select.test.sh, fm-teardown.test.sh, fm-watch-busy-staleness.test.sh, and fm-grok-harness.test.sh, plus two new live opt-in guards (tests/fm-cline-signals-live-e2e.test.sh, tests/fm-grok-signals-live-e2e.test.sh) registered in the live-harness-optin family in fm-test-run.sh. Docs and the harness-adapters skill record the verified facts, the process-identity rule, and the known idle-composer pending limitation (filed separately as fm-composer-bare-row-idle, not fixed here).

Risk Assessment

✅ Low: All previously reported defects are verifiably fixed in the current code with behavioural regressions that fail against the pre-fix implementation, the one shared-classifier change is provably scoped to cline alone by fm_busy_native_bounded and pinned by an anti-widening test, and the only surviving findings are two inaccurate comments with no behavioural effect.

Testing

I ran 13 targeted portable suites (all green) and then proved the intent the way an operator would experience it: a real cline 3.0.55 crewmate spawned by fm-spawn.sh into a real tmux pane, driven through fm-crew-state.sh and fm-control.sh. That run shows the TUI footer rendering ○ Plan ● Act (Tab), the crewmate writing ACT_PROOF.txt instead of analysing forever, state: working · source: pane · harness busy (cline-session) where the old adapter said unknown, interrupt-delivered … verified=agent-alive with the composer back on its idle placeholder, stopped … harness=cline against a live busy agent with the worktree preserved, and the operator's ~/.cline settings byte-identical throughout. Both live opt-in guards run green against the real binaries, and cursor's recorded facts were re-checked against the live catalog and account. The relaunch verb could not be demonstrated: fm-control passes fm-spawn a --relaunch flag that does not exist, which stops the agent and then fails to replace it - I confirmed this fails identically on the branch base and with harness=claude, so it is pre-existing and harness-agnostic rather than something this change broke. No screenshot artifact applies here: every changed surface is a shell CLI or a vendor terminal TUI, so the reviewer-visible evidence is verbatim CLI transcripts including the rendered pane rows captured via tmux capture-pane. One nuance worth knowing: for an idle cline worker fm-crew-state renders unknown · none rather than an explicit idle, which is the deliberate fall-through the shipped portable test pins and the commit documents, and the busy side - the wedged-worker failure that actually bit - now reports correctly.

Evidence: Live CLI transcript: fm-spawn -> Act mode -> fm-crew-state busy -> fm-control interrupt (real cline 3.0.55)

Source: Live CLI transcript: fm-spawn -> Act mode -> fm-crew-state busy -> fm-control interrupt (real cline 3.0.55)

=== $ fm-spawn.sh cline-act-demo <project> cline --mode local-only --yolo off === spawned cline-act-demo harness=cline kind=ship mode=local-only yolo=off window=firstmate:fm-cline-act-demo worktree=/Users/adrianb/.treehouse/project-c6f6e2/1/project === firstmate-owned settings copy the launch redirects CLINE_GLOBAL_SETTINGS_PATH at === {"autoUpdateEnabled":true,"telemetryOptOut":false,"planActMode":"act"} === waiting for the real cline TUI to render its mode footer === kimi-k3 (medium) (0) $0.00 ○ Plan ● Act (Tab) === $ fm-crew-state.sh cline-act-demo (while the crewmate works) === state: working · source: pane · harness busy (cline-session) === $ fm-control.sh cline-act-demo interrupt === interrupt-delivered cline-act-demo harness=cline backend=tmux verified=agent-alive cancel=unconfirmed interrupt exit=0 --- pane composer row after interrupt --- ❯ Ask anything... === the operator's own ~/.cline settings after the whole run === before=2948635118 84 after =2948635118 84 UNCHANGED (byte-identical)


=== operator's own cline settings BEFORE (cksum) and its recorded planActMode ===
2948635118 84
{"planActMode":"act","telemetrySetting":null}

=== $ fm-spawn.sh cline-act-demo <project> cline --mode local-only --yolo off ===
notice: cline-act-demo ships mode=local-only while the standing posture for project is no-mistakes - less rigor than the captain's standing posture; proceed only on a current explicit captain instruction or an intake judgment you can state
spawned cline-act-demo harness=cline kind=ship mode=local-only yolo=off window=firstmate:fm-cline-act-demo worktree=/Users/adrianb/.treehouse/project-c6f6e2/1/project
spawn exit=0

=== firstmate-owned settings copy the launch redirects CLINE_GLOBAL_SETTINGS_PATH at ===
{"autoUpdateEnabled":true,"telemetryOptOut":false,"planActMode":"act"}

=== waiting for the real cline TUI to render its mode footer ===
 kimi-k3 (medium) (0) $0.00                                  ○ Plan ● Act (Tab)

=== $ fm-crew-state.sh cline-act-demo   (while the crewmate works) ===
state: working · source: pane · harness busy (cline-session)

=== waiting for the crewmate to actually IMPLEMENT (Act mode writes the file) ===
NO FILE WRITTEN

=== structural mode cline itself recorded for this pane's session ===

=== $ fm-crew-state.sh cline-act-demo   (after the turn finishes) ===
state: unknown · source: none · no current-state source available

=== submitting a long second turn, then interrupting it through the control plane ===
$ fm-crew-state.sh cline-act-demo
state: working · source: pane · harness busy (cline-session)

=== $ fm-control.sh cline-act-demo interrupt ===
interrupt-delivered cline-act-demo harness=cline backend=tmux verified=agent-alive cancel=unconfirmed
interrupt exit=0

=== $ fm-crew-state.sh cline-act-demo   (after interrupt) ===
state: unknown · source: none · no current-state source available
--- pane composer row after interrupt ---
❯ Ask anything...

=== $ fm-control.sh cline-act-demo relaunch --note ... ===
error: ship spawns require --mode <no-mistakes|direct-PR|local-only>; resolve it at intake from the captain's instruction and the project's registered posture in data/projects.md
error: the replacement agent for cline-act-demo could not be launched on cline
error: cline-act-demo's agent was stopped but the replacement did not launch; no agent is running, and its work plus the recorded progress note are preserved at /Users/adrianb/.treehouse/project-c6f6e2/1/project
relaunch exit=1

=== $ fm-control.sh cline-act-demo exit ===
already-stopped cline-act-demo harness=cline backend=tmux endpoint=firstmate:fm-cline-act-demo worktree=/Users/adrianb/.treehouse/project-c6f6e2/1/project
exit verb exit=0
--- pane command after exit ---
zsh

=== the operator's own ~/.cline settings after the whole run ===
before=2948635118 84
after =2948635118 84
UNCHANGED (byte-identical)
{"planActMode":"act"}
Evidence: Live CLI transcript: fm-control exit against a live, busy cline worker

Source: Live CLI transcript: fm-control exit against a live, busy cline worker

=== relaunching the recorded worker command by hand (fm-control relaunch is broken pre-existing) === kimi-k3 (medium) (0) $0.00 ○ Plan ● Act (Tab) === $ fm-control.sh cline-act-demo exit (against the live, busy agent) === stopped cline-act-demo harness=cline backend=tmux endpoint=firstmate:fm-cline-act-demo worktree=/Users/adrianb/.treehouse/project-c6f6e2/1/project exit verb rc=0 === endpoint after exit: the worktree and its work are preserved, the agent is gone === pane command: zsh worktree still holds the crewmate's work: ACT_PROOF.txt ACT-MODE-OK


=== relaunching the recorded worker command by hand (fm-control relaunch is broken pre-existing) ===
$ CLINE_GLOBAL_SETTINGS_PATH=/var/folders/j8/ztw_4_wx3691gww5x_1n9r4c0000gn/T/fm-cline-cli-demo.Dr5yVj/home/state/cline-act-demo.cline-settings.json cline -i --tui --auto-approve true
                                                                   kimi-k3 (medium) (0) $0.00                      ○ Plan ● Act (Tab)

=== $ fm-crew-state.sh cline-act-demo   (idle worker, no turn in flight) ===
state: unknown · source: none · no current-state source available

=== submitting a long turn so exit has to interrupt a BUSY agent first ===
$ fm-crew-state.sh cline-act-demo
state: unknown · source: pane · harness state unavailable (unknown cline-session)

=== $ fm-control.sh cline-act-demo exit   (against the live, busy agent) ===
stopped cline-act-demo harness=cline backend=tmux endpoint=firstmate:fm-cline-act-demo worktree=/Users/adrianb/.treehouse/project-c6f6e2/1/project
exit verb rc=0

=== endpoint after exit: the worktree and its work are preserved, the agent is gone ===
pane command: zsh
worktree still holds the crewmate's work:
ACT_PROOF.txt
ACT-MODE-OK

=== $ fm-crew-state.sh cline-act-demo   (after exit) ===
state: unknown · source: pane · harness state unavailable (unknown cline-session)
Evidence: Act-mode proof: the file the cline crewmate actually wrote

Source: Act-mode proof: the file the cline crewmate actually wrote

worktree: /Users/adrianb/.treehouse/project-c6f6e2/1/project -rw-r--r--@ 1 adrianb staff 12 Aug 16 09:47 ACT_PROOF.txt ACT_PROOF.txt (written by the firstmate-spawned cline crewmate): ACT-MODE-OK

worktree: /Users/adrianb/.treehouse/project-c6f6e2/1/project
total 16
drwxr-xr-x@ 4 adrianb  staff  128 Aug 16 09:47 .
drwxr-xr-x@ 3 adrianb  staff   96 Aug 16 09:47 ..
-rw-r--r--@ 1 adrianb  staff  121 Aug 16 09:47 .git
-rw-r--r--@ 1 adrianb  staff   12 Aug 16 09:47 ACT_PROOF.txt

ACT_PROOF.txt (written by the firstmate-spawned cline crewmate):
ACT-MODE-OK
Evidence: Live cline drift guard (cline 3.0.55)

Source: Live cline drift guard (cline 3.0.55)

ok - cline 3.0.55: a persisted plan mode still governs the TUI start mode (the gap reproduces) ok - cline 3.0.55: cline's recorded exit key exits the real TUI cleanly ok - cline 3.0.55: the act-mode settings redirect starts the real TUI in act mode ok - cline 3.0.55: a live cline pane is positively attributed as a running agent ok - cline 3.0.55: the real cline pane binds to exactly one of its own session records ok - cline 3.0.55: the real session record structurally confirms the crewmate ran in act mode ok - cline 3.0.55: cline's real session record classifies busy in flight ok - cline 3.0.55: cline's recorded interrupt key cancels the turn without polluting the composer ok - cline 3.0.55: cline's real session record leaves busy once the turn is cancelled ok - cline 3.0.55: the operator's own cline settings are byte-identical after a forced-act run ALL PASS: fm-cline-signals-live-e2e (cline 3.0.55)

ok - cline 3.0.55: a persisted plan mode still governs the TUI start mode (the gap reproduces)
ok - cline 3.0.55: cline's recorded exit key exits the real TUI cleanly
ok - cline 3.0.55: the act-mode settings redirect starts the real TUI in act mode
ok - cline 3.0.55: a live cline pane is positively attributed as a running agent
ok - cline 3.0.55: the real cline pane binds to exactly one of its own session records
ok - cline 3.0.55: the real session record structurally confirms the crewmate ran in act mode
ok - cline 3.0.55: cline's real session record classifies busy in flight
ok - cline 3.0.55: cline's recorded interrupt key cancels the turn without polluting the composer
ok - cline 3.0.55: cline's real session record leaves busy once the turn is cancelled
ok - cline 3.0.55: the operator's own cline settings are byte-identical after a forced-act run
ALL PASS: fm-cline-signals-live-e2e (cline 3.0.55)
Evidence: Live grok drift guard (grok 1.0.4) - the xhigh ceiling move

Source: Live grok drift guard (grok 1.0.4) - the xhigh ceiling move

ok - grok 1.0.4 (d846eb93d94d) [stable]: grok's accepted effort vocabulary is still low|medium|high|xhigh with no max ok - grok 1.0.4: grok answers a real headless single turn at the highest effort firstmate passes ok - grok 1.0.4: grok's no-pty failure is an OS device error and names no credential problem ok - grok 1.0.4: quota-axi still resolves no grok quota window, so grok stays unpriceable ok - grok 1.0.4: grok's native model listing surface still answers ALL PASS: fm-grok-signals-live-e2e (grok grok 1.0.4 (d846eb93d94d) [stable])

ok - grok grok 1.0.4 (d846eb93d94d) [stable]: grok's accepted effort vocabulary is still low|medium|high|xhigh with no max
ok - grok grok 1.0.4 (d846eb93d94d) [stable]: grok answers a real headless single turn at the highest effort firstmate passes
ok - grok grok 1.0.4 (d846eb93d94d) [stable]: grok's no-pty failure is an OS device error and names no credential problem
ok - grok grok 1.0.4 (d846eb93d94d) [stable]: quota-axi still resolves no grok quota window, so grok stays unpriceable
ok - grok grok 1.0.4 (d846eb93d94d) [stable]: grok's native model listing surface still answers
ALL PASS: fm-grok-signals-live-e2e (grok grok 1.0.4 (d846eb93d94d) [stable])
Evidence: Cursor live re-verification (catalog + account)

Source: Cursor live re-verification (catalog + account)

$ cursor-agent --version 2026.08.11-e8db854 (matches the recorded row exactly) $ cursor-agent status ✓ Logged in as [email protected] $ cursor-agent --list-models (the documented ladder, still present) cursor-grok-4.6-low / -low-fast / -medium / -medium-fast / -high / -high-fast / -xhigh / -xhigh-fast cursor-grok-4.5-low / -low-fast / -medium / -medium-fast / -high / -high-fast

$ cursor-agent --version
2026.08.11-e8db854

$ cursor-agent status   (live account)
✓ Logged in as [email protected]

$ cursor-agent --list-models   (live catalog for this account)
Available models

auto - Auto (default)
gpt-5.3-codex-low - Codex 5.3 Low
gpt-5.3-codex-low-fast - Codex 5.3 Low Fast
gpt-5.3-codex - Codex 5.3
gpt-5.3-codex-fast - Codex 5.3 Fast
gpt-5.3-codex-high - Codex 5.3 High
gpt-5.3-codex-high-fast - Codex 5.3 High Fast
gpt-5.3-codex-xhigh - Codex 5.3 Extra High
gpt-5.3-codex-xhigh-fast - Codex 5.3 Extra High Fast
gpt-5.2 - GPT-5.2
cursor-grok-4.6-high-fast - Cursor Grok 4.6 Fast
composer-2.5 - Composer 2.5
claude-opus-5-thinking-high - Opus 5 1M Thinking
claude-opus-5-thinking-high-fast - Opus 5 1M Thinking Fast
gpt-5.6-sol-high - GPT-5.6 Sol 1M High
gpt-5.6-sol-high-fast - GPT-5.6 Sol High Fast
gpt-5.6-sol-xhigh - GPT-5.6 Sol 1M Extra High
gpt-5.6-sol-xhigh-fast - GPT-5.6 Sol Extra High Fast
claude-fable-5-thinking-high - Fable 5 1M Thinking (NO ZDR)
claude-fable-5-thinking-xhigh - Fable 5 1M Extra High Thinking (NO ZDR)
cursor-grok-4.5-high - Cursor Grok 4.5
cursor-grok-4.5-high-fast - Cursor Grok 4.5 Fast
gemini-3.7-flash-high - Gemini 3.7 Flash
claude-sonnet-5-thinking-high - Sonnet 5 1M Thinking
claude-sonnet-5-thinking-xhigh - Sonnet 5 1M Extra High Thinking
gpt-5.6-luna-high - GPT-5.6 Luna 1M High
cursor-grok-4.6-low - Cursor Grok 4.6 Low
cursor-grok-4.6-low-fast - Cursor Grok 4.6 Low Fast
cursor-grok-4.6-medium - Cursor Grok 4.6 Medium
cursor-grok-4.6-medium-fast - Cursor Grok 4.6 Medium Fast
cursor-grok-4.6-high - Cursor Grok 4.6
cursor-grok-4.6-xhigh - Cursor Grok 4.6 Extra High
cursor-grok-4.6-xhigh-fast - Cursor Grok 4.6 Extra High Fast
composer-2.5-fast - Composer 2.5 Fast
claude-opus-5-low - Opus 5 1M Low
claude-opus-5-low-fast - Opus 5 1M Low Fast
claude-opus-5-medium - Opus 5 1M Medium
claude-opus-5-medium-fast - Opus 5 1M Medium Fast
claude-opus-5-high - Opus 5 1M
claude-opus-5-high-fast - Opus 5 1M Fast
claude-opus-5-thinking-low - Opus 5 1M Low Thinking
claude-opus-5-thinking-low-fast - Opus 5 1M Low Thinking Fast
claude-opus-5-thinking-medium - Opus 5 1M Medium Thinking
claude-opus-5-thinking-medium-fast - Opus 5 1M Medium Thinking Fast
claude-opus-5-thinking-xhigh - Opus 5 1M Extra High Thinking
claude-opus-5-thinking-xhigh-fast - Opus 5 1M Extra High Thinking Fast
claude-opus-5-thinking-max - Opus 5 1M Max Thinking
claude-opus-5-thinking-max-fast - Opus 5 1M Max Thinking Fast
claude-opus-4-8-low - Opus 4.8 1M Low
claude-opus-4-8-low-fast - Opus 4.8 1M Low Fast
claude-opus-4-8-medium - Opus 4.8 1M Medium
claude-opus-4-8-medium-fast - Opus 4.8 1M Medium Fast
claude-opus-4-8-high - Opus 4.8 1M
claude-opus-4-8-high-fast - Opus 4.8 1M Fast
claude-opus-4-8-xhigh - Opus 4.8 1M Extra High
claude-opus-4-8-xhigh-fast - Opus 4.8 1M Extra High Fast
claude-opus-4-8-max - Opus 4.8 1M Max
claude-opus-4-8-max-fast - Opus 4.8 1M Max Fast
claude-opus-4-8-thinking-low - Opus 4.8 1M Low Thinking
claude-opus-4-8-thinking-low-fast - Opus 4.8 1M Low Thinking Fast
claude-opus-4-8-thinking-medium - Opus 4.8 1M Medium Thinking
claude-opus-4-8-thinking-medium-fast - Opus 4.8 1M Medium Thinking Fast
claude-opus-4-8-thinking-high - Opus 4.8 1M Thinking
claude-opus-4-8-thinking-high-fast - Opus 4.8 1M Thinking Fast
claude-opus-4-8-thinking-xhigh - Opus 4.8 1M Extra High Thinking
claude-opus-4-8-thinking-xhigh-fast - Opus 4.8 1M Extra High Thinking Fast
claude-opus-4-8-thinking-max - Opus 4.8 1M Max Thinking
claude-opus-4-8-thinking-max-fast - Opus 4.8 1M Max Thinking Fast
gpt-5.6-sol-none - GPT-5.6 Sol 1M None
gpt-5.6-sol-none-fast - GPT-5.6 Sol None Fast
gpt-5.6-sol-low - GPT-5.6 Sol 1M Low
gpt-5.6-sol-low-fast - GPT-5.6 Sol Low Fast
gpt-5.6-sol-medium - GPT-5.6 Sol 1M
gpt-5.6-sol-medium-fast - GPT-5.6 Sol Fast
gpt-5.6-sol-max - GPT-5.6 Sol 1M Max
gpt-5.6-sol-max-fast - GPT-5.6 Sol Max Fast
gpt-5.5-none - GPT-5.5 1M None
gpt-5.5-none-fast - GPT-5.5 None Fast
gpt-5.5-low - GPT-5.5 1M Low
gpt-5.5-low-fast - GPT-5.5 Low Fast
gpt-5.5-medium - GPT-5.5 1M
gpt-5.5-medium-fast - GPT-5.5 Fast
gpt-5.5-high - GPT-5.5 1M High
gpt-5.5-high-fast - GPT-5.5 High Fast
gpt-5.5-extra-high - GPT-5.5 1M Extra High
gpt-5.5-extra-high-fast - GPT-5.5 Extra High Fast
claude-fable-5-low - Fable 5 1M Low (NO ZDR)
claude-fable-5-medium - Fable 5 1M Medium (NO ZDR)
claude-fable-5-high - Fable 5 1M (NO ZDR)
claude-fable-5-xhigh - Fable 5 1M Extra High (NO ZDR)
claude-fable-5-max - Fable 5 1M Max (NO ZDR)
claude-fable-5-thinking-low - Fable 5 1M Low Thinking (NO ZDR)
claude-fable-5-thinking-medium - Fable 5 1M Medium Thinking (NO ZDR)
claude-fable-5-thinking-max - Fable 5 1M Max Thinking (NO ZDR)
cursor-grok-4.5-low - Cursor Grok 4.5 Low
cursor-grok-4.5-low-fast - Cursor Grok 4.5 Low Fast
cursor-grok-4.5-medium - Cursor Grok 4.5 Medium
cursor-grok-4.5-medium-fast - Cursor Grok 4.5 Medium Fast
gemini-3.7-flash-low - Gemini 3.7 Flash Low
gemini-3.7-flash-medium - Gemini 3.7 Flash Medium
gpt-5.6-terra-none - GPT-5.6 Terra 1M None
gpt-5.6-terra-none-fast - GPT-5.6 Terra None Fast
gpt-5.6-terra-low - GPT-5.6 Terra 1M Low
gpt-5.6-terra-low-fast - GPT-5.6 Terra Low Fast
gpt-5.6-terra-medium - GPT-5.6 Terra 1M
gpt-5.6-terra-medium-fast - GPT-5.6 Terra Fast
gpt-5.6-terra-high - GPT-5.6 Terra 1M High
gpt-5.6-terra-high-fast - GPT-5.6 Terra High Fast
gpt-5.6-terra-xhigh - GPT-5.6 Terra 1M Extra High
gpt-5.6-terra-xhigh-fast - GPT-5.6 Terra Extra High Fast
gpt-5.6-terra-max - GPT-5.6 Terra 1M Max
gpt-5.6-terra-max-fast - GPT-5.6 Terra Max Fast
claude-sonnet-5-low - Sonnet 5 1M Low
claude-sonnet-5-medium - Sonnet 5 1M Medium
claude-sonnet-5-high - Sonnet 5 1M
claude-sonnet-5-xhigh - Sonnet 5 1M Extra High
claude-sonnet-5-max - Sonnet 5 1M Max
claude-sonnet-5-thinking-low - Sonnet 5 1M Low Thinking
claude-sonnet-5-thinking-medium - Sonnet 5 1M Medium Thinking
claude-sonnet-5-thinking-max - Sonnet 5 1M Max Thinking
claude-4.6-sonnet-medium - Sonnet 4.6 1M
claude-4.6-sonnet-medium-thinking - Sonnet 4.6 1M Thinking
claude-opus-4-7-low - Opus 4.7 1M Low
claude-opus-4-7-low-fast - Opus 4.7 1M Low Fast
claude-opus-4-7-medium - Opus 4.7 1M Medium
claude-opus-4-7-medium-fast - Opus 4.7 1M Medium Fast
claude-opus-4-7-high - Opus 4.7 1M High
claude-opus-4-7-high-fast - Opus 4.7 1M High Fast
claude-opus-4-7-xhigh - Opus 4.7 1M
claude-opus-4-7-xhigh-fast - Opus 4.7 1M Fast
claude-opus-4-7-max - Opus 4.7 1M Max
claude-opus-4-7-max-fast - Opus 4.7 1M Max Fast
claude-opus-4-7-thinking-low - Opus 4.7 1M Low Thinking
claude-opus-4-7-thinking-low-fast - Opus 4.7 1M Low Thinking Fast
claude-opus-4-7-thinking-medium - Opus 4.7 1M Medium Thinking
claude-opus-4-7-thinking-medium-fast - Opus 4.7 1M Medium Thinking Fast
claude-opus-4-7-thinking-high - Opus 4.7 1M High Thinking
claude-opus-4-7-thinking-high-fast - Opus 4.7 1M High Thinking Fast
claude-opus-4-7-thinking-xhigh - Opus 4.7 1M Thinking
claude-opus-4-7-thinking-xhigh-fast - Opus 4.7 1M Thinking Fast
claude-opus-4-7-thinking-max - Opus 4.7 1M Max Thinking
claude-opus-4-7-thinking-max-fast - Opus 4.7 1M Max Thinking Fast
gpt-5.4-low - GPT-5.4 1M Low
gpt-5.4-medium - GPT-5.4 1M
gpt-5.4-medium-fast - GPT-5.4 Fast
gpt-5.4-high - GPT-5.4 1M High
gpt-5.4-high-fast - GPT-5.4 High Fast
gpt-5.4-xhigh - GPT-5.4 1M Extra High
gpt-5.4-xhigh-fast - GPT-5.4 Extra High Fast
claude-4.6-opus-high - Opus 4.6 1M
claude-4.6-opus-max - Opus 4.6 1M Max
claude-4.6-opus-high-thinking - Opus 4.6 1M Thinking
claude-4.6-opus-max-thinking - Opus 4.6 1M Max Thinking
claude-4.5-opus-high - Opus 4.5
claude-4.5-opus-high-thinking - Opus 4.5 Thinking
gpt-5.2-low - GPT-5.2 Low
gpt-5.2-low-fast - GPT-5.2 Low Fast
gpt-5.2-fast - GPT-5.2 Fast
gpt-5.2-high - GPT-5.2 High
gpt-5.2-high-fast - GPT-5.2 High Fast
gpt-5.2-xhigh - GPT-5.2 Extra High
gpt-5.2-xhigh-fast - GPT-5.2 Extra High Fast
gpt-5.6-luna-none - GPT-5.6 Luna 1M None
gpt-5.6-luna-none-fast - GPT-5.6 Luna None Fast
gpt-5.6-luna-low - GPT-5.6 Luna 1M Low
gpt-5.6-luna-low-fast - GPT-5.6 Luna Low Fast
gpt-5.6-luna-medium - GPT-5.6 Luna 1M
gpt-5.6-luna-medium-fast - GPT-5.6 Luna Fast
gpt-5.6-luna-high-fast - GPT-5.6 Luna High Fast
gpt-5.6-luna-xhigh - GPT-5.6 Luna 1M Extra High
gpt-5.6-luna-xhigh-fast - GPT-5.6 Luna Extra High Fast
gpt-5.6-luna-max - GPT-5.6 Luna 1M Max
gpt-5.6-luna-max-fast - GPT-5.6 Luna Max Fast
gemini-3.6-flash-minimal - Gemini 3.6 Flash Minimal
gemini-3.6-flash-low - Gemini 3.6 Flash Low
gemini-3.6-flash-medium - Gemini 3.6 Flash Medium
gemini-3.6-flash-high - Gemini 3.6 Flash
gemini-3.1-pro - Gemini 3.1 Pro
gpt-5.4-mini-none - GPT-5.4 Mini None
gpt-5.4-mini-low - GPT-5.4 Mini Low
gpt-5.4-mini-medium - GPT-5.4 Mini
gpt-5.4-mini-high - GPT-5.4 Mini High
gpt-5.4-mini-xhigh - GPT-5.4 Mini Extra High
gpt-5.4-nano-none - GPT-5.4 Nano None
gpt-5.4-nano-low - GPT-5.4 Nano Low
gpt-5.4-nano-medium - GPT-5.4 Nano
gpt-5.4-nano-high - GPT-5.4 Nano High
gpt-5.4-nano-xhigh - GPT-5.4 Nano Extra High
claude-4.5-sonnet - Sonnet 4.5
claude-4.5-sonnet-thinking - Sonnet 4.5 Thinking
gpt-5.1-low - GPT-5.1 Low
gpt-5.1 - GPT-5.1
gpt-5.1-high - GPT-5.1 High
gemini-3-flash - Gemini 3 Flash
gemini-3.5-flash - Gemini 3.5 Flash
claude-4-sonnet - Sonnet 4
claude-4-sonnet-thinking - Sonnet 4 Thinking
gpt-5-mini - GPT-5 Mini
kimi-k3-low - Kimi K3 Low
kimi-k3-high - Kimi K3 High
kimi-k3-max - Kimi K3
kimi-k2.7-code - Kimi K2.7 Code
glm-5.2-high - GLM 5.2
glm-5.2-max - GLM 5.2 Max

Tip: use --model <id> (or /model <id> in interactive mode) to switch. Parameterized models also accept quoted overrides, e.g. --model 'claude-opus-4-8[context=1m,effort=high,fast=false]'.
Evidence: Manual verification scripts used to produce the live transcripts

Source: Manual verification scripts used to produce the live transcripts

#!/usr/bin/env bash
# Manual end-to-end verification of the user intent, driven through the REAL
# user-facing CLIs against a REAL cline crewmate:
#   Gap 1  fm-spawn.sh launches a cline crewmate that starts in Act mode and
#          actually implements (writes a file), without touching ~/.cline.
#   Gap 2  fm-control.sh <task> interrupt|relaunch|exit acts on that worker.
#   Gap 3  fm-crew-state.sh <task> reports a real busy/idle state for it.
set -u
ROOT=${1:?repo root}
EV=${2:?evidence dir}
REAL_TMUX=$(command -v tmux)
CLINE_BIN=$(command -v cline)
SOCKET="fm-cli-demo-$$"
LAB=$(mktemp -d "${TMPDIR:-/tmp}/fm-cline-cli-demo.XXXXXX")
ID=cline-act-demo
HOME_DIR="$LAB/home"; PROJ="$LAB/project"; WT="$LAB/wt"

cleanup() { "$REAL_TMUX" -L "$SOCKET" kill-server >/dev/null 2>&1 || true; }
trap cleanup EXIT
say() { printf '\n=== %s ===\n' "$*"; }
capture() { "$REAL_TMUX" -L "$SOCKET" capture-pane -p -t "firstmate:fm-$ID" 2>/dev/null || true; }

OPERATOR_SETTINGS="$HOME/.cline/data/settings/global-settings.json"
OP_BEFORE=$(cksum < "$OPERATOR_SETTINGS")
say "operator's own cline settings BEFORE (cksum) and its recorded planActMode"
printf '%s\n' "$OP_BEFORE"
jq -c '{planActMode, telemetrySetting: (.telemetrySetting // null)}' "$OPERATOR_SETTINGS"

# tmux shim: every firstmate CLI below talks to this isolated lab server.
mkdir -p "$LAB/bin"
cat > "$LAB/bin/tmux" <<SH
#!/usr/bin/env bash
exec "$REAL_TMUX" -L "$SOCKET" "\$@"
SH
chmod +x "$LAB/bin/tmux"

mkdir -p "$HOME_DIR/data/$ID" "$HOME_DIR/projects" "$HOME_DIR/state" "$HOME_DIR/config" "$PROJ"
git -C "$PROJ" init -q; git -C "$PROJ" commit -q --allow-empty -m init
git -C "$PROJ" worktree add --quiet -b "fm/$ID" "$WT"
touch "$HOME_DIR/state/.last-watcher-beat"
cat > "$HOME_DIR/data/$ID/brief.md" <<'BRIEF'
Create a file named ACT_PROOF.txt in the repository root whose only content is
the single line ACT-MODE-OK. Do not ask any questions. Do not plan. Just make
the change, then stop.

Delivery contract: mode=local-only yolo=off
BRIEF

export PATH="$LAB/bin:$PATH"
unset TMUX
FM_ENV=(FM_ROOT_OVERRIDE="" FM_HOME="$HOME_DIR" FM_STATE_OVERRIDE="$HOME_DIR/state"
        FM_DATA_OVERRIDE="$HOME_DIR/data" FM_PROJECTS_OVERRIDE="$HOME_DIR/projects"
        FM_CONFIG_OVERRIDE="$HOME_DIR/config" FM_SPAWN_NO_GUARD=1
        FM_GATE_REFUSE_BYPASS=1)

say "\$ fm-spawn.sh $ID <project> cline --mode local-only --yolo off"
env "${FM_ENV[@]}" "$ROOT/bin/fm-spawn.sh" "$ID" "$PROJ" cline --mode local-only --yolo off 2>&1
SPAWN_RC=$?
echo "spawn exit=$SPAWN_RC"
[ "$SPAWN_RC" = 0 ] || { echo "SPAWN FAILED"; exit 1; }

say "firstmate-owned settings copy the launch redirects CLINE_GLOBAL_SETTINGS_PATH at"
jq -c . "$HOME_DIR/state/$ID.cline-settings.json"

say "waiting for the real cline TUI to render its mode footer"
for _ in $(seq 1 200); do capture | grep -qE '(●|○) Plan' && break; sleep 0.3; done
capture | grep -aE 'Plan .*Act' | tail -2

say "\$ fm-crew-state.sh $ID   (while the crewmate works)"
for _ in $(seq 1 300); do
  OUT=$(env "${FM_ENV[@]}" "$ROOT/bin/fm-crew-state.sh" "$ID" 2>&1)
  case "$OUT" in *"state: working"*) break ;; esac
  sleep 0.3
done
printf '%s\n' "$OUT"

say "waiting for the crewmate to actually IMPLEMENT (Act mode writes the file)"
for _ in $(seq 1 400); do [ -f "$WT/ACT_PROOF.txt" ] && break; sleep 0.5; done
if [ -f "$WT/ACT_PROOF.txt" ]; then
  echo "ACT_PROOF.txt written by the crewmate:"; cat "$WT/ACT_PROOF.txt"
  git -C "$WT" status --porcelain
else
  echo "NO FILE WRITTEN"
fi

say "structural mode cline itself recorded for this pane's session"
SESS=$(grep '^sessions_root=' "$HOME_DIR/state/$ID.cline-session" | cut -d= -f2-)
REC=$(grep -rl "$WT" "$SESS"/*/ 2>/dev/null | grep -v messages | tail -1)
jq -c '{session_id, status, mode: .metadata.mode}' "$REC" 2>/dev/null

say "\$ fm-crew-state.sh $ID   (after the turn finishes)"
for _ in $(seq 1 200); do
  OUT=$(env "${FM_ENV[@]}" "$ROOT/bin/fm-crew-state.sh" "$ID" 2>&1)
  case "$OUT" in *"state: working"*) sleep 0.5 ;; *) break ;; esac
done
printf '%s\n' "$OUT"

say "submitting a long second turn, then interrupting it through the control plane"
"$REAL_TMUX" -L "$SOCKET" send-keys -t "firstmate:fm-$ID" \
  "Count slowly from 1 to 60, writing one short line per number. Do not use tools." 
sleep 1
"$REAL_TMUX" -L "$SOCKET" send-keys -t "firstmate:fm-$ID" Enter
for _ in $(seq 1 300); do
  OUT=$(env "${FM_ENV[@]}" "$ROOT/bin/fm-crew-state.sh" "$ID" 2>&1)
  case "$OUT" in *"state: working"*) break ;; esac
  sleep 0.3
done
echo "\$ fm-crew-state.sh $ID"; printf '%s\n' "$OUT"

say "\$ fm-control.sh $ID interrupt"
env "${FM_ENV[@]}" "$ROOT/bin/fm-control.sh" "$ID" interrupt 2>&1; echo "interrupt exit=$?"

say "\$ fm-crew-state.sh $ID   (after interrupt)"
for _ in $(seq 1 100); do
  OUT=$(env "${FM_ENV[@]}" "$ROOT/bin/fm-crew-state.sh" "$ID" 2>&1)
  case "$OUT" in *"state: working"*) sleep 0.5 ;; *) break ;; esac
done
printf '%s\n' "$OUT"
echo "--- pane composer row after interrupt ---"
capture | grep -a '❯' | tail -1

say "\$ fm-control.sh $ID relaunch --note ..."
env "${FM_ENV[@]}" "$ROOT/bin/fm-control.sh" "$ID" relaunch --note "live re-verification of the cline adapter" 2>&1
echo "relaunch exit=$?"
sleep 5
capture | grep -aE 'Plan .*Act' | tail -1

say "\$ fm-control.sh $ID exit"
env "${FM_ENV[@]}" "$ROOT/bin/fm-control.sh" "$ID" exit 2>&1; echo "exit verb exit=$?"
echo "--- pane command after exit ---"
"$REAL_TMUX" -L "$SOCKET" display -p -t "firstmate:fm-$ID" '#{pane_current_command}' 2>&1 || echo "(window gone)"

say "the operator's own ~/.cline settings after the whole run"
AFTER=$(cksum < "$OPERATOR_SETTINGS")
printf 'before=%s\nafter =%s\n' "$OP_BEFORE" "$AFTER"
[ "$OP_BEFORE" = "$AFTER" ] && echo "UNCHANGED (byte-identical)" || echo "CHANGED"
jq -c '{planActMode}' "$OPERATOR_SETTINGS"
Evidence: Pre-existing relaunch failure, reproduced on the branch base (8b22be8)
$ git archive 8b22be8 | tar -x -C $BASE && cd $BASE && ./bin/fm-test-run.sh tests/fm-control-relaunch.test.sh
not ok - a same-harness relaunch should succeed
error: ship spawns require --mode <no-mistakes|direct-PR|local-only>; ...
error: the replacement agent for rl1 could not be launched on claude
error: rl1's agent was stopped but the replacement did not launch; no agent is running
FM_TEST_SUMMARY total=1 failed=1

(identical failure on the branch head; cause: bin/fm-control.sh:831 passes --relaunch, bin/fm-spawn.sh:297 only defines --reuse-worktree)
- Outcome: ⚠️ 2 issues (1 warning, 1 info) across 1 run (42m47s)

Pipeline

Updates from git push no-mistakes

... (6 earlier update rounds omitted to keep the PR body within GitHub's 65536-char limit; full history is in the run log.)

⚠️ **Review** - 2 infos

Failure scenario: an operator runs fm-control.sh t1 relaunch --harness cline. do_exit succeeds and the agent is stopped, then the spawn fails and fm-control dies with 'the replacement agent for t1 could not be launched on cline', leaving the task with no agent on a live worktree pending rollback.

This contradicts the intent's required criterion: 'fm-control.sh <task> interrupt|exit|relaunch works against a real cline worker with mechanics registered in the executable control plane rather than guessed.' interrupt and exit were live-verified and do work; relaunch is broken for every harness on this branch. Because the call site belongs to a different in-flight workstream's rename, the right fix (change --relaunch to --reuse-worktree, drop the now-redundant --harness/positional shape mismatch if any, and add a happy-path relaunch case that asserts the spawn argv) is an ownership decision rather than a mechanical one.

  • ⚠️ bin/fm-spawn.sh:2463 - The cline spawn arm creates two new per-task state files - state/&lt;id&gt;.cline-settings.json (bin/fm-spawn.sh:2444) and state/&lt;id&gt;.cline-session (bin/fm-spawn.sh:2463) - but bin/fm-teardown.sh was not extended to remove them. Its explicit removal list at bin/fm-teardown.sh:2585-2589 names .muse-session, .muse-session-current and .cursor-session (the two structurally identical pull-source sidecars) plus every other per-task token, and the secondmate-child cleanup at bin/fm-teardown.sh:2279-2282 does the same; neither mentions cline. There is no wildcard cleanup - the list is enumerated.

Failure scenario: spawn a cline crew task, let it finish, run fm-teardown.sh &lt;id&gt;. state/&lt;id&gt;.meta and every other artifact is removed, but state/&lt;id&gt;.cline-session and state/&lt;id&gt;.cline-settings.json remain in the state directory forever. Every cline task the operator ever runs leaves two more orphaned files, one of which is a verbatim copy of the operator's cline global settings, retained indefinitely after the task it was made for no longer exists. fm_control_harness_wiring_paths already tables both paths for cline (bin/fm-control-lib.sh:253-261) but that function has no production caller, so it does not cover this.

Fix: add &#34;$STATE/$ID.cline-session&#34; &#34;$STATE/$ID.cline-settings.json&#34; to the teardown rm -f list (and the sub_state equivalent), matching the muse/cursor sidecar treatment.

  • ⚠️ bin/fm-busy-lib.sh:885 - fm_busy_cline_matching_sessions iterates every directory under cline's sessions root and calls fm_busy_cline_session_workspace on each, which forks a separate jq per record (bin/fm-busy-lib.sh:870-877, 885-897). The scan covers the machine's ENTIRE cline session history, not just this task's workspace, because the workspace filter is what the jq call computes. It runs on every fm_busy_classify for a cline task, which is the hot supervision path: bin/fm-watch.sh:217 and bin/fm-supervise-daemon.sh:631 call it once per task per poll, and bin/fm-crew-state.sh:168 on every state read.

Failure scenario: an operator with a few hundred accumulated cline sessions (one per interactive run, never pruned by firstmate) supervising two cline crewmates pays several hundred jq process spawns per watch tick per task - hundreds of milliseconds to seconds of CPU on each poll, growing monotonically with cline usage and never shrinking.

The two sibling pull sources avoid this: muse resolves its whole matching set in ONE node invocation (bin/fm-busy-lib.sh:332-336), and cursor's per-dir fork is sed over a set bounded by distinct workspaces rather than by launches (bin/fm-busy-lib.sh:647-660). Fix without changing the fold's semantics: resolve the whole set in a single jq pass over the candidate records (for example jq -r &#39;select(.workspace_root == $w) | input_filename&#39; --arg w &#34;$want&#34; &#34;$root&#34;/*/*.json), keeping the exact-match rule and the jq-absent-means-unknown guarantee intact.

  • ℹ️ tests/fm-cline-harness.test.sh:230 - Four cases in the cline suite prove nothing by executing anything - they grep implementation source bytes: test_existing_launch_templates_untouched (line 230, greps bin/fm-spawn.sh for two template fragments), test_cline_is_a_known_bare_adapter_name (greps for the literal |kimi|cline), test_cline_model_and_effort_flags (greps for |kimi|cline and &#39;--thinking %s &#39;), and test_cline_detection_wired (greps bin/fm-harness.sh for *cline*) echo cline; return ;;). test_shared_idle_default_covers_cline also greps each backend source for FM_BACKEND_*_IDLE_RE=.*FM_COMPOSER_IDLE_RE_DEFAULT.

All five are pre-existing (they came in with the original cline adapter commit, not this change), and this change moved in the right direction: it DELETED the worst of them (test_cline_launch_template_is_pinned) and replaced it with real spawn scaffolding that captures what fm-spawn hands the backend off a fake tmux. Recording it only because that scaffolding now exists in the same file and makes the remaining greps cheap to convert: a behavior-preserving refactor of the launch template or the harness allowlist would fail these while the adapter still works, and conversely a template that no longer reaches a pane would pass them. run_cline_spawn + $home/launch.log already gives the executable assertion for the launch, model, and effort cases.

🔧 Fix: clean up cline sidecars, batch session scan, drop source greps
3 issues (1 warning, 2 infos) still open:

  • ⚠️ bin/fm-busy-lib.sh:1124 - On the herdr backend the new cline-session structural source is unreachable, so Gap 3's "real busy or idle state for a live cline worker" is not delivered there.

fm_busy_classify consults the herdr native arm first (bin/fm-busy-lib.sh:1093) and returns from it unconditionally: busy -> printf &#39;busy herdr-native&#39;; return 0, or, once fm_busy_native_bounded cline plus fm_busy_native_stale fire, printf &#39;unknown native-stale&#39;; return 0 (line 1098). The cline*) arm at line 1124 is only reached when herdr's native probe is NOT busy. But this branch's own sibling test states the measured fact: "Herdr ... has NO cline integration, so its agent_status for a cline pane is a guess that sticks at 'working' forever" (tests/fm-watch-busy-staleness.test.sh:6-10). If it sticks at busy forever, the cline arm never runs on herdr at all.

Concrete sequence: dispatch a cline crewmate on herdr (config/crew-harness=cline), let it run a turn. For the first FM_BUSY_NATIVE_MAX_SECONDS (default 120) supervision reports busy herdr-native - herdr's guess, true or false - and from then on unknown native-stale permanently, while state/&lt;id&gt;.cline-session and the bound record hold the answer (running -> busy, completed -> idle, or the idle + trailing role: user wedge -> stalled). A worker that finished 20 minutes ago and one genuinely wedged mid-turn both read unknown, which is the exact blindness Gap 3 was opened for.

This is reachable on the path the change's own doc names as the closing acceptance: docs/verification/cline-adapter.md:296-301 records the remaining acceptance as "a full live crewmate dispatch through the herdr backend ... observing the supervisor drive ready-gate -> brief-inject -> busy -> turn-end". The live guard that proved the fold works (tests/fm-cline-signals-live-e2e.test.sh) runs on raw tmux, where the arm is reached, so the gap is invisible to it.

The code comment at line 1125-1128 justifies the ordering as "two independent signals either of which can carry a positive busy verdict, and losing one does not blind the classifier". That reasoning holds for an adapter herdr actually integrates with; for cline the native signal carries no information by herdr's own admission, so putting it first makes the informative source dead code and the stale guard blinds the classifier rather than degrading it.

The earliest shared boundary that would make the invariant hold is the same one cursor* already uses: resolve cline's structural fold before the herdr native arm (the cursor*) case sits in the pre-record case at line 1010), or gate the herdr native arm on the harnesses herdr actually integrates with - fm_busy_native_bounded already enumerates cline as the exception. Flagged rather than fixed because the ordering is explicitly deliberate in the comment and changing it changes classifier precedence for a shipped backend.

  • ℹ️ tests/fm-cline-harness.test.sh:306 - The max-effort half of test_cline_model_and_effort_flags has no positive anchor, so it can pass while proving nothing.

assert_no_grep is ! grep -F -- &#34;$1&#34; &#34;$2&#34; &gt;/dev/null || fail (tests/lib.sh:331), and grep on an empty or absent file exits 1, so the assertion succeeds. The flags-max case (line 301-307) runs the spawn, checks expect_code 0, then only asserts the ABSENCE of --thinking in $home/launch.log. The fake tmux exits 0 for every subcommand and only appends to the launch log on a send-keys -l (tests/fm-cline-harness.test.sh:62-71), so a change that stopped delivering the launch through send-keys -l - a different delivery verb, a renamed placeholder, a backend switch - would leave the log empty, keep the spawn's exit status 0, and let this case pass green while nothing was launched.

The sibling flags case (line 293-300) is anchored by its two positive assert_greps, so this is specific to the max branch. Add a positive anchor before the negative assertion, e.g. assert_grep &#34;cline -i --tui&#34; &#34;$home/launch.log&#34; &#34;cline max-effort launch did not reach the pane&#34;, matching what test_cline_is_a_known_bare_adapter_name already asserts off the same log.

  • ℹ️ bin/fm-busy-lib.sh:910 - The batched session scan's process bound holds only while every record on the machine parses. xargs -0 jq ... aborts on the first unparseable record, and any non-zero status discards matched entirely and re-runs the whole candidate set through the per-record fm_busy_cline_session_workspace loop (line 917-921), one jq fork per accumulated session - the original cost plus one extra process. I confirmed the exit-status plumbing works as intended (a missing/corrupt file in the list yields rc!=0 and the fallback fires) and that input_filename reports the correct file per match on jq 1.7.1, so the happy path is sound.

The residual point is that a single permanently corrupt record - a cline session killed mid-write leaves a truncated JSON, and nothing prunes the sessions root - restores the per-fork cost on every supervision tick (bin/fm-watch.sh, bin/fm-supervise-daemon.sh, bin/fm-crew-state.sh) until the operator finds and deletes it. The comment at lines 891-899 documents this tradeoff explicitly and it is the right correctness call: one corrupt unrelated record must skip only itself, which test_a_corrupt_unrelated_session_does_not_blind_the_scan pins. Recording it only so the bound is not read as unconditional; no change required.

🔧 Fix: reach cline structural fold on herdr, anchor max-effort case
2 infos still open:

  • ℹ️ docs/verification/cline-adapter.md:292 - The verification record's owners table states tests/fm-cline-harness.test.sh | 24 portable behavior checks (all green), but the suite now runs 35 test functions with 35 pass assertions. The count was already wrong when the row landed (29 at commit a6bbaa0) and the fix rounds added four more cases (corrupt-scan, unrelated-node detection, and the two herdr handoff regressions). This is a verification doc whose stated purpose is that every value is a capture rather than a guess, so a number that is off by eleven undercuts exactly the property the file exists to carry. Either update the count or drop the number and name the coverage instead, since it will drift again on the next added case.
  • ℹ️ tests/fm-cline-signals-live-e2e.test.sh:12 - The guard's header claims "It never writes anything under it: the only files this creates are the lab's own settings copies and workspace", where "it" is the operator's cline data directory. That is not accurate: the guard launches the real binary with the operator's HOME and only CLINE_GLOBAL_SETTINGS_PATH redirected, so cline writes a fresh session record under $CLINE_DATA_ROOT/sessions/&lt;new-id&gt;/ for the lab workspace on each of the two launches, and the guard depends on that (line ~205 resolves fm_busy_cline_session_record against CLINE_SESSIONS_ROOT). Those records are never removed by cleanup, which only kills the tmux server and deletes $LAB. Concretely: each opt-in run of the guard leaves two more permanent session directories under the operator's ~/.cline/data/sessions/, pointing at a /tmp workspace that no longer exists, and they are then part of the whole-history set the supervision-path scan walks on every poll. The actual safety claim the guard does enforce - the operator's global-settings.json is byte-identical afterwards, measured with cksum - is correct and unaffected. Correct the comment to say the redirected settings file is what is never written, and note that running the real binary necessarily leaves session records behind (or reap the two lab sessions in cleanup).
⚠️ **Test** - 2 issues (1 warning, 1 info)
  • ⚠️ bin/fm-control.sh:831 - fm-control.sh &lt;task&gt; relaunch stops the running agent and then fails to launch its replacement, leaving the task with no agent. It invokes bin/fm-spawn.sh &lt;id&gt; --relaunch --harness &lt;name&gt; (bin/fm-control.sh:831), but fm-spawn defines no --relaunch flag (the real flag is --reuse-worktree, bin/fm-spawn.sh:297), so --relaunch falls into the positional bucket, becomes the project-dir argument, and spawn dies with error: ship spawns require --mode .... Reproduced live against a real cline worker (relaunch exit=1, no agent is running) and by tests/fm-control-relaunch.test.sh, which fails on a same-harness relaunch should succeed. VERIFIED PRE-EXISTING: an identical run against a clean checkout of base commit 8b22be8 fails the same way with harness=claude, so this change did not introduce it and it is harness-agnostic. Flagging it because the user intent names relaunch as a required verb for a cline worker, and this suite is not in the intent's list of known-red suites (fm-spawn-capacity, fm-backend, fm-muse-harness) - so the captain should decide whether it belongs to the in-flight fm-restore-main-ci branch or needs its own work. I did not fix it: it is out of this change's stated scope ("do not restructure the control plane beyond what these gaps require") and is product code, not a test defect.
  • ℹ️ Testing left artifacts outside the worktree that I could not delete (rm was denied by the permission layer). The git worktree itself is clean - nothing here can be committed or pushed. To remove: rm -rf ~/.treehouse/project-c6f6e2 /tmp/fm-cline-act-demo /var/folders/j8/ztw_4_wx3691gww5x_1n9r4c0000gn/T/fm-cline-cli-demo.* /var/folders/j8/ztw_4_wx3691gww5x_1n9r4c0000gn/T/fm-cline-exit.* /var/folders/j8/ztw_4_wx3691gww5x_1n9r4c0000gn/T/fm-base.xJCFb5. All lab tmux servers are already dead (only stale socket files remain) and no test-spawned agent survives. The live runs also left ordinary cline session records under ~/.cline/data/sessions, which is normal vendor state and exactly what the repo's own live guard produces.
  • ./bin/fm-test-run.sh tests/fm-cline-harness.test.sh tests/fm-control.test.sh tests/fm-crew-state.test.sh tests/fm-grok-harness.test.sh tests/fm-dispatch-select.test.sh tests/fm-teardown.test.sh tests/fm-watch-busy-staleness.test.sh - 7 suites, 0 failed
  • ./bin/fm-test-run.sh tests/fm-busy-state.test.sh tests/fm-busy-adapter-wiring.test.sh tests/fm-composer-lib.test.sh tests/fm-session-lock-ancestry.test.sh tests/fm-tmux-agent-liveness.test.sh tests/fm-cursor-harness.test.sh - 6 suites, 0 failed
  • FM_CLINE_SIGNALS_LIVE=1 ./tests/fm-cline-signals-live-e2e.test.sh - 10 live assertions green against real cline 3.0.55 (plan-mode gap reproduces, act redirect works, live pane positively attributed, session record binds and classifies busy in flight, Escape cancels the turn without polluting the composer, Ctrl+C exits, operator settings byte-identical)
  • FM_GROK_SIGNALS_LIVE=1 ./tests/fm-grok-signals-live-e2e.test.sh - 5 live assertions green against real grok 1.0.4 (effort vocabulary low|medium|high|xhigh with no max, real headless xhigh turn answers, no-pty failure is an OS device error naming no credential problem, quota-axi resolves no grok window, model listing answers)
  • Manual live end-to-end through the real user-facing CLIs: bin/fm-spawn.sh cline-act-demo &lt;project&gt; cline --mode local-only --yolo off -> real cline crewmate in a real tmux pane -> bin/fm-crew-state.sh cline-act-demo -> bin/fm-control.sh cline-act-demo interrupt -> bin/fm-control.sh cline-act-demo exit (script: live-cline-cli-demo.sh / live-cline-exit-demo.sh in the evidence dir)
  • Verified the crewmate implemented rather than planned: cat ~/.treehouse/project-c6f6e2/1/project/ACT_PROOF.txt -> ACT-MODE-OK, plus jq -c . state/cline-act-demo.cline-settings.json -> {&#34;autoUpdateEnabled&#34;:true,&#34;telemetryOptOut&#34;:false,&#34;planActMode&#34;:&#34;act&#34;}
  • Verified the operator's own config was never written: cksum &lt; ~/.cline/data/settings/global-settings.json before and after the whole run (2948635118 84 both times)
  • cursor-agent --version, cursor-agent status, cursor-agent --list-models - live re-verification of the cursor row's catalog and account claims
  • ./bin/fm-test-run.sh tests/fm-control-relaunch.test.sh on the branch AND on a clean git archive checkout of base commit 8b22be8 - identical failure, establishing the relaunch defect as pre-existing
⚠️ **Document** - 1 info
  • ⚠️ docs/configuration.md:264 - docs/configuration.md "Harness support" carries two overlapping and disagreeing statements of the same fact: line 258 says claude, codex, opencode, pi, pi-signed, grok, kimi, and cursor are verified for crewmate and secondmate launches (with cline and copilot crewmate-only), while line 264 says only claude, codex, opencode, pi, pi-signed, grok, and kimi are, and names agy as the crewmate-only adapter. Both are pre-existing (identical on the branch base) and this change did not touch either, so consolidating them into one owner sentence is out of scope here; it is worth a follow-up because a reader picking the second sentence would conclude cursor cannot run as a secondmate.
  • ℹ️ docs/calm-mode-feasibility.md:306 - docs/calm-mode-feasibility.md records captured transcript lines reading FM_TEST_SUMMARY_FAMILY family=live-harness-optin count=7; this change adds two members to that family, so the count no longer matches a run today. Left unchanged deliberately: those are dated maintainer-verification captures of exact past output, and rewriting recorded output would falsify the evidence rather than correct a fact. Flagging only so the discrepancy is not later mistaken for drift.

🔧 Fix: consolidate harness crewmate/secondmate split in docs/configuration.md
1 info still open:

  • ℹ️ AGENTS.md:193 - Follow-up proposal, not fixed here. AGENTS.md states the crewmate-only restriction twice within three lines: line 192's verified-adapter list already carries "plus muse for crewmates and scouts only and agy for crewmate launches only", and line 193 repeats "agy is verified for crewmate launches only, and a --secondmate spawn refuses it". That list is also incomplete against the executable owner: bin/fm-spawn.sh refuses a --secondmate launch for cline and copilot too (secondmate_harness_unsupported, bin/fm-spawn.sh:658-666 and the backstop at 1099-1105), yet AGENTS.md names cline, cursor-agent, and copilot with no spawn-scope qualifier, so an agent reading only line 192 could dispatch a cline or copilot secondmate and hit the refusal. Both lines are pre-existing and identical on the branch base - this change touched only AGENTS.md's state-file inventory (the .cline-session and .cline-settings.json entries), not the adapter list - so correcting the owner list is outside this change's staleness scope and outside the captain's ruled scope for this round, which named docs/configuration.md only. Raising it as one finding rather than editing, per the out-of-scope-consolidation rule.
⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

…ource

Three gaps measured live while supervising real cline crewmates, all fixed by
supplying verified facts rather than by loosening any refusal.

Act mode: cline's TUI start mode follows the persisted planActMode in its
global settings file, not the documented act-by-default, so a crewmate silently
inherited the operator's plan mode and analysed without implementing. There is
no --act flag, so the launch now redirects CLINE_GLOBAL_SETTINGS_PATH at a
firstmate-owned copy that forces act and carries the operator's other choices
over. The operator's own ~/.cline is never written.

Control plane: cline was refused outright because it had no registered
mechanics. It is now registered with its own verified keys - Escape cancels the
turn, Ctrl+C EXITS - which is the exact inverse of grok. cline is also the first
adapter with no composer exit command at all, so the exit mechanism is tabled as
a key alongside the existing command table rather than overloading one string.

Busy state: cline reported unknown, leaving supervision blind. It now folds
cline's own per-session record, a structural source rather than a rendered tail.
Two independent signals back it: the record's status field, and the turn log's
last message role, which is what separates a finished turn from one that was
accepted and never processed - the wedge that renders identically to a healthy
idle pane. The recorded pid is deliberately unused for binding; it is the shared
hub daemon's, not the pane's.

Also teaches the shared composer classifier cline's plan-mode placeholder, so an
operator's own plan-mode pane reads as an empty composer rather than pending
input that away-mode supervision would refuse to deliver into.
…was re-verified

grok's accepted effort vocabulary moved between installed versions. 0.2.99
rejected xhigh and max alike; 1.0.4's own refusal names `xhigh, high, medium,
low`, and a real single-turn prompt at xhigh answers cleanly. firstmate was
still omitting xhigh, silently downgrading a task the captain asked for the
strongest reasoning on. max is still rejected and stays omitted.

Adds live drift guards for both adapters. They read each vocabulary from the
harness's own refusal rather than a remembered list, exercise the real binary,
and fail naming the harness and version. Both refuse to pass when they checked
nothing.

Re-verified and unchanged, now pinned rather than remembered: grok's headless
single-turn surface; its no-pty failure being an OS device error that names no
credential problem, so a harness artifact is never read as an auth fault; and
quota-axi resolving no grok quota window at all while grok's auth reads usable.
That last pairing is the trap the credit selector must not fall into, and the
selector already handled it correctly - the regression pins that rather than
changing it.

Cursor's live catalog confirms the recorded Grok ladder, and its usage-limit
behaviour is unchanged: cursor-grok-4.6-high answers, while gpt-5.3-codex-low
and claude-4.5-sonnet refuse until the monthly cycle ends.
…d defects

The live guard now runs green end to end against cline 3.0.55 and proves every
claim the adapter makes: a persisted plan mode still governs start mode (so the
act-mode mechanism is still load-bearing), the settings redirect starts the real
TUI in act mode, the session record structurally confirms it ran in act mode,
the pane binds to exactly one of its own records, the fold reports busy in
flight and leaves busy on cancel, the recorded exit key exits cleanly, the
recorded interrupt key cancels the turn without polluting the composer, and the
operator's own settings come out byte-identical.

Two defects were in the guard rather than the adapter, and both would have
reported a working mechanism as broken:

Its pre-checks spent the only window in which a turn is observably in flight, so
it read the fold after the turn had already settled and reported the busy source
dead. Everything checkable is now checked inside the observation loop.

Its composer check searched the whole pane, which also contains the conversation
echo of the submitted prompt, so it reported a restored prompt that was not
there. It now reads the last prompt-glyph row only. cline genuinely does not
repollute its composer after an interrupt, so recording no clear key is correct.

Also covers the crew-state layer, where a cline task previously read
"unknown - harness state unavailable".
Registering cline's control mechanics was necessary but not sufficient. Every
lifecycle verb refuses an endpoint it cannot positively attribute, and cline
runs as a bundled Node script whose reported command name is a bare `node`, so
a live cline pane classified `ambiguous` and fm-control refused it a second
time - now for an unattributable endpoint rather than for unverified mechanics.

Its identity is its install path (.../node_modules/cline/bin/.cline), the same
shape cursor-agent has, so cline joins the shared exact-executable-name list
that the path rule reads. That rule matches an exact `cline` path COMPONENT
rather than a substring, so an unrelated node process still matches nothing and
stays unattributed rather than being claimed as an agent - callers fold that
into ambiguous, never into dead.

Verified against a real cline 3.0.55 worker through fm-control.sh itself:
`interrupt` reported agent-alive and left the composer on its idle placeholder,
and `exit` reported stopped with the pane back at its shell.
…imitation

Adds the two findings the live verification turned up that are not behaviour
changes: cline's install-path identity and why a bare node pane was
unattributable, and the pre-existing bare-row composer read that classifies a
genuinely idle cline composer as pending.

The second is bounded rather than fixed: it is pre-existing on an unmodified
baseline, Cursor's cursorless reclassification does not transfer because cline
first resolves to the pi separated shape, and a submit that starts a turn is
still confirmed by the submit core's busy fallback. Correcting it would change
the one fleet-wide classifier's conservatism for every harness and backend, so
it is recorded with its measurements instead of changed under this task.
@adibirzu
adibirzu force-pushed the fm/fm-cline-harness-integration branch from 1e2cf23 to 1f9943b Compare August 16, 2026 10:52
…sed ceiling

PR #8 restored this suite with the grok 0.2.99 expectation that xhigh is
omitted, while this branch's ceiling change passes xhigh through on grok 1.0.4.
The launch itself was never wrong - the captured command still threads
--model and the typed brief - so the test now asserts the full new shape:
model flag, xhigh reasoning effort, and typed brief together, with max still
omitted by the sibling test and drift guarded live in
tests/fm-grok-signals-live-e2e.test.sh.
@adibirzu
adibirzu merged commit 7079657 into main Aug 16, 2026
13 checks passed
@adibirzu
adibirzu deleted the fm/fm-cline-harness-integration branch August 23, 2026 09:53
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