mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-16 21:15:57 +03:00
fix(tui): hide error hint when MCP Enter starts sign-in (#49403)
This commit is contained in:
committed by
GitHub
Unverified
parent
7df0935ada
commit
7689c3654e
@@ -93,6 +93,8 @@ export function DialogMcp(props: { initialServer?: string; details?: boolean } =
|
||||
|
||||
const focusedError = createMemo(() => {
|
||||
const server = focusedServer()
|
||||
// Enter starts sign-in for auth-gated integrations instead of showing the auth reason
|
||||
if (server?.status.status === "needs_auth" && server.integrationID) return undefined
|
||||
return server ? statusError(server.status) : undefined
|
||||
})
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ test.each(["enter", "space"])("starts OAuth with %s for an MCP server requiring
|
||||
|
||||
try {
|
||||
await fixture.app.waitForFrame((frame) => frame.includes("Sign in required"))
|
||||
expect(fixture.app.captureCharFrame()).not.toContain("enter to view error")
|
||||
if (key === "enter") fixture.app.mockInput.pressEnter()
|
||||
else fixture.app.mockInput.pressKey(" ")
|
||||
await fixture.app.waitForFrame((frame) => frame.includes("Waiting for authorization"))
|
||||
@@ -79,7 +80,7 @@ async function renderMcp(options?: { failed?: boolean; location?: { directory: s
|
||||
name: "linear",
|
||||
status: options?.failed
|
||||
? { status: "failed", error: "MCP error -32000: Connection closed" }
|
||||
: { status: "needs_auth" },
|
||||
: { status: "needs_auth", error: "Authentication required" },
|
||||
integrationID: "mcp_linear",
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user