Skip to content

test(opencode): say what herdr last reported when the first-message stand-in never starts - #3774

Merged
devswha merged 1 commit into
mainfrom
test/opencode-first-start-diag
Nov 12, 2026
Merged

devswha merged 1 commit into
mainfrom
test/opencode-first-start-diag

Conversation

@devswha

@devswha devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Summary

server/opencode-first-message.contract.test.ts:86 failed 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 in scripts/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.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Startup timeout errors now include the most recently observed pane state for easier troubleshooting.

The startup polling loop retains the latest pane snapshot. If startup exceeds 10 seconds, the timeout error includes that snapshot.

Changes: OpenCode Startup

Layer / File(s) Summary
Startup polling and timeout error
server/opencode-first-message.contract.test.ts
The polling loop uses the latest pane snapshot to check OpenCode recognition. If startup times out, the error includes that snapshot.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to 3c73c

This is a test-only diagnostic improvement with no production behavior change, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the first-message stand-in timeout error now reports the last pane state herdr reported. It is a test-only diagnostic change in the test file. The title is specific an…
Description check Passed The description follows the template. It has a Change section that explains the problem and the diagnostic behavior, and a Validation section that lists the commands run, their results, and the skippe…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the first-message stand-in timeout error now reports the last pane state herdr reported. It is a test-only diagnostic change in the test file. The title is specific and matches the raw summary and objectives.

Full details: Description check

Explanation

The description follows the template. It has a Change section that explains the problem and the diagnostic behavior, and a Validation section that lists the commands run, their results, and the skipped changelog step. It does not link an issue, but the template only requires that for features, and this is a test-only change. The template's pointer to contract-test coverage applies to HTTP/WS changes, so it does not apply here.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3752f87 and 3c73c95.

Files selected for processing: 1

  • server/opencode-first-message.contract.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@devswha
devswha merged commit 7c7546e into main Nov 12, 2026
21 checks passed
@devswha

devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 3c73c95c3cef as 7c7546e74a3d on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
codex CLEAR

One reviewer: test-only PR (server/opencode-first-message.contract.test.ts).

Test-only PR (server/opencode-first-message.contract.test.ts), so one reviewer: Codex Terra, CLEAR with no findings.

Diagnostic only: when the test's stand-in agent never starts (the flake that turned main's run of 64e4b46 red), the error now carries what herdr last reported for the pane. The wait and the assertion are unchanged.

@devswha
devswha deleted the test/opencode-first-start-diag branch November 12, 2026 14:56
devswha added a commit that referenced this pull request Nov 12, 2026
…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.
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