Skip to content

test(opencode-first-message): wait for the Enter by reading the stand-in's log - #3840

Merged
devswha merged 1 commit into
mainfrom
test/opencode-enter-already-typed
Nov 15, 2026
Merged

devswha merged 1 commit into
mainfrom
test/opencode-enter-already-typed

Conversation

@devswha

@devswha devswha commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Summary

server/opencode-first-message.contract.test.ts failed at line 157 on #3835's run 43574013739 with:

no Enter after the message: "\u001b[200~@effect apply it\u001b[201~\r"

The log it printed at the timeout already ends in the Enter. The test waited for it with fs.watch on the test's folder, which can miss the stand-in's last append; the check made right after the watch started does not help with a write that comes later. It is the same miss #3837 fixes in pending-input.contract.test.ts.

The test now reads the stand-in's log until it ends in \r, with the same 5 s limit and the same message when it does not. The unused watch import goes.

Validation

  • HERDR_TEST_MODE=integration bun test ./server/opencode-first-message.contract.test.ts passes 6 of 6 in 3 of 3 runs, at load averages of 84, 77 and 56.
  • bun run check fast passes, on main 6c64181.
  • No changelog fragment, because the change is test-only.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Improved the first-message test’s handling of delayed input, with a timeout if Enter is not recorded.

The first-message contract test now polls the stand-in’s recorded input every 25 ms for up to five seconds. It succeeds when the input ends in Enter and retains the existing timeout error.

Changes: First-message contract test

Layer / File(s) Summary
Recorded-input polling
server/opencode-first-message.contract.test.ts
The test polls the typed-input log for Enter and throws the existing timeout error if Enter is not recorded within five seconds. It removes the unused watch import.

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

Change: Other

Merge Risk: Minimal · up to 7dd4d

This test-only change makes the first-message contract test more reliable by polling the recorded input instead of relying on a file watcher. It has no production impact, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test file and the actual change: the test now waits for Enter by reading the stand-in's log instead of using fs.watch. It is specific and matches the changeset, so it is a clear PA…
Description check Passed The description covers the problem (timeout at line 157 with the Enter already in the log), the cause (fs.watch can miss a late append), the fix (read the log until it ends in carriage return, same 5 …
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 test file and the actual change: the test now waits for Enter by reading the stand-in's log instead of using fs.watch. It is specific and matches the changeset, so it is a clear PASS.

Full details: Description check

Explanation

The description covers the problem (timeout at line 157 with the Enter already in the log), the cause (fs.watch can miss a late append), the fix (read the log until it ends in carriage return, same 5 s limit and message, unused import removed), and validation (targeted test runs, load averages, bun run check fast, no changelog fragment because the change is test-only). It does not mention the changelog.d/ fragment location, but the change is test-only and the author states why no fragment was added. Mostly complete, so PASS.

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 af26e3a and 7dd4d31.

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 987f07b into main Nov 15, 2026
21 checks passed
@devswha

devswha commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 7dd4d31eb99c as 987f07bfcc8b on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
codex CLEAR

One reviewer: test-only.

No findings left open.
Review reports: ~/.cache/ovis-tmp/reports/

@devswha
devswha deleted the test/opencode-enter-already-typed branch November 15, 2026 10:52
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