docs/testing/2026-10-17-opencode-seat-resilience/README.md
VUH-2348: OpenCode seat survives one slow context read or model error
Checks
All checks ran through clankie heavy --.
The real test. apps/clankie/test/opencode-seat-resilience.integration.test.ts
runs the installed OpenCode 1.18.35 serve with the shipped seat plugin, launched
by the real runOpenCodeSeat bridge. The service is the real in-process Clankie
app and captain. Only the model provider and the memory store are fixtures.
OpenCode and Clankie state live in a temporary home, and the plugin's
clankie mcp entry resolves to a shim. The test skips when OpenCode 1.18 is not
installed. It covers three cases:
- A stalled context read. The service stalls the first
/v1/captain/promptfor 11 s, past the client's 10 s bound, during a fresh session's preflight. The plugin retries the read and the seat becomes ready, with no stop cause. - A model error. The provider answers one turn with
401 invalid x-api-key. The turn fails, and the error is recorded as aturn_failedwarning. An owner app turn sent next through/operator/v1/dispatchreaches the model inside a<clankie-seat-event>, gets adeliveredreceipt, and the seat keeps no stop cause. Every model request carried the service's identity text. - The first stop cause. Deleting the native session stops the seat with
session.deleted. A follow-on/failurereport ("Clankie poll failed (409)") does not replace it. The close line namessession.deleted.
Results
- The real test passed.
- Mutations:
- With the three source files reverted to
5359af383, the test fails at step 1. - With
session.errorstopping the seat again, it fails at step 2. - With
failure =instead of??=, it fails at step 3: the poll refusal replacessession.deleted.
- With the three source files reverted to
- Existing seat tests:
opencode-seat,seat-isolationandopencode-seat-adapterpassed (29 tests).
Not covered
- No live TUI seat was relaunched, and no shared service was restarted.
- The test drives the native server API rather than the interactive TUI.
