Skip to content

fix(tui): exit cleanly when startup probes cannot reach the server - #46726

Closed
holny wants to merge 1 commit into
anomalyco:v2from
holny:tui-startup-exit
Closed

fix(tui): exit cleanly when startup probes cannot reach the server#46726
holny wants to merge 1 commit into
anomalyco:v2from
holny:tui-startup-exit

Conversation

@holny

@holny holny commented Sep 2, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #36688

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 ClientError through Effect.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 typecheck in packages/tui and packages/cli
  • bun test in packages/tui (1176 passing) and packages/cli (254 passing)
  • New test/error-message.test.ts covers the ClientError formatting and exit code

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@holny

holny commented Sep 2, 2026

Copy link
Copy Markdown
Author

Fixes #36688 — the linked-issue check doesn't seem to resolve the keyword from a fork PR, so referencing it here directly.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The search results show that PR #46726 (the current PR) appears in the results, but no other duplicate PRs are found. The other PRs returned are related to different features (registry changes, Console model recovery, IDE context, providers) and are not addressing the same issue.

No duplicate PRs found

@holny

holny commented Sep 4, 2026

Copy link
Copy Markdown
Author

Gentle nudge — still green and ready for review. Happy to adjust anything if the approach needs changes; the linked-issue workaround from my last comment also still applies (manual Development-panel link needed before merge).

@holny holny closed this by deleting the head repository Sep 9, 2026
@holny

holny commented Sep 9, 2026

Copy link
Copy Markdown
Author

Superseded by #48162 - this PR's head fork was accidentally deleted on 2026-09-09 (not intentional); re-filed so the review can continue. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant