feat(tui): investigate errors in a new session - #45157
Merged
Merged
Conversation
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.
Why
MCP server and plugin failures currently end in an error-details dialog that can only copy the message. Investigating the failure requires manually opening another session, reconstructing the relevant OpenCode context, and hoping the session uses the project whose configuration caused the problem.
What Changes
Inspect the failure. Open the existing MCP server or plugin error-details dialog.
MCP server: weather-tools i investigate c copy detailsPress
i. The dialog closes and a new session tab opens in the current project with an editable, OpenCode-specific investigation prompt.Review and submit. MCP prompts include the server name, failed status, exact
mcp.servers.<name>configuration key, optional integration ID, and original error. Plugin prompts include the plugin name, failed status, runtime, source, and original error. Both direct the investigation toward project/global configuration, startup or loading behavior, environment variables, credentials, dependencies, and logs.Keep control. The session is created only after the user edits or submits the draft. Repeating the flow replaces the existing Home draft instead of silently retaining an earlier error.
Session Location
Investigations preserve the complete current location, including its workspace ID, rather than following the configurable new-session location or jumping to a global directory. Project-local MCP and plugin configuration remains available without embedding the project absolute path in the prompt.
Demo
Matched OpenCode Drive runs against base commit
d01ac2069a(left) and this change (right), using the same intentionally failing fictional MCP server and simulated provider. The right-hand run edits the contextual investigation draft, submits it, and receives a simulated diagnosis.investigate-errors-before-after.mp4
Scope
Applies to the shared error-details dialog used by failed MCP servers and failed TUI/server plugins. Session creation remains opt-in; global troubleshooting categories and configurable investigation workspaces are not part of this change.
Verification
Full TUI suite: 797 passed, 5 skipped, 0 failed across 112 files. The focused lifecycle regression verifies two consecutive investigations update the real Home composer without creating a session, and the MCP regression verifies diagnostic context plus directory/workspace-ID preservation. The pre-push hook additionally passed typechecking across all 32 workspace tasks.