Skip to content

test: fail the omp handoff setup when its stand-in never starts, drop a stale todo note - #1725

Merged
devswha merged 1 commit into
mainfrom
test/command-capability-leftovers
Oct 23, 2026
Merged

devswha merged 1 commit into
mainfrom
test/command-capability-leftovers

Conversation

@devswha

@devswha devswha commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Change

Two of #1548's leftovers:

  • server/omp.contract.test.ts waited up to 100 x 50 ms for the stand-in omp and then carried on even if it never appeared. It now waits against a deadline and throws, as opencode-first-message.contract.test.ts does.
  • server/skills/opencode.test.ts still had a PENDING_TODO5 note above a case that has passed since that todo shipped.

The other items stay open: item 1 needs SessionHistory.tsx and items 2 and 3 need server/conversation.ts or server/index.ts, which other open PRs or the ongoing refactor hold.

Refs #1548

Validation

  • bun test server/skills/opencode.test.ts scripts/conventions.test.ts: pass.
  • server/omp.contract.test.ts on an isolated herdr session: 2 pass.
  • bun run check fast: pass.

… a stale todo note

server/omp.contract.test.ts waited up to 100 x 50 ms for the stand-in omp and then carried on even if it never appeared; it now waits against a deadline and throws, as opencode-first-message.contract.test.ts does. server/skills/opencode.test.ts still carried a PENDING_TODO5 note above a case that has passed since that todo shipped.

Items 4 and 5 of #1548; the others need files other open PRs hold or the server entry point.

Refs #1548
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 2210494 and 4b8bc7d.

📒 Files selected for processing: 2
  • server/omp.contract.test.ts
  • server/skills/opencode.test.ts
  • 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

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Merging without a CodeRabbit review: CodeRabbit hit its review limit, so no review ran. The merge pass reviewed it instead. A gate reviewer on a different model than the author's confirmed the handoff setup now throws once its deadline passes. The 50 ms poll follows the repo's bounded-loop convention. The conventions and opencode unit tests ran 44 pass, 0 fail. All required checks are green and no review thread is open.

@devswha
devswha merged commit 1356210 into main Oct 23, 2026
17 checks passed
@devswha
devswha deleted the test/command-capability-leftovers branch October 23, 2026 08:04
devswha added a commit that referenced this pull request Oct 28, 2026
…d drop #1548's duplicate paths (#2200)

## Change

The three items from #1548 that were still open on main:

- **OpenCode cleanup on stop (item 3).** A stopped server now also
releases its OpenCode event stream, the panes it verified, and their
send watches, as it already did for Codex's app-server connections. That
state is shared by every server in the process, so `createServer` holds
it (`holdOpenCodeNative` in `server/opencode-native.ts`) and `stop()`
releases it. Only the last server to stop resets it, so a server that is
still running keeps its stream and committed watches. After that reset,
a verification still on its way (a request that was mid-flight at stop)
opens no stream until a server holds the state again or an explicit
reset starts over.
- **SessionHistory (item 1).** `src/components/SessionHistory.tsx` calls
the tested `recentlyResumedPane` instead of repeating its lookup.
Behaviour is unchanged.
- **Test-only export (item 2).** `hermesResults` and its `HermesResult`
type had no production caller and are gone.
`server/dialogs/hermes.test.ts` checks those screens through the
registered result readers' `parse`, the path the server uses.

The rest of #1548 was already fixed: items 4 and 5 by #1725, and the
other two exports in item 2 (`claudeRewindOf`, `claudeRewindOnScreen`)
by #1890.

Fixes #1548

- **Contract test.** `server/opencode.contract.test.ts` (from #1489)
stopped the only server and expected the next one to inherit the pane
the first one verified. That is the state item 3 releases, so its
replacement server now starts before the old one stops. Its collector
still learns the pane verified before it started, and ends it.
Production runs one server per process, so nothing else depends on the
state surviving a stop.

## Validation

- `server/opencode-native-stop.test.ts` (new, `createServer` on port 0
with a mkdtemp `stateDir`, a stand-in OpenCode v2 service):
  - A stopped server closes the stream at the service.
- A second server's stream and panes survive the first one's stop, and a
second `stop()` of the same server releases nothing more.
- A verification after the last stop opens no stream; a new server
verifies again.
- The first case fails on main. Removing the holder count fails the
second case, and removing the late check fails the third.
- `bun test server/opencode-native-stop.test.ts
server/opencode-native.test.ts server/dialogs/hermes.test.ts
src/lib/sessionHistory.test.ts`: 72 pass. `bun run typecheck` is clean.
- The Hermes help-cut assertion now goes through the reader: dropping
the help layout's frame check makes it fail.
- `bun scripts/session-history-browser-qa.ts`: all 15 checks pass,
including Open (not Resume) for a pane resumed a moment ago.
- Every unit file in one bun process (`UNIT_TEST_WORKERS=1`, as native
Windows runs them), so that state left by one file reaches the next:
- 7957 pass and 1 fail. The failure is `server/core/pending.test.ts`
"pending cap" (Pi, no OpenCode), which timed out at 5.1 s under load and
passes alone in 1.3 s.
- `bun run check fast`: green.
- `server/opencode.contract.test.ts` on an isolated herdr test session:
24 pass.

Server code the remote bundle carries changed; `REMOTE_BUNDLE_VERSION`
is left to the release PR, as docs/development.md says.

## Review

- **omo-native-code-reviewer** on 411ef56: PASS. Its LOW-1 and LOW-3
were the shared-state and late-stream issues below.
- **Codex Sol 6.1 Fast xhigh** on 411ef56 found two MEDIUMs: stopping
one server reset state that another running server shares, and a request
mid-flight at stop could open a new stream afterwards. Both are fixed in
ee883e8. Codex's re-review of that delta: PASS, no findings, with its
harness covering 9 lifecycle cases.
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