Skip to content

test: initialize pendingBashComponents in Pi Calm host fixture - #51

Merged
clarsen merged 1 commit into
mainfrom
fm/fm-pi-calm-compat
Nov 22, 2026
Merged

clarsen merged 1 commit into
mainfrom
fm/fm-pi-calm-compat

Conversation

@clarsen

@clarsen clarsen commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Intent

I approve the wake question.

The approved Wake changes (PRs #49 and #50 on this fork) are red only because one existing CI test fails, unrelated to either change: in "Behavior portable serial 2", not ok - Pi Calm queued operational rows with TypeError: this.pendingBashComponents is not iterable at node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js:4044, called from firstmate's lib/fm-calm-pending-operational-layout.ts:207 (updatePendingMessagesDisplay override). CI installs the current pi-coding-agent from npm; main last passed 2026-11-08, so a newer Pi release changed that internal. The "Full suite" check fails only because that lane failed. Evidence: https://github.com/clarsen/firstmate/actions/runs/44971540068/job/137052200073 .

What Changed

  • Adds pendingBashComponents: [] to the makeHost fixture in tests/fm-calm-pi-extension.test.sh. Newer Pi releases set this field when they construct a host. The fixture builds its host with Object.create, which skips field initializers, so the field was missing.
  • Fixes the Pi Calm queued operational rows case. It was failing with TypeError: this.pendingBashComponents is not iterable when updatePendingMessagesDisplay ran against the latest @earendil-works/pi-coding-agent from npm. Only test code changes; production code is untouched.

Risk Assessment

✅ Low: The change adds one line to a test fixture: it sets pendingBashComponents: [] on a host built with Object.create(InteractiveMode.prototype), which skips class field initializers. This matches the CI failure in the intent ("pendingBashComponents is not iterable") and changes no production code.

Testing

The change only edits a test file, so the thing to check was the failing CI test. I ran tests/fm-calm-pi-extension.test.sh against a throwaway install of the same Pi release CI uses (1.6.0). The base fixture fails with the exact TypeError CI reported, and the fixed fixture passes. The real-Pi tmux E2Es in that file could not run here: this sandbox's tmux server crashes as soon as a pane writes any output. Those E2Es never touch the edited fixture. There is no UI or visual surface, so the evidence is test logs only. Overall: go.

  • Live validation: ✅ go - 3 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Pi Calm queued operational rows test passes against the current npm Pi (1.6.0) with the fixed fixture ✅ pass live after-fix.log: 'ok - Calm hides queued Firstmate rows only on a session that can keep them...' rc=0, run with FM_PI_PACKAGE_DIR pointing at a real throwaway pi-coding-agent 1.6.0 install
Regression reproduction: the base fixture against Pi 1.6.0 hits the CI TypeError ✅ pass live before-fix.log: 'not ok - Pi Calm queued operational rows ... TypeError: this.pendingBashComponents is not iterable' at interactive-mode.js:4044
Other non-E2E Calm tests in the file still pass with the updated makeHost fixture ✅ pass live after-fix.log: all non-E2E 'ok' lines, rc=0
Real-Pi tmux E2Es (follow-up, queued-row Escape, hidden-block geometry) on Pi 1.6.0 ⏸️ untested no These E2Es need tmux. In this sandbox the tmux server (next-3.4) crashes as soon as any pane writes output, even a plain 'echo hi', with or without TERM set. Real pi 1.6.0 itself starts normally in a…
Evidence: Before fix (base fixture vs Pi 1.6.0) – reproduces CI failure

not ok - Pi Calm queued operational rows: .../interactive-mode.js:4044 for (const component of this.pendingBashComponents) { TypeError: this.pendingBashComponents is not iterable

ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
not ok - Pi Calm queued operational rows: file:///tmp/pi-npm.skzgY5/g/lib/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js:4044
        for (const component of this.pendingBashComponents) {
                                     ^

TypeError: this.pendingBashComponents is not iterable
    at InteractiveMode.updatePendingMessagesDisplay (file:///tmp/pi-npm.skzgY5/g/lib/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js:4044:38)
    at prototype.updatePendingMessagesDisplay (file://~/tmp/fm-calm-pi-extension.hzP40l/queued-operational-rows/lib/fm-calm-pending-operational-layout.ts:207:44)
    at file://~/tmp/fm-calm-pi-extension.hzP40l/queued-operational-rows/[eval1]:112:8
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)

Node.js v22.23.3
Evidence: After fix (Pi 1.6.0) – queued-row and other Calm tests ok
ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm hides queued Firstmate rows only on a session that can keep them, keeps hidden ones out of the editor on Escape, delivers them once in order, and leaves unsupported sessions and Calm off stock
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
ok - Pi calm centralizes transcript visibility, preserves execution/export data, keeps Pi's stock working row visible while no run is active, and persists its choice across session starts
ok - Pi calm on collapses mid-turn assistant working notes to zero height while Calm off keeps them, leaves streaming, truncated-final, and genuine final replies untouched, never mutates the messages, ignores every /calm argument, and restores a legacy persisted max as ordinary Calm on
skip: pi or tmux not found for Pi operational follow-up E2E
skip: pi or tmux not found for Pi Calm queued-row Escape E2E
skip: pi or tmux not found for Pi Calm hidden-block geometry E2E
ok - Pi Calm working ship keeps its centered two-row asymmetric Unicode boat inside a deterministic long-wave trough, paints all water standard blue and the whole boat standard yellow with balanced resets, keeps ANSI-stripped width exact, reverses cleanly at both edges and every width, clamps visible and hidden resizes, falls back deterministically when narrow, freezes and resumes across settle/start without hidden-time jumps or duplicate timers, resets only on a fresh session, and leaves Calm-off visibility untouched
ok - SKIP: no standalone Pi Calm extension is installed, so dual-install coverage used the pinned shared-slot contract; set FM_STANDALONE_CALM_SHIP to check one
ok - the rendered-export-DOM guard renders in one pass, retries a bounded number of Chrome start-up failures, and reports the Chrome binary, Chrome version, Pi version, exit status, and Chrome diagnostic when every attempt fails
skip: pi or tmux not found for Pi calm interactive E2E
Evidence: After fix with pi on PATH – E2E blocked by sandbox tmux crash
ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm hides queued Firstmate rows only on a session that can keep them, keeps hidden ones out of the editor on Escape, delivers them once in order, and leaves unsupported sessions and Calm off stock
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
ok - Pi calm centralizes transcript visibility, preserves execution/export data, keeps Pi's stock working row visible while no run is active, and persists its choice across session starts
ok - Pi calm on collapses mid-turn assistant working notes to zero height while Calm off keeps them, leaves streaming, truncated-final, and genuine final replies untouched, never mutates the messages, ignores every /calm argument, and restores a legacy persisted max as ordinary Calm on
not ok - Pi follow-up loaded-on case (loaded_on) did not reach the ready composer

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Pi Calm queued operational rows test passes against the current npm Pi (1.6.0) with the fixed fixture ✅ pass live after-fix.log: 'ok - Calm hides queued Firstmate rows only on a session that can keep them...' rc=0, run with FM_PI_PACKAGE_DIR pointing at a real throwaway pi-coding-agent 1.6.0 install
Regression reproduction: the base fixture against Pi 1.6.0 hits the CI TypeError ✅ pass live before-fix.log: 'not ok - Pi Calm queued operational rows ... TypeError: this.pendingBashComponents is not iterable' at interactive-mode.js:4044
Other non-E2E Calm tests in the file still pass with the updated makeHost fixture ✅ pass live after-fix.log: all non-E2E 'ok' lines, rc=0
Real-Pi tmux E2Es (follow-up, queued-row Escape, hidden-block geometry) on Pi 1.6.0 ⏸️ untested no These E2Es need tmux. In this sandbox the tmux server (next-3.4) crashes as soon as any pane writes output, even a plain 'echo hi', with or without TERM set. Real pi 1.6.0 itself starts normally in a…
  • Installed @earendil-works/pi-coding-agent@1.6.0 with npm install -g --prefix /tmp/pi-npm.*/g (a throwaway prefix, deleted afterwards)
  • FM_PI_PACKAGE_DIR=<disposable pi 1.6.0> bash tests/.base-calm.test.sh (a temporary copy of the base-commit test file, deleted afterwards): rc=1, reproduces the CI TypeError
  • FM_PI_PACKAGE_DIR=<disposable pi 1.6.0> bash tests/fm-calm-pi-extension.test.sh: rc=0, all non-E2E Calm tests ok, including the queued-row test
  • PATH=<disposable pi bin>:$PATH FM_PI_PACKAGE_DIR=... bash tests/fm-calm-pi-extension.test.sh: tried the real-Pi tmux E2Es; they failed because the sandbox's tmux server crashes
  • Diagnosed the tmux crash: tmux -L p$RANDOM new-session -d ... 'echo hi; sleep 3' gives 'server exited unexpectedly' (output-free sleep 5 survives); real pi 1.6.0 starts fine in a Python pty with TIOCSWINSZ 160x36
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@clarsen
clarsen merged commit 603179f into main Nov 22, 2026
24 checks passed
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