Repository navigation
test: fix Pi Calm, Pi branch, and remote-reply CI test flakes - #10
Merged
Merged
Conversation
- Calm and branch export renderers: Pi 1.0.1 renamed the HTML exporter's lookup dependency from getToolDefinition to getToolRenderers, and the exporter swallows the TypeError a missing one raises. The stand-ins now pass the lookup under both names and count lookups, so the negative export assertions cannot pass vacuously. - Calm interactive E2E: Pi 1.0.0 made the alternate-screen fullscreen layout the default, which keeps no tmux scrollback. The E2E now pins the regular layout Firstmate launches Pi in (fm-spawn's --tui-mode regular). - Calm export-DOM render guard: the never-finishing fake Chrome counted its own attempts, but each attempt is killed after three ticks and macOS can spend that long assessing a freshly written script before its first line runs. The hang case now reads the attempts from the guard's own report. - Remote reply: the manual handle replay re-arms the source, so a listener that adopted the previous registration exits as superseded at its next launch-floor check. The result wait now rechecks ownership for its whole duration and restarts the source the way the watcher's reconcile cycle does.
demy00
added a commit
that referenced
this pull request
Oct 16, 2026
## Conflict resolutions The trial merge listed 13 conflicted files; the actual merge also conflicts in `tests/fm-procevent.test.sh` (14 total). | File | Fork origin | Resolution | | --- | --- | --- | | `.agents/skills/agent-skill-trigger-index/SKILL.md` | 09efd59 (#6, clickup-tickets) | Fork's `clickup-tickets` trigger line re-added to upstream's list unchanged. | | `AGENTS.md` | 3843b2c (#8, skill selection); 89e1459 (#3, `feature/` prefix) | Fork's `fm-skill-select.sh --apply` line and the `feature/` default wording re-applied on upstream's new section 7 text (upstream added `--base-branch` and self-repo consent lines next to it; both kept). | | `README.md` | 89e1459 (#3), via earlier fork syncs | Default ship-branch prefix wording stays `feature/` in upstream's rewritten bullet. | | `bin/fm-captain-hold.sh` | 999f9d8 (#1, done-archive evidence) | Fork's done-archive lookup re-applied unchanged on upstream's version. | | `bin/fm-dod-lib.sh` | 89e1459 (#3), 16cc4bd | Upstream's new base-branch/forge/consent code kept; its two `fm/$id` defaults now call `fm_task_branch` and the lib sources `fm-task-branch-lib.sh`, as the fork did before. | | `bin/fm-procevent-lavish.sh` | 826e32b, 79d101b, d0ac8f4, cbfb295 (#7) | True clash, decided by the captain (option A) - see below. | | `bin/fm-spawn.sh` | 89e1459 (#3), 16cc4bd, b7edc11, 153f4e2, de04c2d | Fork's `feature/` branch naming and legacy-brief branch binding re-applied unchanged on upstream's version. | | `bin/fm-timeout-lib.sh` | 9e8b923 (bash without `BASHPID`) | Upstream fixed the same macOS bash 3.2 bug independently (5838f10, kunchenguid#6028, perl watchdog takes the pre-exec parent). Took upstream's code; the fork's regression test for it is kept and passes on upstream's fix. | | `docs/architecture.md` | 89e1459 (#3) | `feature/` default and the `fm-task-branch-lib.sh` ownership line re-applied. | | `tests/fm-brief.test.sh` | 89e1459 (#3), via earlier fork syncs | Expected branch names stay `feature/<id>` in upstream's updated cases. | | `tests/fm-calm-pi-extension.test.sh` | bc3f178 (#10), 1757302 (#8 CI fix) | Upstream fixed the `/reload` geometry flake its own way (`wait_for_geometry_reload` on a durable status row), so the fork's `pipe-pane` version is dropped. Kept the fork's lookup-counting export renderer, the report-based Chrome hang attempt check, and the `tuiMode: regular` settings pin next to upstream's `--tui-mode regular` flag. | | `tests/fm-procevent.test.sh` | #7 | Both test sets kept; see the Lavish decision. | | `tests/fm-review-diff.test.sh` | 89e1459 (#3) | Fork's two unrecorded-`feature/` branch cases re-added; case letters shifted after upstream's new cases. | | `tests/fm-timeout-lib.test.sh` | 9e8b923 | Fork's no-`BASHPID` test kept on top of upstream's tests. | ## Decision: Lavish list-form parser (captain chose option A) Both sides fixed the same bug: Lavish emits queued feedback as a TOON list (not a table) when items carry nested content, and the adapter read it as an empty, complete result. - Fork (#7): one parser that flattens and presents every nested field (table-cell `target:`, `attachments:`, other `fields:`, message uid/selector/text), adds `unpresented_items:`, and refuses `complete: yes` when nested content cannot be parsed. - Upstream (fc8972c, kunchenguid#5404): one parser that skips nested targets and attachments; its tests assert nested content is absent from `read`. It also adds stricter refusals (unrecognized header keeps its declared count and counts as malformed; `answers`/`reconciles` exit 3 when not fully accounted for), and 228b27d renames the message count to `captain_message_count`. Options: - **A (chosen):** keep the fork's presenting parser, port upstream's strictness onto it (declared count + malformed on an unrecognized header, `answers`/`reconciles` exit 3, `captain_message_count`), keep both test sets, and adapt upstream's three "absent" assertions to check nested content appears only under its own labelled section and never replaces the item's own text. Cost: this region will likely conflict again on the next upstream sync. - **B:** take upstream's parser and tests wholesale and drop the fork's nested presentation. Cost: Lavish reads lose table-cell location, text-selection range, and image attachment paths.
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
Two firstmate CI behavior tests fail intermittently or always, unrelated to the change on PR 9 (merge tool multi-waive): standing rule is to fix lint, test failures and test flakiness even when not caused by the current work.
What Changed
fm-calm-pi-extension.test.shandfm-pi-branch-extension.test.shnow pass the tool lookup tocreateToolHtmlRendereras bothgetToolRenderers(the Pi 1.0.1 name) andgetToolDefinition. They also count lookups and fail if the exporter never checked the registered tools, so the "renders nothing" assertions can no longer pass without testing anything.tuiMode: "regular"so tmux scrollback still holds the restored rows. Pi 1.0.0 made the alternate-screen layout the default.await_reply_resultinfm-remote-reply.test.shnow checks listener ownership every 10 polls for the whole wait, not just once at the start. It restartsfm-procevent.sh startwhen no listener is live, with only one of its own starts running at a time. This covers the case where a listener exits as superseded just after the single check.🤖 Generated with Claude Code
Risk Assessment
✅ Low: Test-only change: it fixes flaky or broken tests and touches no production code. I traced each new path and found no wrong result: the remote-reply restart guard, the render-guard report parsing, and the per-renderer export lookup counts all hold.
Testing
I ran the three changed test files against the latest Pi (1.1.0), installed in a temp prefix the same way CI installs it: - Pi branch extension: all tests pass, including the export-lookup guard. - Remote-reply: 5 consecutive runs all pass, including the NUL-byte capture case. No timeouts. - Calm Pi extension: passes up to the last step of its interactive E2E. That E2E now runs in regular TUI mode and passes until the Chrome export-render step. The render-guard test passes with its attempts now counted from the guard's own report. - Not run: the Chrome export-render step. Brave, the only Chromium browser on this host, cannot render headless in this sandbox. This branch changes only tests, so there is no UI. The artifacts are the test logs.Evidence: Calm Pi extension test log against Pi 1.1.0
Source: Calm Pi extension test log against Pi 1.1.0
Evidence: Pi branch extension test log against Pi 1.1.0
Source: Pi branch extension test log against Pi 1.1.0
Evidence: Remote-reply test, 5 repeated runs
Source: Remote-reply test, 5 repeated runs
run 1 rc=0 157s 33 ok / 0 not ok run 2 rc=0 169s 33 ok / 0 not ok run 3 rc=0 172s 33 ok / 0 not ok run 4 rc=0 173s 33 ok / 0 not ok run 5 rc=0 172s 33 ok / 0 not okSkills used
firstmate-coding-guidelines
Also tidied
test_export_dom_render_guardintests/fm-calm-pi-extension.test.shflaked on macOS: the never-finishing fake Chrome counted its own attempts, but each attempt is killed after three ticks and macOS spent 0.17-0.35s assessing the freshly written script before its first line ran. The hang case now reads the three attempts from the guard's own report, each required to be timed out.Noticed
tests/fm-calm-pi-extension.test.sh(operational follow-up, queued-row Escape, hidden-block geometry) still run Pi in its 1.x fullscreen default rather than the regular layout Firstmate launches; they pass today.tests/fm-remote-secondmate-trace-context.test.shcleanup printsrm: cannot remove ... Permission deniedin CI.fm-remote-herdr-guard,fm-afk-return,fm-backend,fm-watcher-lock,fm-calm-claude-mod); they pass on Linux CI.--dump-domwith a fresh--user-data-dir; chrome-headless-shell 154 renders the same export.Better idea
The remote-reply
handlereplay could skip re-arming when the receipt already matches, so a manual replay never supersedes a live listener; the test would then not need to stand in for the watcher's restart.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
tests/fm-calm-pi-extension.test.sh:4419- I could not run the rendered-export-DOM step at the end of test_interactive_terminal_e2e locally. Google Chrome is not installed. The fallback, Brave 154 (passed via FM_CHROME_BIN), returns 0 bytes from--headless=new --dump-domin this sandbox, even for a one-line HTML file. All 3 bounded attempts endedtimed_out=yeswith CVDisplayLinkCreateWithCGDisplay errors. render_export_dom itself is not changed by this branch. Everything in the interactive E2E before that step passed under the pinnedtuiMode: "regular", including the /export completion. CI's Linux runner with Chrome is the remaining evidence for that one step. To check it locally, install Google Chrome or point FM_CHROME_BIN at a headless-capable Chromium.Installed the latest @earendil-works/pi-coding-agent (1.1.0) into a temp global prefix /tmp/pi-g-5EMy, then pointed FM_PI_PACKAGE_DIR and PATH at itFM_CHROME_BIN=<Brave> bash tests/fm-calm-pi-extension.test.sh: 14 of 15 tests pass against Pi 1.1.0. Passing: the HTML export stand-in with its lookup guard, the hidden-block geometry E2E, the rewritten export-DOM render-guard hang case, and the interactive E2E up to its Chrome render stepbash tests/fm-pi-branch-extension.test.sh: all 51 pass, including 'fm_branch_outcomes hides ... HTML export stay stock' with the per-renderer lookup guardbash tests/fm-remote-reply.test.shrun 5 times in a row: 33/33 pass on every run, including 'NUL bytes are normalized in place before shell line processing'Probed Brave headless--dump-domon a trivial file to confirm the export-render failure is a host limitation✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.