Skip to content

test: update Calm Pi host fixture for Pi 1.5.2 - #56

Merged
peterOC26 merged 2 commits into
mainfrom
fm/fm-calm-pi-152-compat-c1
Nov 11, 2026
Merged

peterOC26 merged 2 commits into
mainfrom
fm/fm-calm-pi-152-compat-c1

Conversation

@peterOC26

@peterOC26 peterOC26 commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Intent

Captain 2026-11-11: upkeep and side jobs run on Grok and DeepSeek to save Claude usage.
Found 2026-11-11 on firstmate PR #55 (browser-helper cleanup), CI run https://github.com/peterOC26/firstmate/actions/runs/43049199611: tests/fm-calm-pi-extension.test.sh "Pi Calm queued operational rows" fails with TypeError: this.pendingBashComponents is not iterable at Pi dist/modes/interactive/interactive-mode.js:4009. CI installs the newest Pi (@earendil-works/pi-coding-agent 1.5.2, published 2026-11-10); main last passed on Pi 1.5.0, which this server still runs. Every firstmate PR now fails that CI lane, and the Calm Pi extension will break here once Pi updates to 1.5.2.

What Changed

  • The break was in the test stand-in, not in real Pi sessions. Real sessions already initialize pendingBashComponents. makeHost now sets that field to an empty array so Pi 1.5.2's queued-row listing can walk it.

Risk Assessment

✅ Low: The break was in the test stand-in, not in real Pi sessions. The production adapter is unchanged. The stand-in now initializes pendingBashComponents the way Pi's constructor does.

Testing

Before/after checks reproduced the Pi 1.5.2 fixture failure and verified the correction on both versions, with queue-output evidence captured. No live session or screenshot was produced because this change affects only a test stand-in.

  • Live validation: ⚠️ no-surface - 0 of 1 scenarios driven live against the product
Scenario Result Live Evidence
A Pi user queues operational messages and presses Escape without an iterable crash. ⏸️ untested no No changed runtime surface exists: the accepted correction initializes a missing field in the test stand-in. Real Pi sessions were not exercised; focused stand-in tests are supplemental evidence.
Evidence: Pi 1.5.2 reproduces the original stand-in failure

Source: Pi 1.5.2 reproduces the original stand-in failure

