Skip to content

fix(bin): treat OpenCode's right-aligned cwd rail as composer furniture, including absolute paths - #7307

Merged
kunchenguid merged 13 commits into
kunchenguid:mainfrom
KostadinP:fm/fm4632-fix
Oct 14, 2026
Merged

kunchenguid merged 13 commits into
kunchenguid:mainfrom
KostadinP:fm/fm4632-fix

Conversation

@KostadinP

@KostadinP KostadinP commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Fix #4632 ("OpenCode composer classifier misreads status footer as pending text, blocking control-plane recovery") and open a PR through this repository's process (no-mistakes is required for PRs to main): a new PR that builds on the commits of the open PR #5030 (by konih, keeping their authorship), adds the absolute-path widening and the wide-pane fixture, and references both #4632 and #5030.
OpenCode 1.18.x draws the worker's working directory right-aligned inside the left-bar composer rows just above the Build · <model> row, and _fm_composer_classify_leftbar (bin/fm-composer-lib.sh) counts it as typed text, so fm-send skips the doorbell and fm-control exit|relaunch refuse, for idle and busy workers alike. PR 5030 fixes this only when the rail path starts with ~/; workers whose worktrees live under an absolute path outside $HOME (e.g. a 308-column pane) still read pending. The planned change accepts an absolute path with at least one non-/, non-whitespace character after the leading slash in _fm_composer_leftbar_cwd_start, keeps a lone / rejected (slash-command guard) and every other structural gate, updates the PR's comment block and doc lines to cover absolute paths, and adds a sanitized wide busy fixture, an idle twin, and negative tests (lone right-aligned /, /exit at the left edge, an absolute-path token typed at the left edge, typed text plus a rail), plus extraction coverage and a live opt-in check.

What Changed

  • bin/fm-composer-lib.sh: a new _fm_composer_leftbar_cwd_start helper recognizes the right-aligned <cwd>:<branch> rail that OpenCode 1.18.x draws just above the Build · <model> footer. _fm_composer_classify_leftbar and fm_composer_extract_selected_content now skip it as composer furniture, so idle and busy OpenCode workers no longer read as pending. Without this, fm-send skipped the doorbell and fm-control exit|relaunch refused. Recognition is structural and depends on position. The last row must be the footer, and the run must sit directly above it with no gap. Each row must be a single token with no whitespace that starts past half the region's width. The topmost fragment must start with ~/, or be an absolute path with at least one character after the leading slash that is not / or whitespace, which covers worktrees outside $HOME such as /srv/.... A lone right-aligned / and left-edge input such as /exit still read as typed text.
  • Tests: four sanitized 1.18.31 fixtures (idle, idle short cwd, and idle and busy wide panes with an absolute cwd) plus classifier and extraction cases in tests/fm-composer-lib.test.sh. The negative cases cover a lone right-aligned /, a left-edge /exit, a left-edge absolute-path token, typed text alongside a rail, and the accepted residual of a single token typed in the right half. A new opt-in live check, tests/fm-opencode-abs-cwd-rail-live-e2e.test.sh, also runs against OpenCode.
  • Docs: docs/verification/runtime-backends.md, docs/tmux-backend.md and the OpenCode harness reference now describe the cwd-rail furniture, including absolute paths, with dated live evidence.

Builds on #5030 and keeps konih's commits and authorship. Fixes #4632.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change adds one narrow case pattern (/*[!/]*) to _fm_composer_leftbar_cwd_start. Every existing structural gate still applies: the footer row is required, the fragments must be contiguous single tokens, the gap must exceed half the region width, and the topmost fragment's own bytes are checked. A lone / and slash-only tokens stay rejected and are pinned by negative tests. The fix-round changes I checked are correct: the DONE wait no longer matches the echoed prompt, the idle loop fails if the turn is still running instead of moving on, the rail grep is no longer tied to /tmp, and the doc path now resolves to the real bin/fm-composer-lib.sh.

Testing

