feat(tui): attach to configured server by default#30977
Open
jensenojs wants to merge 3 commits into
Open
Conversation
964b7a1 to
3dfefeb
Compare
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
Closes #17322, About 40% of this diff is focused test coverage.
Type of change
What does this PR do?
This adds a
server.attachconfig value for the default TUI path.When configured,
opencodechecks the target server's/global/healthendpoint and attaches to it instead of starting the embedded server. When unset, existing behavior is unchanged.{ "server": { "attach": "http://127.0.0.1:4096" } }For local attach targets, the TUI can start opencode serve when no server is already listening. That auto-started server shuts down after the last client disconnects, avoiding stale local server processes while preserving the current embedded default for users who do not opt in.
How did you verify your code works?
Added focused tests covering the config-driven attach path, preserved embedded fallback behavior, local auto-start failures/success, and last-client shutdown for auto-started
serveprocesses.Screenshots / recordings
This enables shared-server workflows where multiple clients connect to the same opencode session.
Checklist