test: support Pi 1.0.3 HTML renderer lookups - #28
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
"q298a", answering this option: "merge PR 27 now, accepting the failing check "Behavior portable serial 6", and start a small firstmate job to fix that test for Pi 1.0.3". Later: "also we should probably update our pi as well".
Context the ask refers to. CI job "Behavior portable serial 6" fails on
tests/fm-calm-pi-extension.test.shwith "not ok - Pi calm renderer and lifecycle contract failed: file:///tmp/fm-calm-pi-extension.*/renderer/[eval1]:546", reported by the pipeline as "grep disappeared from /export calm.html HTML while calm mode was on"..github/workflows/ci.ymlinstalls the newest@earendil-works/pi-coding-agentwithout a version; CI used 1.0.3 (released 2026-10-05 08:37 UTC) on #27, while main last passed on 2026-10-03 with 1.0.0. The test passes locally on main and on that PR with the VPS's Pi 0.99.2. Failing run: https://github.com/peterOC26/firstmate/actions/runs/37285235172.What Changed
getToolDefinitionand Pi 1.0.3’sgetToolRendererslookup.Risk Assessment
✅ Low: The change only touches test fixtures and verification notes. Each fixture now supplies both
getToolDefinition(used by Pi 0.99.2) andgetToolRenderers(used by 1.0.3). I checked the Pi 1.0.3 package: it expects the same object shape withrenderCall/renderResult, so the fixtures behave the same on both versions without changing any product code.Testing
Focused fixtures and real Pi CLI scenarios passed on both versions. Reproduced the original failure, proved the branch assertion detects unwanted export rendering, and captured HTML, screenshots, and transcripts. Initial dependency-layout and Chromium socket-path setup issues were resolved before successful reruns; scratch files were cleaned up.
Evidence: Actual Pi 1.0.3 Calm export
Source: Actual Pi 1.0.3 Calm export
Evidence: Live results, original failure reproduction, and mutation evidence
Source: Live results, original failure reproduction, and mutation evidence
Evidence: Validation setup and preserved-driver explanation
Source: Validation setup and preserved-driver explanation
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
tests/fm-pi-branch-extension.test.sh:5282- This change misses one other test that uses the same renamed Pi lookup.fm-pi-branch-extension.test.sh:5281-5282still passes onlygetToolDefinitiontocreateToolHtmlRenderer. Pi's tool-renderer wraps the lookup in try/catch and returnsundefinedon any error (seedist/core/export-html/tool-renderer.jsin renderCall and renderResult). Under Pi 1.0.3, which this change says looks up renderers throughgetToolRenderers, the missing function throws a TypeError. The renderer catches it, soactualCallandactualResultare alwaysundefined. The assertion at about line 5287 expectsundefined("stock export rendering did not delegate to Pi's structured fallback"), so it now passes without testing anything: a regression that made the fm_branch_outcomes renderer emit HTML during Calm stock export would go undetected on CI's unpinned Pi. Fix: addgetToolRenderers: () => stockDefinitionandgetToolRenderers: () => actualDefinitionnext to the existinggetToolDefinitionentries at lines 5281 and 5282, matching the fixture change intests/fm-calm-pi-extension.test.sh:1668,1700.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
pi --version,node --version, andchromium --version; installed Pi 1.0.3 only in disposable worktree-local scratch storage.bash .test-live/calm-focused.shon both versions, selectingtest_rendering_and_session_lifecycleandtest_interactive_terminal_e2efromtests/fm-calm-pi-extension.test.sh.bash .test-live/branch-focused.shon both versions, selectingtest_outcomes_tool_uses_stock_execution_and_export_consumersfromtests/fm-pi-branch-extension.test.sh.bash .test-live/calm-before.sh: legacy version passed; Pi 1.0.3 reproduced the exact reported grep-export failure with the new callbacks removed.bash .test-live/branch-mutated-before.shandbash .test-live/branch-mutated.sh: the old fixture missed injected custom export rendering; the corrected fixture rejected it.python3 .test-live/branch-live.py 0992 /usr/bin/piandpython3 .test-live/branch-live.py 103 "$PWD/.test-live/pi-103/node_modules/.bin/pi"; real CLI sessions used private 180x44 terminals.bash bin/fm-test-run.sh --jobs 1 tests/fm-calm-pi-queue-retention-live-e2e.test.shwith each matching Pi CLI.node .test-live/capture-export.mjscaptured Chromium screenshots of both Calm exports and the Pi 1.0.3 branch export; visually inspected screenshots.Removed task-owned scratch installations, fixtures, and browser profiles;git status --shortconfirmed a clean worktree.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.