All scenarios were driven live against real OpenCode 1.18.31 in isolated tmux sockets, with cwds under /tmp outside $HOME, on 300-column panes, and every one passed. With the absolute path rail wrapped into composer rows, fm_tmux_composer_state read empty busy and idle with the fix, and pending on base 24f3a6b, reproducing #4632. Typed text next to the rail, a lone /, /exit and a typed /tmp/... token all stayed pending; captured pane text confirms each input sat next to the rail. In a disposable lab home, base fm-control exit refused because it read the pane as pending text, while the fix stopped the OpenCode worker. The opt-in live e2e test passed both phases. The fixture-based composer-lib unit tests also passed, as supporting evidence only. This change has no visual UI surface, so the evidence is text captures of the tmux pane rather than screenshots. All temporary labs and sockets were removed.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Busy OpenCode worker in an absolute cwd outside $HOME on a 300-column pane: composer state reads empty (base reads pending) ✅ pass live live-composer-matrix.txt S2; live-fm-control-driver-rerun.log 'busy fix=empty base=pending'; live e2e test 'mid-turn ... reads empty'
Idle OpenCode worker with the wrapped absolute rail: composer state reads empty (base reads pending) ✅ pass live live-composer-matrix.txt S1/S1b; live e2e test 'idle ... reads empty'
Control-plane recovery: fm-control exit on that idle worker stops OpenCode (base refuses, reading it as pending text) ✅ pass live live-fm-control-driver-rerun.log (base rc=1 refusal, fix rc=0 'stopped w1', opencode no longer running)
Adversarial: real typed text next to the absolute rail still reads pending ✅ pass live live-composer-matrix.txt S3 + pane-S3-typed-text---abs-rail.txt
Adversarial: a lone '/' typed into the composer still reads pending (slash-command guard) ✅ pass live live-composer-matrix.txt S4 + pane-S4-lone-slash-typed.txt
Adversarial: '/exit' typed at the left edge still reads pending ✅ pass live live-composer-matrix.txt S5 + pane-S5--exit-typed-at-left-edge.txt
Adversarial: an absolute-path token '/tmp/some/path' typed at the left edge still reads pending ✅ pass live live-composer-matrix.txt S6 + pane-S6-abs-path-token-typed-at-left-edge.txt
Evidence: Live composer verdict matrix, fix vs base

Source: Live composer verdict matrix, fix vs base

S2 busy mid-turn, abs rail fixed=empty base=pending S1 idle, empty composer, abs rail fixed=empty base=pending S3 typed text + abs rail fixed=pending base=pending S4 lone slash typed fixed=pending base=pending S5 /exit typed at left edge fixed=pending base=pending S6 abs path token typed at left edge fixed=pending base=pending S1b idle again after clearing fixed=empty base=pending

cwd=/tmp/fm-tst-abs.IFb6zi/fleet-treehouse/a-rather-long-worktree-pool-directory/slot-0123456789/project-under-test  (HOME=~)
opencode 1.18.31
S2 busy mid-turn, abs rail                       fixed=empty    base=pending
rail-row: 54:  ┃                                                                                                                                                                                                                                                                 /tmp/fm-tst-abs.IFb6zi/fleet-
S1 idle, empty composer, abs rail                fixed=empty    base=pending
S3 typed text + abs rail                         fixed=pending  base=pending
S4 lone slash typed                              fixed=pending  base=pending
S5 /exit typed at left edge                      fixed=pending  base=pending
S6 abs path token typed at left edge             fixed=pending  base=pending
S1b idle again after clearing                    fixed=empty    base=pending
Evidence: Live fm-control exit recovery, base vs fix

Source: Live fm-control exit recovery, base vs fix

busy fix=empty base=pending idle fix=empty base=pending == base fm-control exit: error: task w1's composer visibly holds pending text; refusing to type the /exit exit command ... rc=1 == fix fm-control exit: stopped w1 harness=opencode backend=tmux ... rc=0 opencode alive after fix exit: no

