Skip to content

Commit 4f982dd

Browse files
chore: generate
1 parent ff3bb74 commit 4f982dd

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

packages/opencode/src/mcp/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ export namespace MCP {
401401
// but may also throw plain Errors when auth() fails internally
402402
// (e.g. during discovery, registration, or state generation).
403403
// When an authProvider is attached, treat both cases as auth-related.
404-
const isAuthError = error instanceof UnauthorizedError || (authProvider && lastError.message.includes("OAuth"))
404+
const isAuthError =
405+
error instanceof UnauthorizedError || (authProvider && lastError.message.includes("OAuth"))
405406
if (isAuthError) {
406407
log.info("mcp server requires authentication", { key, transport: name })
407408

packages/opencode/test/mcp/oauth-auto-connect.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ let simulateAuthFlow = true
2222
// Mock the transport constructors to simulate OAuth auto-auth on 401
2323
mock.module("@modelcontextprotocol/sdk/client/streamableHttp.js", () => ({
2424
StreamableHTTPClientTransport: class MockStreamableHTTP {
25-
authProvider: {
26-
state?: () => Promise<string>
27-
redirectToAuthorization?: (url: URL) => Promise<void>
28-
saveCodeVerifier?: (v: string) => Promise<void>
29-
} | undefined
25+
authProvider:
26+
| {
27+
state?: () => Promise<string>
28+
redirectToAuthorization?: (url: URL) => Promise<void>
29+
saveCodeVerifier?: (v: string) => Promise<void>
30+
}
31+
| undefined
3032
constructor(url: URL, options?: { authProvider?: unknown }) {
3133
this.authProvider = options?.authProvider as typeof this.authProvider
3234
transportCalls.push({

0 commit comments

Comments
 (0)