Skip to content

feat(tui): investigate errors in a new session - #45157

Merged
kitlangton merged 3 commits into
v2from
investigate-errors
Aug 26, 2026
Merged

feat(tui): investigate errors in a new session#45157
kitlangton merged 3 commits into
v2from
investigate-errors

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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

  1. Inspect the failure. Open the existing MCP server or plugin error-details dialog.

    MCP server: weather-tools i investigate c copy details

  2. Press i. The dialog closes and a new session tab opens in the current project with an editable, OpenCode-specific investigation prompt.

  3. 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.

  4. 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

# From packages/tui
bun run test test/cli/tui/dialog-mcp.test.tsx
bun run test test/app-lifecycle.test.tsx --test-name-pattern "error investigations"
bun run test
bun typecheck

# Repository pre-push hook
bun typecheck

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.

@kitlangton
kitlangton merged commit 3d7ba38 into v2 Aug 26, 2026
13 of 17 checks passed
@kitlangton
kitlangton deleted the investigate-errors branch August 26, 2026 14:43
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