busy  fix=empty  base=pending
== cwd: /tmp/fm-lab.wK02YP/treehouse/worktree-pool-directory-long-name/slot-0123456789/project-under-test
idle  fix=empty  base=pending
== base fm-control exit:
error: task w1's composer visibly holds pending text; refusing to type the /exit exit command because it would concatenate onto that text. Clear or submit the pending text, then retry 'exit'
rc=1
opencode alive after base exit: yes
== fix fm-control exit:
stopped w1 harness=opencode backend=tmux endpoint=abs:fm-w1 worktree=/tmp/fm-lab.wK02YP/treehouse/worktree-pool-directory-long-name/slot-0123456789/project-under-test
rc=0
opencode alive after fix exit: no
Evidence: Opt-in live e2e test output

Source: Opt-in live e2e test output

ok - opencode mid-turn absolute cwd rail on a 300-column pane reads empty
ok - opencode idle absolute cwd rail on a 300-column pane reads empty
Evidence: Matrix live driver script

Source: Matrix live driver script

#!/usr/bin/env bash
# Live driver: OpenCode 1.18.x on 300-col tmux pane in absolute cwd outside $HOME.
set -u
ROOT=$1; BASEBIN=$2; EV=$3
REAL_TMUX=$(command -v tmux); SOCKET="fm-tst-abs-$$"; T="oc:oc"
LAB=$(mktemp -d /tmp/fm-tst-abs.XXXXXX); LAB=$(cd "$LAB" && pwd -P)
cleanup(){ "$REAL_TMUX" -L "$SOCKET" kill-server >/dev/null 2>&1; rm -rf -- "$LAB"; }
trap cleanup EXIT
WORK="$LAB/fleet-treehouse/a-rather-long-worktree-pool-directory/slot-0123456789/project-under-test"
mkdir -p "$WORK"; git -C "$WORK" init -q
t(){ "$REAL_TMUX" -L "$SOCKET" "$@"; }
verdict(){ # <bindir>
  ( tmux(){ "$REAL_TMUX" -L "$SOCKET" "$@"; }; . "$1/fm-tmux-lib.sh"; fm_tmux_composer_state "$T" )
}
cap(){ t capture-pane -p -t "$T" -S 0 -E - 2>/dev/null; }
waitf(){ local i=0; while [ $i -lt $2 ]; do cap | grep -Eq "$1" && return 0; sleep 0.5; i=$((i+1)); done; return 1; }
report(){ # <label>
  local n f b; n=$(verdict "$ROOT/bin"); b=$(verdict "$BASEBIN")
  printf '%-48s fixed=%-8s base=%s\n' "$1" "$n" "$b"
  f="$EV/pane-$(echo "$1" | tr -c 'a-zA-Z0-9\n' '-').txt"; cap > "$f"
}
t new-session -d -s oc -n oc -x 300 -y 60 -c "$WORK"
t set-option -t oc window-size manual >/dev/null 2>&1; t resize-window -t "$T" -x 300 -y 60 >/dev/null 2>&1
echo "cwd=$WORK  (HOME=$HOME)"; echo "opencode $(opencode --version)"
t send-keys -t "$T" -l opencode; t send-keys -t "$T" Enter
waitf 'Build' 120 || { cap; echo FAIL no composer; exit 1; }
sleep 3
t send-keys -t "$T" -l "Reply with exactly the word OK and nothing else."; t send-keys -t "$T" Enter
waitf "esc interrupt" 60
report "S2 busy mid-turn, abs rail"
i=0; while cap | grep -q "esc interrupt" && [ $i -lt 240 ]; do sleep 0.5; i=$((i+1)); done; sleep 2
cap | grep -En '┃ +/[^[:space:]]+ *$' | head -3 | sed 's/^/rail-row: /'
report "S1 idle, empty composer, abs rail"
type_check(){ # <text> <label>
  t send-keys -t "$T" -l "$1"; sleep 1.5; report "$2"
  t send-keys -t "$T" C-u; sleep 0.3
  # clear any leftover chars
  local k; for k in $(seq 1 40); do t send-keys -t "$T" BSpace; done; sleep 1
}
type_check "hello world" "S3 typed text + abs rail"
type_check "/" "S4 lone slash typed"
t send-keys -t "$T" Escape; sleep 1
type_check "/exit" "S5 /exit typed at left edge"
t send-keys -t "$T" Escape; sleep 1
type_check "/tmp/some/path" "S6 abs path token typed at left edge"
t send-keys -t "$T" Escape; sleep 1
report "S1b idle again after clearing"
Evidence: Pane capture: typed text next to the absolute rail