not ok - Pi Calm queued operational rows: file://~/.no-mistakes/worktrees/7f0ec18181b6/01M75PRCMPNE1CSW5FXYM6JA7V/.phase-pi-validation/pi-152/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js:4009
        for (const component of this.pendingBashComponents) {
                                     ^

TypeError: this.pendingBashComponents is not iterable
    at InteractiveMode.updatePendingMessagesDisplay (file://~/.no-mistakes/worktrees/7f0ec18181b6/01M75PRCMPNE1CSW5FXYM6JA7V/.phase-pi-validation/pi-152/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js:4009:38)
    at prototype.updatePendingMessagesDisplay (file://~/.no-mistakes/worktrees/7f0ec18181b6/01M75PRCMPNE1CSW5FXYM6JA7V/.phase-pi-validation/tmp/fm-calm-pi-queued-phase.VRw6Me/queued-operational-rows/lib/fm-calm-pending-operational-layout.ts:207:44)
    at file://~/.no-mistakes/worktrees/7f0ec18181b6/01M75PRCMPNE1CSW5FXYM6JA7V/.phase-pi-validation/tmp/fm-calm-pi-queued-phase.VRw6Me/queued-operational-rows/[eval1]:112:8
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)

Node.js v22.23.2
Evidence: Pi 1.5.2 queue rendering, delivery, and fallback observations

Source: Pi 1.5.2 queue rendering, delivery, and fallback observations

{
  "piVersion": "1.5.2",
  "evidenceKind": "Real Pi methods over test stand-in; not a live Pi session",
  "observations": [
    {
      "scenario": "supported queue then Escape",
      "queuedRows": "\n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n Follow-up: FIRSTMATE_OP: v1 away-supervisor: CAPTAIN_TYPED_LOOKALIKE                                                                                                                                   \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "CAPTAIN_QUEUED_TEXT\n\nFIRSTMATE_OP: v1 away-supervisor: CAPTAIN_TYPED_LOOKALIKE\n\nCAPTAIN_DRAFT",
      "delivered": [
        "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_TWO",
        "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE",
        "⁣Supervisor escalate (QUEUED_LEGACY_AWAY)"
      ],
      "continuationNotice": [
        "Firstmate supervision continues in a new turn."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "_queueSteer",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "_queueFollowUp",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "sendUserMessage",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "waitForIdle",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "Calm off stock dequeue",
      "editor": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT"
    }
  ]
}
Evidence: Pi 1.5.0 queue rendering, delivery, and fallback observations

Source: Pi 1.5.0 queue rendering, delivery, and fallback observations

{
  "piVersion": "1.5.0",
  "evidenceKind": "Real Pi methods over test stand-in; not a live Pi session",
  "observations": [
    {
      "scenario": "supported queue then Escape",
      "queuedRows": "\n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n Follow-up: FIRSTMATE_OP: v1 away-supervisor: CAPTAIN_TYPED_LOOKALIKE                                                                                                                                   \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "CAPTAIN_QUEUED_TEXT\n\nFIRSTMATE_OP: v1 away-supervisor: CAPTAIN_TYPED_LOOKALIKE\n\nCAPTAIN_DRAFT",
      "delivered": [
        "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_TWO",
        "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE",
        "⁣Supervisor escalate (QUEUED_LEGACY_AWAY)"
      ],
      "continuationNotice": [
        "Firstmate supervision continues in a new turn."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "_queueSteer",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "_queueFollowUp",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "sendUserMessage",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "unsupported session fallback",
      "missing": "waitForIdle",
      "queuedRows": "\n Follow-up: ⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE                                                                                                                                                \n Follow-up: CAPTAIN_QUEUED_TEXT                                                                                                                                                                         \n ↳ Alt+Up to edit all queued messages                                                                                                                                                                   ",
      "editorAfterEscape": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT",
      "warnings": [
        "Firstmate Calm: this Pi session cannot keep queued messages across Escape, so queued Firstmate rows stay visible."
      ]
    },
    {
      "scenario": "Calm off stock dequeue",
      "editor": "⁣FIRSTMATE_OP: v1 watcher: QUEUED_MONITOR_ONE\n\nCAPTAIN_QUEUED_TEXT"
    }
  ]
}
- Outcome: ⚠️ 1 warning across 1 run (3m9s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 issues (1 warning, 1 info)
  • ⚠️ .pi/extensions/lib/fm-calm-pending-operational-layout.ts:155 - This patches a gap in the test fixture with production code that writes to Pi's internal state. Pi declares pendingBashComponents = []; as a class field (installed Pi 1.5.0, dist/modes/interactive/interactive-mode.js:312), and flushPendingBashComponents only ever sets it back to [] (line 4073). So every real InteractiveMode instance already has an iterable there, and the new record.pendingBashComponents = [] write can only run on a host built without Pi's constructor. The one such host is the test's stand-in from makeHost, which uses Object.create(InteractiveMode.prototype) (tests/fm-calm-pi-extension.test.sh:585) and leaves the field out. The CI failure this.pendingBashComponents is not iterable comes from that stand-in, not from a real Pi 1.5.2 session. The intent's claim that the extension 'will break here once Pi updates to 1.5.2' does not hold for real instances. Smallest honest remedy: remove callPendingMessagesDisplay/pendingBashIterable, restore the two direct originalUpdatePendingMessagesDisplay.call(this) calls (lines 218 and 226), and add pendingBashComponents: [] to makeHost in tests/fm-calm-pi-extension.test.sh so the stand-in matches what Pi's constructor initializes. That keeps the production adapter from writing to Pi-owned fields on every queued-row redraw. This is ask-user because it moves the fix out of the location the author chose and questions the stated premise.
  • ℹ️ .pi/extensions/lib/fm-calm-pending-operational-layout.ts:146 - If the production shim is kept, the pendingBashIterable check and its early-return branch are redundant. Both branches end in the same originalUpdatePendingMessagesDisplay.call(host), and the only difference is the === undefined assignment, which an iterable value never triggers anyway. The helper reduces to if (record.pendingBashComponents === undefined) record.pendingBashComponents = []; originalUpdatePendingMessagesDisplay.call(host);. The long comment at lines 139-145 ('One listing… The other listing…') also never names which Pi versions it means; naming Pi ≥1.5.2 versus ≤1.5.0 would make it checkable. This does not apply if F1's remedy (removing the shim) is taken.

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ⚠️ .pi/extensions/lib/fm-calm-pending-operational-layout.ts:155 - This patches a gap in the test fixture with production code that writes to Pi's internal state. Pi declares pendingBashComponents = []; as a class field (installed Pi 1.5.0, dist/modes/interactive/interactive-mode.js:312), and flushPendingBashComponents only ever sets it back to [] (line 4073). So every real InteractiveMode instance already has an iterable there, and the new record.pendingBashComponents = [] write can only run on a host built without Pi's constructor. The one such host is the test's stand-in from makeHost, which uses Object.create(InteractiveMode.prototype) (tests/fm-calm-pi-extension.test.sh:585) and leaves the field out. The CI failure this.pendingBashComponents is not iterable comes from that stand-in, not from a real Pi 1.5.2 session. The intent's claim that the extension 'will break here once Pi updates to 1.5.2' does not hold for real instances. Smallest honest remedy: remove callPendingMessagesDisplay/pendingBashIterable, restore the two direct originalUpdatePendingMessagesDisplay.call(this) calls (lines 218 and 226), and add pendingBashComponents: [] to makeHost in tests/fm-calm-pi-extension.test.sh so the stand-in matches what Pi's constructor initializes. That keeps the production adapter from writing to Pi-owned fields on every queued-row redraw. This is ask-user because it moves the fix out of the location the author chose and questions the stated premise.
  • ℹ️ .pi/extensions/lib/fm-calm-pending-operational-layout.ts:146 - If the production shim is kept, the pendingBashIterable check and its early-return branch are redundant. Both branches end in the same originalUpdatePendingMessagesDisplay.call(host), and the only difference is the === undefined assignment, which an iterable value never triggers anyway. The helper reduces to if (record.pendingBashComponents === undefined) record.pendingBashComponents = []; originalUpdatePendingMessagesDisplay.call(host);. The long comment at lines 139-145 ('One listing… The other listing…') also never names which Pi versions it means; naming Pi ≥1.5.2 versus ≤1.5.0 would make it checkable. This does not apply if F1's remedy (removing the shim) is taken.
⚠️ **Test** - 1 warning
  • ⚠️ this change has no live-validatable surface; proceed without live validation? (0 of 1 scenarios were driven live against the product); A Pi user queues operational messages and presses Escape without an iterable crash.: No changed runtime surface exists: the accepted correction initializes a missing field in the test stand-in. Real Pi sessions were not exercised; focused stand-in tests are supplemental evidence.
  • Live validation: ⚠️ no-surface - 0 of 1 scenarios driven live against the product
Scenario Result Live Evidence
A Pi user queues operational messages and presses Escape without an iterable crash. ⏸️ untested no No changed runtime surface exists: the accepted correction initializes a missing field in the test stand-in. Real Pi sessions were not exercised; focused stand-in tests are supplemental evidence.
  • Executed only test_queued_operational_rows extracted from the base commit: passed on installed Pi 1.5.0; reproduced pendingBashComponents is not iterable on locally installed Pi 1.5.2.
  • Executed only test_queued_operational_rows from the target commit against Pi 1.5.0 and 1.5.2: both passed.
  • Re-executed the focused test with observation capture for queue rendering, Escape delivery, unsupported-session fallback, and Calm-off behavior on both versions.
  • Removed the temporary local Pi installation and test drivers; git status --short was clean.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

peterOC26 and others added 2 commits November 11, 2026 17:23
The pending-message listing walks pendingBashComponents after clearing the
pending area. Calm's queued-row adapter leaves an iterable collection in
place and supplies an empty collection when the field is absent, so the
redraw no longer throws on a host that never set it.
@peterOC26
peterOC26 merged commit f3d13fb into main Nov 11, 2026
86 of 89 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