fix(tui): exit cleanly when startup probes cannot reach the server - #48162
Open
holny wants to merge 1 commit into
Open
fix(tui): exit cleanly when startup probes cannot reach the server#48162holny wants to merge 1 commit into
holny wants to merge 1 commit into
Conversation
A TUI started while the server is electing or cold-booting after an update crashes with an unhandled transport defect: both the file.list probe and its location.get fallback fail and the ClientError escapes through Effect.tryPromise. Route the startup failure through the existing CLI error channel and format ClientError as a friendly "could not reach the OpenCode server" message with exit code 1.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
This was referenced Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Fixes #36688
Type of change
What does this PR do?
A TUI started while the background server is electing or cold-booting after an update can fail both startup location probes and crash with an unhandled
ClientErrorthroughEffect.tryPromise. Route the startup failure through the existing CLI error channel so the TUI exits with a friendly "could not reach the server" message and exit code 1 instead of a raw stack dump.How did you verify your code works?
bun typecheckinpackages/tuiandpackages/clibun testinpackages/tui(1176 passing) andpackages/cli(254 passing)test/error-message.test.tscovers the ClientError formatting and exit codeChecklist
Supersedes #46726 — the PR head fork was accidentally deleted on 2026-09-09 (not intentional, see the notification comment there); re-filing so the review can continue. Original conversation: #46726