Source: Pane capture: typed text next to the absolute rail


  ┃                                                                                                                                                                                                                                                                 Reply with OK instruction
  ┃  Reply with exactly the word OK and nothing else.
  ┃                                                                                                                                                                                                                                                                 Context
                                                                                                                                                                                                                                                                    33,168 tokens
     OK                                                                                                                                                                                                                                                             3% used
                                                                                                                                                                                                                                                                    $0.00 spent
     ▣  Build · DeepSeek V4.1 Flash · 8.6s
                                                                                                                                                                                                                                                                    ▼ MCP
                                                                                                                                                                                                                                                                    • atlassian-invited MCP error -32000:
                                                                                                                                                                                                                                                                       Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-dev MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-prod MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-uat Connected
                                                                                                                                                                                                                                                                    • aws-kostadin MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • context7 Connected
                                                                                                                                                                                                                                                                    • github Connected
                                                                                                                                                                                                                                                                    • intellij Connected
                                                                                                                                                                                                                                                                    • splunk-apm-invited MCP error -
                                                                                                                                                                                                                                                                      32000: Connection closed
                                                                                                                                                                                                                                                                    • splunk-invited MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed

                                                                                                                                                                                                                                                                    LSP
                                                                                                                                                                                                                                                                    LSPs are disabled

























  ┃                                                                                                                                                                                                                                                                 /tmp/fm-tst-abs.IFb6zi/fleet-
  ┃  hello world                                                                                                                                                                                                                                                    treehouse/a-rather-long-worktree-pool-
  ┃                                                                                                                                                                                                                                                                 directory/slot-0123456789/project-
  ┃  Build · DeepSeek V4.1 Flash OpenCode Go · max                                                                                                                                                                                                                  under-test:master
  ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   /tmp/fm-tst-abs.IFb6zi/fleet-treehouse/a-rather-long-worktree-pool-directory/slot-0123456789/project-under-test                                                                                                           33.2K (3%) · $0.00  ctrl+p commands    • OpenCode 1.18.31
Evidence: Pane capture: /tmp/some/path typed at the left edge

Source: Pane capture: /tmp/some/path typed at the left edge


  ┃                                                                                                                                                                                                                                                                 Reply with OK instruction
  ┃  Reply with exactly the word OK and nothing else.
  ┃                                                                                                                                                                                                                                                                 Context
                                                                                                                                                                                                                                                                    33,168 tokens
     OK                                                                                                                                                                                                                                                             3% used
                                                                                                                                                                                                                                                                    $0.00 spent
     ▣  Build · DeepSeek V4.1 Flash · 8.6s
                                                                                                                                                                                                                                                                    ▼ MCP
                                                                                                                                                                                                                                                                    • atlassian-invited MCP error -32000:
                                                                                                                                                                                                                                                                       Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-dev MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-prod MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-uat Connected
                                                                                                                                                                                                                                                                    • aws-kostadin MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • context7 Connected
                                                                                                                                                                                                                                                                    • github Connected
                                                                                                                                                                                                                                                                    • intellij Connected
                                                                                                                                                                                                                                                                    • splunk-apm-invited MCP error -
                                                                                                                                                                                                                                                                      32000: Connection closed
                                                                                                                                                                                                                                                                    • splunk-invited MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed

                                                                                                                                                                                                                                                                    LSP
                                                                                                                                                                                                                                                                    LSPs are disabled
























  ┃ No matching items                                                                                                                                                                                                                                          ┃
  ┃                                                                                                                                                                                                                                                                 /tmp/fm-tst-abs.IFb6zi/fleet-
  ┃  /tmp/some/path                                                                                                                                                                                                                                                 treehouse/a-rather-long-worktree-pool-
  ┃                                                                                                                                                                                                                                                                 directory/slot-0123456789/project-
  ┃  Build · DeepSeek V4.1 Flash OpenCode Go · max                                                                                                                                                                                                                  under-test:master
  ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   /tmp/fm-tst-abs.IFb6zi/fleet-treehouse/a-rather-long-worktree-pool-directory/slot-0123456789/project-under-test                                                                                                           33.2K (3%) · $0.00  ctrl+p commands    • OpenCode 1.18.31
