Skip to content

test(opencode): name the pane's processes and any FIFO waiter when the stand-in is never seen - #3780

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

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

Conversation

@devswha

@devswha devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner

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.

@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

  • Tests
    • Added diagnostics to pane startup timeout errors, providing more information about the pane state and related processes.

The contract test now gathers pane and system process details when stand-in startup times out. It appends these diagnostics to the error alongside the last observed pane state.

Changes: Startup timeout diagnostics

Layer / File(s) Summary
Collect and report process diagnostics
server/opencode-first-message.contract.test.ts
The test gathers pane process details and scans /proc for selected processes. If startup times out, the error includes these diagnostics and the last observed pane state.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Merge Risk: Minimal · up to 1d506

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

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: diagnostics in the contract test that report the pane's processes and any FIFO waiter when the OpenCode stand-in is never seen. It is specific and matches the diff, which a…
Description check Passed The description follows the template. The Change section explains the problem (CI failure with 'the OpenCode stand-in did not start'), the new diagnostic fields, and the unchanged wait behavior. The V…
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 change: diagnostics in the contract test that report the pane's processes and any FIFO waiter when the OpenCode stand-in is never seen. It is specific and matches the diff, which adds paneProcesses and FIFO/opencode.json scanning to the timeout error. The title is a single sentence and is not vague.

Full details: Description check

Explanation

The description follows the template. The Change section explains the problem (CI failure with 'the OpenCode stand-in did not start'), the new diagnostic fields, and the unchanged wait behavior. The Validation section lists the commands run and their results, including the forced local failure, the integration test run, and the fast check. It also states that no changelog fragment was added, which matches the template's changelog guidance. The description does not mention the contract-test coverage line explicitly, but the integration contract test run covers it. The description is mostly complete.

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 1730fc8 and 1d506f2.

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; 4 remain after this review.

@devswha
devswha merged commit 9aae4f1 into main Nov 12, 2026
20 of 21 checks passed
@devswha

devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 1d506f2272a9 as 9aae4f11fb40 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).

Merged with these checks red, none of them required: bundle (macos-15, darwin-universal);

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

Diagnostic only, after #3774: when the test's stand-in agent is never seen, the error now also lists the pane's processes with their kernel wait and open files, and any process stuck on a FIFO or holding the folder's opencode.json. The wait and the assertion are unchanged.

Left, LOW (Codex, reproduced with cat on a FIFO with no writer): a process blocked opening the FIFO waits in wait_for_partner and does not have the FIFO among its file descriptors, so the diagnostic would not list it. Sent to the author's lane.

Merged with one check not green: bundle (macos-15, darwin-universal) of Remote PC bundles, not a required check, was cancelled by GitHub after it found no hosted macOS arm64 runner for 21 minutes (the macos-15-intel bundle passed). This PR changes one test file, which no bundle contains.

@devswha
devswha deleted the test/opencode-first-start-process branch November 12, 2026 16:42
devswha added a commit that referenced this pull request Nov 12, 2026
…nostic's waiters (#3783)

## Summary

Follows up #3780, from the merge pass's Codex review (LOW).

#3780's failure message lists processes that wait on a FIFO: `wchan`
containing `fifo`, or holding the folder's `opencode.json`. A process
blocked **opening** a FIFO that has no writer waits in
`wait_for_partner` instead, and holds no fd on it yet. The diagnostic
would have left out exactly the process it is meant to name.

Reproduced here: `cat` on a writerless FIFO sits in `/proc/<pid>/wchan`
= `wait_for_partner`.

## Change (diagnostic only, test file)

The waiter filter also matches `wchan === "wait_for_partner"`.

## Validation

- `cat` on a writerless FIFO shows `wait_for_partner`. Checked on this
host; the probe process was killed by its pid.
- `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