Skip to content

fix(tui): keep MCP dialog open after OAuth - #51079

Closed
BowTiedSwan wants to merge 1 commit into
anomalyco:devfrom
BowTiedSwan:mcp-auth-dialog
Closed

BowTiedSwan wants to merge 1 commit into
anomalyco:devfrom
BowTiedSwan:mcp-auth-dialog

Conversation

@BowTiedSwan

Copy link
Copy Markdown

Issue for this PR

Closes #51060

Type of change

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

What does this PR do?

Return to the MCP list after successful authentication, with the same server selected. The sign-in dialog previously had no completion callback, so it used the default behavior of closing the dialog.

Uses the existing integration callback and MCP status updates so users can authenticate the next server without reopening /mcp.

How did you verify your code works?

  • Added rendered-component regression tests for Enter and Space, authenticating two servers sequentially, preserving selection, updating status, and Escape dismissal. Both new cases fail on the original code.
  • From packages/tui: bun test --timeout 30000 test/cli/tui/dialog-mcp.test.tsx test/cli/tui/dialog-integration.test.tsx test/cli/tui/dialog-select.test.tsx — 48 passed.
  • bun run check — repository-wide lint and all 35 typecheck tasks passed with Bun 1.4.2.
  • Prettier and git diff --check passed.

To confirm manually, authorize an MCP server from /mcp, then select another server from the restored list.

Screenshots / recordings

Real TUI component frames with fixture-controlled OAuth completion; no external account authorization was used.

Before and after MCP OAuth completion

Checklist

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

@github-actions

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.

@github-actions

Copy link
Copy Markdown
Contributor

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

@BowTiedSwan

Copy link
Copy Markdown
Author

The description already includes Closes #51060. The needs:issue label appears to be the non-default-branch false positive tracked by #51058: this PR targets v2 as CONTRIBUTING.md requires, while the default-branch standards workflow only checks closingIssuesReferences. Please remove the label or rerun the check once that workflow fix lands.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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.

tui: MCP dialog closes after browser OAuth completes

1 participant