Evidence: Pane capture: idle session view with the wrapped absolute rail

Source: Pane capture: idle session view with the wrapped absolute rail


  ┃                                                                                                                                                                                                                                                                 Reply with OK instruction
  ┃  Reply with exactly the word OK and nothing else.
  ┃                                                                                                                                                                                                                                                                 Context
                                                                                                                                                                                                                                                                    33,168 tokens
     OK                                                                                                                                                                                                                                                             3% used
                                                                                                                                                                                                                                                                    $0.00 spent
     ▣  Build · DeepSeek V4.1 Flash · 8.6s
                                                                                                                                                                                                                                                                    ▼ MCP
                                                                                                                                                                                                                                                                    • atlassian-invited MCP error -32000:
                                                                                                                                                                                                                                                                       Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-dev MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-prod MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • aws-invited-uat Connected
                                                                                                                                                                                                                                                                    • aws-kostadin MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed
                                                                                                                                                                                                                                                                    • context7 Connected
                                                                                                                                                                                                                                                                    • github Connected
                                                                                                                                                                                                                                                                    • intellij Connected
                                                                                                                                                                                                                                                                    • splunk-apm-invited MCP error -
                                                                                                                                                                                                                                                                      32000: Connection closed
                                                                                                                                                                                                                                                                    • splunk-invited MCP error -32000:
                                                                                                                                                                                                                                                                      Connection closed

                                                                                                                                                                                                                                                                    LSP
                                                                                                                                                                                                                                                                    LSPs are disabled

























  ┃                                                                                                                                                                                                                                                                 /tmp/fm-tst-abs.IFb6zi/fleet-
  ┃                                                                                                                                                                                                                                                                 treehouse/a-rather-long-worktree-pool-
  ┃                                                                                                                                                                                                                                                                 directory/slot-0123456789/project-
  ┃  Build · DeepSeek V4.1 Flash OpenCode Go · max                                                                                                                                                                                                                  under-test:master
  ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   /tmp/fm-tst-abs.IFb6zi/fleet-treehouse/a-rather-long-worktree-pool-directory/slot-0123456789/project-under-test                                                                                                           33.2K (3%) · $0.00  ctrl+p commands    • OpenCode 1.18.31
Evidence: Pane capture after fm-control exit with the fix

Source: Pane capture after fm-control exit with the fix

opencode
kostadin@2e3afee67138:/tmp/fm-lab.wK02YP/treehouse/worktree-pool-directory-long-name/slot-0123456789/project-under-test$ opencode
                                   ▄
  █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
  █  █ █  █ █▀▀▀ █  █ █    █  █ █  █ █▀▀▀
  ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀

  Session   OK
  Continue  opencode -s ses_ec3ebb4eeffesXIVN3MXVxNrXY

