Skip to content

test(opencode): count a process blocked opening a FIFO among the diagnostic's waiters - #3783

Merged
devswha merged 1 commit into
mainfrom
test/opencode-fifo-open-waiter
Nov 12, 2026
Merged

devswha merged 1 commit into
mainfrom
test/opencode-fifo-open-waiter

Conversation

@devswha

@devswha devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner

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.

@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
    • Improved detection of processes waiting for a partner, including those that have not yet opened opencode.json. Existing FIFO-wait and open-file detection remains unchanged.

The paneProcesses scan now includes processes with the exact wait-channel value wait_for_partner. It retains the existing FIFO wait-channel and open-descriptor checks.

Changes: FIFO process scan

Layer / File(s) Summary
Wait-state filter
server/opencode-first-message.contract.test.ts
The process scan includes processes whose wait-channel value is exactly wait_for_partner, alongside its existing FIFO and opencode.json descriptor checks.

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

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to bfc2b

This adds a diagnostic filter condition to a test helper and does not affect production behavior. It carries no meaningful merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: the diagnostic's waiter filter now counts a process blocked opening a FIFO. The raw summary confirms the filter adds the wait_for_partner wchan state. The title is specific…
Description check Passed The description follows the template's Change and Validation sections. The Change section explains the problem (a writerless FIFO waiter in wait_for_partner was missed) and the resulting behavior. The…
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: the diagnostic's waiter filter now counts a process blocked opening a FIFO. The raw summary confirms the filter adds the wait_for_partner wchan state. The title is specific and matches the main change, so it passes.

Full details: Description check

Explanation

The description follows the template's Change and Validation sections. The Change section explains the problem (a writerless FIFO waiter in wait_for_partner was missed) and the resulting behavior. The Validation section lists the commands run and their results. It does not link an issue, which the template asks for only for features. The changelog note explains why no fragment was added, which matches the CONTRIBUTING guidance. The description is 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 2e4110d and bfc2bfa.

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 a68da8e into main Nov 12, 2026
21 checks passed
@devswha

devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head bfc2bfafb422 as a68da8e85516 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.

Follow-up to #3780 from its review: the diagnostic's waiter filter now also counts a process blocked opening a FIFO with no writer (kernel wait wait_for_partner), the case that diagnostic exists for. Two lines; the wait and the assertion are unchanged.

Left, LOW (Codex, read): on a failure the diagnostic prints the command lines of the pane's processes, which could carry a secret passed as an argument; in this test they are the test's own stand-ins.

@devswha
devswha deleted the test/opencode-fifo-open-waiter branch November 12, 2026 17:12
devswha added a commit that referenced this pull request Nov 12, 2026
…heir arguments (#3787)

## Summary

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

On a failure, the stand-in diagnostic's `waiting` list scans every
process on the machine for one blocked on a FIFO, and printed each
match's full command line. In CI the container only holds the test's own
processes. In a local run on a shared machine, though, an unrelated
program that happens to wait on a pipe would have its arguments printed
into the log, and arguments can carry a secret.

## Change (diagnostic only, test file)

`waiting` entries now carry only the process name (`/proc/<pid>/comm`),
its pid and its wait channel, never its arguments.

The pane's own processes (`pane_processes`) keep their argv: they come
from `pane.process_info` for the test's own pane, which is the stand-in.

## Validation

- `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