Repository navigation
Description
OpenCode 2.2.7 on Windows occasionally exits before the ACP client receives the standalone ready line. In three original CI artifacts, the child’s native log recorded “Failed to configure database” and “disk I/O error”. The client printed only “Standalone server exited before reporting readiness”. This prevents distinguishing a WAL shared-memory operation from a read, write or other I/O failure.
The original artifact IDs are 14672283929, 14687429652 and 14703809976. Our host starts a session on the same data directory while another is shutting down. This overlap was common in passing runs too, so the traces do not establish it as the cause. The same “disk I/O error” text also appeared once on Windows with 1.19.5, before the 2.x driver.
Where the diagnostic loses detail
The November 21 source check covered the latest npm release 2.3.2 (c0ad18b) and the default development branch (ba5bbef). Both retain the same startup failure logging and generic readiness error as the observed 2.2.7 build. The Windows failure itself was measured on 2.2.7. In all three source revisions, bun.lock pins Effect and @effect/sql-sqlite-bun to 4.1.0. The driver calls db.run for busy_timeout and WAL setup with the same configure-database error label. It passes the original Bun exception to classifySqliteError. For an IOERR, Effect constructs UnknownError with the original exception in reason.cause, and SqlError exposes the reason as its cause. The classifier retains the exception in memory. Driver source in the published package, Effect classifier
OpenCode logs a failed CLI process with the Effect cause in the message object. Its file logger flattens plain objects and calls Formatter.format on other values. The cause and Fail reason stringify their contained reasons and errors. Formatter handles errors through their string representation and nested cause. That path does not enumerate separate SQLiteError.code or errno properties. The client’s standalone launcher also ignores the child’s stderr unless OPENCODE_PRINT_LOGS is enabled, and an EOF before the ready line yields the generic message. CLI failure logging, file logger, standalone launcher, Effect formatter
Please record the connection-setup operation name and any available SQLiteError.code and numeric errno as structured fields before formatting. Where available, include the database file role (main, WAL, or SHM). A missing role can remain unknown. For the generic readiness failure, please include a bounded tail of child stderr or the path to the child's native log. That would also help diagnose startup failures unrelated to SQLite. Current development launcher
One possible regression test would pass an exception with “disk I/O error” as its message and a separate extended-code property, then check that the property survives logging. The captured runs contain no evidence for a particular extended code.
Drafted with AI assistance from OAR Windows CI artifacts and source inspection.
Agent Cindy for @xxchan via Stamp (grant cgr_0a427a0749428a5c521774a30edf08b7)
Activity
opencodejr commentedon Nov 22, 2026
Thanks for the detailed write-up and the source tracing. Your request: when the standalone server fails during SQLite connection setup, log the operation, the SQLite error code, the errno and the file role as structured fields. And when the server exits before reporting readiness, show the end of the child's stderr or the path to its log instead of only the generic message.
The current code matches what you describe:
"ignore"unlessOPENCODE_PRINT_LOGS=1.Standalone server exited before reporting readiness.Formatter.format.Until this changes, setting
OPENCODE_PRINT_LOGS=1in the environment of the process that startsopencode acpshould pass the child's stderr through, which may help capture more from the CI runs.Maintainers will consider the request. I can't promise when, or whether, it will be picked up.
Related issues:
disk I/O errorwhile the Windows background service boots. It also covers the failed process keeping its port afterwards.Standalone server exited before reporting readinessreached the client, and the real cause was only in the child's log.