kostadin@2e3afee67138:/tmp/fm-lab.wK02YP/treehouse/worktree-pool-directory-long-name/slot-0123456789/project-under-test$
- Outcome: 🔧 1 issue found → auto-fixed ✅ across 2 runs (14m12s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed (2) ✅
  • ⚠️ tests/fm-opencode-abs-cwd-rail-live-e2e.test.sh:90 - The live check's idle assertion can actually run while the turn is still going. wait_for &#39;^ *DONE *$|DONE&#39; 240 uses a bare DONE alternative, and that also matches the submitted prompt text ("...reply with exactly DONE.") echoed in the transcript, so the wait returns right after submission. The next loop waits at most 30s (60 × 0.5s) for 'esc interrupt' to disappear. The turn runs sleep 25 plus model latency, which can easily take longer than 30s. In that case the 'idle' verdict is read mid-turn. A busy pane also reads empty, so the test passes, but it never proves the idle case it reports. Fix: drop the |DONE alternative, wait for a DONE line that is not part of the prompt, and fail if 'esc interrupt' is still visible after the bounded wait instead of moving on.
  • ⚠️ tests/fm-opencode-abs-cwd-rail-live-e2e.test.sh:84 - The non-vacuousness grep &#39;┃ +/tmp/[^[:space:]]+ *$&#39; hardcodes /tmp/, but LAB is resolved with pwd -P (line 41). On macOS (the platform of the earlier 1.18.31 verification), /tmp resolves to /private/tmp, so OpenCode draws /private/tmp/... and the opt-in check fails with 'the absolute cwd rail did not wrap into a composer row' even though the classifier is correct. Fix: match the first fragment against the resolved "$LAB" prefix, or against a generic ┃ +/[^/[:space:]][^[:space:]]* *$ absolute-path shape.
  • ℹ️ bin/fm-composer-lib.sh:1376 - One sentence in the comment is now outdated. It says a rail whose string is too long for the composer's visible rows 'fails the check by construction'. With the absolute-path widening, a truncated rail whose topmost visible fragment happens to begin with '/<name>' (a mid-path wrap boundary) is now accepted as furniture. That is correct behavior, since the rows are still furniture, but the sentence should be qualified to match.

🔧 Fix applied.
1 info still open:

  • ℹ️ .agents/skills/harness-adapters/references/harness/opencode.md:25 - The new line points at the shared classifier as ../../../bin/fm-composer-lib.sh. From .agents/skills/harness-adapters/references/harness/ that path resolves to .agents/skills/bin/fm-composer-lib.sh, which does not exist. Sibling harness docs (gemini.md, claude.md) use five levels, ../../../../../bin/..., to reach the repo root. Fix: change the reference to ../../../../../bin/fm-composer-lib.sh.

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

🔧 **Test** - 1 issue found → auto-fixed ✅
  • ⚠️ tests/fm-opencode-abs-cwd-rail-live-e2e.test.sh:92 - The opt-in live check's idle wait ^[^[:alnum:]]*DONE *$ never matched on a real 300-column OpenCode 1.18.31 pane. The sidebar text shares the row with the DONE reply, so the test failed with 'the turn never finished' even though the classifier was correct. Fixed: the pattern is now ^[^[:alnum:]]*DONE([[:space:]]|$), which still excludes the echoed prompt row (it starts with 'Run'). The live re-run passes both phases.
  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Busy OpenCode worker on a 300-col pane with an absolute cwd outside $HOME reads empty (base reads pending) ✅ pass live live-driver.log / live-fm-control-driver.log: busy fix=empty base=pending; live-busy-abs-cwd-screen.txt; live-e2e-abs-cwd-rerun.log mid-turn ok
Idle OpenCode worker with the wrapped absolute cwd rail reads empty (base reads pending) ✅ pass live live-driver.log: idle fix=empty base=pending; live-idle-abs-cwd-screen.txt shows the '/tmp/fm-lab…/treehouse/worktree-' fragment in the composer row above Build; live-e2e-abs-cwd-rerun.log idle ok
fm-send to that idle worker rings the doorbell instead of skipping it ✅ pass live live-driver.log: base fm-send prints 'doorbell skipped (composer visibly holds pending text)'; fix fm-send rc=0, doorbell visible in pane, inbox record moved to handled/
fm-control exit recovers the worker instead of refusing on phantom pending text ✅ pass live live-fm-control-driver.log: base refuses 'composer visibly holds pending text', OpenCode alive; fix prints 'stopped w1 harness=opencode backend=tmux', OpenCode gone
Adversarial: real typed text with the rail present stays pending ✅ pass live live-driver.log: typed 'hello world' fix=pending
Adversarial: an absolute-path token typed at the left edge stays pending ✅ pass live live-driver.log: typed '/tmp/some/abs/token' fix=pending; live-typed-abs-token-screen.txt
Adversarial: a lone '/' and '/exit' typed in the composer stay pending (slash-command guard) ✅ pass live live-driver.log: typed '/' fix=pending; typed '/exit' fix=pending; after clearing, fix=empty
  • bash tests/fm-composer-lib.test.sh (includes the new wide absolute-cwd busy/idle fixture matrix and the negative cases)
  • FM_OPENCODE_ABS_CWD_LIVE=1 bash tests/fm-opencode-abs-cwd-rail-live-e2e.test.sh against real opencode 1.18.31. The first run failed on the idle wait (test bug). The re-run after the fix passed both mid-turn and idle
  • drive-abs-cwd-live.sh: real OpenCode on an isolated tmux socket, 300x60, cwd /tmp/fm-lab.*/treehouse/.../project-under-test. Compares base 24f3a6b and fix fm_tmux_composer_state busy/idle, types adversarial input, and runs base vs fix bin/fm-send.sh against a marked lab FM_HOME
  • drive-abs-cwd-fm-control-live.sh: same setup, runs base vs fix bin/fm-control.sh w1 exit against a lab FM_HOME meta (window=abs:fm-w1, harness=opencode)

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

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Busy OpenCode worker in an absolute cwd outside $HOME on a 300-column pane: composer state reads empty (base reads pending) ✅ pass live live-composer-matrix.txt S2; live-fm-control-driver-rerun.log 'busy fix=empty base=pending'; live e2e test 'mid-turn ... reads empty'
Idle OpenCode worker with the wrapped absolute rail: composer state reads empty (base reads pending) ✅ pass live live-composer-matrix.txt S1/S1b; live e2e test 'idle ... reads empty'
Control-plane recovery: fm-control exit on that idle worker stops OpenCode (base refuses, reading it as pending text) ✅ pass live live-fm-control-driver-rerun.log (base rc=1 refusal, fix rc=0 'stopped w1', opencode no longer running)
Adversarial: real typed text next to the absolute rail still reads pending ✅ pass live live-composer-matrix.txt S3 + pane-S3-typed-text---abs-rail.txt
Adversarial: a lone '/' typed into the composer still reads pending (slash-command guard) ✅ pass live live-composer-matrix.txt S4 + pane-S4-lone-slash-typed.txt
Adversarial: '/exit' typed at the left edge still reads pending ✅ pass live live-composer-matrix.txt S5 + pane-S5--exit-typed-at-left-edge.txt
Adversarial: an absolute-path token '/tmp/some/path' typed at the left edge still reads pending ✅ pass live live-composer-matrix.txt S6 + pane-S6-abs-path-token-typed-at-left-edge.txt
  • tests/fm-opencode-abs-cwd-rail-live-e2e.test.sh with FM_OPENCODE_ABS_CWD_LIVE=1 (real OpenCode 1.18.31, isolated tmux socket, 300x60 pane, cwd under /tmp)
  • Custom live driver drive-composer-matrix-live.sh: real OpenCode on a 300-column pane; compares fm_tmux_composer_state for the fixed bin/ and the base 24f3a6b bin/ while busy, idle, and with typed input (hello world, /, /exit, /tmp/some/path)
  • Live driver drive-abs-cwd-fm-control-live.sh re-run: a disposable fm-lab-home.sh home with an OpenCode worker meta; ran fm-control.sh w1 exit with base, then with the fix
  • bash tests/fm-composer-lib.test.sh (fixture-based classifier and extraction tests for the wide busy and idle absolute-path fixtures; 0 failures)
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

konih and others added 13 commits October 14, 2026 19:40
…niture

OpenCode 1.18.31 draws the worker pane's working directory and branch
right-aligned inside the left-bar composer rows above the Build footer,
wrapped over up to three rail-width fragments whose final fragment
continues onto the footer row's right end. The fragments are RGB 128
grey with luminance exactly on the ghost-luma ceiling, so they survive
ghost stripping, and the left-bar classifier read them as unsent typed
text: every idle 1.18.31 pane answered pending, which skipped the
steering doorbell, the watcher's re-ring ladder, and /exit typing.

_fm_composer_leftbar_cwd_start recognises the run structurally and
position-gated: contiguous single-token rows immediately above the
footer row whose gap after the bar exceeds half the row, whose
fragments plus the footer row's gap-separated right-hand tail
concatenate to a path, optionally followed by :<branch>. A path-shaped
string typed at the composer's left edge is still typed text, so a
wrong call can only defer, never inject. Extraction shares the same
rule so extracted composer content stays user-scoped.
Review round on the independent PR review: the position gate now measures
the gap against the region's width (the widest trimmed plain row across
first..last), so a short space-prefixed home path typed into an otherwise
empty composer no longer reads empty; the right-half lone-token residual
is pinned explicitly. The cwd:branch furniture is documented as present
since OpenCode 1.18.0 (upstream anomalyco/opencode#36457, merged
2026-07-11), not a 1.18.31 layout change. The 1.18.30 capture comment
notes it omits the directory footer, and a cropped-composer extraction
assertion scopes user content to the typed row above the rail.
@KostadinP

