Repository navigation
test(opencode): say what herdr last reported when the first-message stand-in never starts - #3774
Conversation
…tand-in never starts
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Merge passMerged head
One reviewer: test-only PR (server/opencode-first-message.contract.test.ts). Test-only PR ( Diagnostic only: when the test's stand-in agent never starts (the flake that turned |
…e stand-in is never seen (#3780) ## Summary `server/opencode-first-message.contract.test.ts` failed again on main (CI 43249069631 at a5ef911): "the OpenCode stand-in did not start", in the FIFO test. #3774's message showed herdr's last report for the pane: cwd `fifo-folder`, `agent_status: "unknown"`, no `agent`, `revision: 0`. Forcing the same wait to fail locally gives the same fields while the stand-in runs normally. The stand-in draws nothing until input, so `revision: 0` is expected. The message therefore says herdr never marked the pane `opencode`, but not why. ## Change (diagnostic only, test file) When the wait gives up, the error also carries, as JSON: - `pane_processes`: the pane's foreground processes from `pane.process_info`, each with its kernel wait channel (`/proc/<pid>/wchan`) and the files it holds open. - `waiting`: any process blocked opening a FIFO, or holding the folder's `opencode.json`, with its command line (at most 20). If something, herdr's own detection included, opens the FIFO `opencode.json` and waits for a writer, the next red names it. If nothing does, that rules the FIFO out. The wait, its deadline and the assertion are unchanged. ## Validation - A forced early failure, local only and reverted, printed the new fields: the stand-in `bun …/bin/opencode fifo` in `ep_poll`, and `waiting: []`. - `HERDR_TEST_MODE=integration bun test ./server/opencode-first-message.contract.test.ts` (herdr 0.9.3): 6 pass, 0 fail. - `bun run check fast`: pass. No changelog fragment: this changes a test only.
Summary
server/opencode-first-message.contract.test.ts:86failed on main (CI 43173933580 at 64e4b46) and once in a local repro: "the OpenCode stand-in did not start", in "sends a first message while the folder's opencode.json is a FIFO no one writes".The wait gives up after 10 s, but the error does not say what herdr last reported for the pane. A CI failure cannot tell a slow agent detection (herdr still sees the shell) from a stand-in that never ran.
Change (diagnostic only, test file)
The poll keeps the last pane herdr reported. The error now includes it:
the OpenCode stand-in did not start: {...}. The wait, its deadline and the assertion are unchanged.Validation
HERDR_TEST_MODE=integration bun test ./server/opencode-first-message.contract.test.ts(herdr 0.9.3, short TMPDIR): 3/3 full-file passes, plus the FIFO test alone. One earlier run, right after a build, had the FIFO test fail at 9.3 s; its error was not kept.bun run check fast: pass. An earlier run failed once inscripts/plugin-port.test.ts("counts a port taken on ::1…"), which this PR does not touch and which passed 3/3 alone.No changelog fragment: this changes a test only.