Copy link
Copy Markdown
Contributor Author

CI note: the 'Behavior portable serial 2' job was cancelled by the provider (no failure verdict); every other check passed. Rerunning it needs repository admin rights, so a maintainer rerun of that job is requested.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @KostadinP, and thank you for keeping @konih's #5030 commits and authorship intact. The live matrix is very thorough. Base vs fix on a real 300-column OpenCode 1.18.31 pane, a real fm-control exit recovery, and the adversarial inputs that still read pending together answer the questions I would have asked.

Where it stands (head 703013a5):

  • I read the whole diff. _fm_composer_leftbar_cwd_start only skips a contiguous, right-half, single-token run directly above the Build · footer, and its topmost fragment has to begin with ~/ or /<name>. A lone /, a left-edge /exit, a left-edge path, and typed text next to the rail all still read as pending. The one accepted residual, a lone whitespace-free token typed in the right half, is documented and covered by a test. The new live e2e is env-gated, so it's opt-in. There are no workflow, secret, or network changes. Security: none.
  • Contract-class: restore. The doorbell on an idle composer and fm-control exit|relaunch on an idle OpenCode worker are existing default paths, and OpenCode 1.18's cwd rail broke them. This puts them back without adding any new default-on surface.
  • VISION: one captain, one interface: aligns · authority: aligns (the refusal path stays in place for real input) · scripts/agents: aligns · restart: n/a · delegation: aligns (guarded recovery works again) · vendor: aligns (a version-dated rendered-surface read inside the existing composer adapter, with fixtures and an opt-in live check) · scope: aligns.
  • Fixes OpenCode composer classifier misreads status footer as pending text, blocking control-plane recovery #4632: yes, per your body. It also carries fix(composer): treat OpenCode's right-aligned cwd:branch rail as furniture, not typed text #5030 forward.
  • no-mistakes check: green. Live validation: 7/7.
  • CI: everything is green except Behavior portable serial 2. That job was cancelled at the 30-minute limit after all its tests had passed, which is the same timeout pattern we're seeing on main. I've re-run that job for you as you asked.

Next: this is waiting on CI. Nothing is needed from you. Once the serial 2 re-run is green and main's own CI is green, this can land. #5030 would then be closed as carried forward here, with thanks to @konih.

@kunchenguid
kunchenguid merged commit 08f0a06 into kunchenguid:main Oct 14, 2026
38 of 39 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @KostadinP — really appreciate you taking the time on this.