The open source coding agent.
TypeScript
chore: generate
opencode-agent[bot]4f982ddb94fc
diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.tsindex 2c0fc1d3766..e48a42a8b34 100644--- a/packages/opencode/src/mcp/index.ts+++ b/packages/opencode/src/mcp/index.ts@@ -401,7 +401,8 @@ export namespace MCP {// but may also throw plain Errors when auth() fails internally// (e.g. during discovery, registration, or state generation).// When an authProvider is attached, treat both cases as auth-related.- const isAuthError = error instanceof UnauthorizedError || (authProvider && lastError.message.includes("OAuth"))+ const isAuthError =+ error instanceof UnauthorizedError || (authProvider && lastError.message.includes("OAuth"))if (isAuthError) {log.info("mcp server requires authentication", { key, transport: name })diff --git a/packages/opencode/test/mcp/oauth-auto-connect.test.ts b/packages/opencode/test/mcp/oauth-auto-connect.test.tsindex 0cd5c36e527..76f825247c8 100644--- a/packages/opencode/test/mcp/oauth-auto-connect.test.ts+++ b/packages/opencode/test/mcp/oauth-auto-connect.test.ts@@ -22,11 +22,13 @@ let simulateAuthFlow = true// Mock the transport constructors to simulate OAuth auto-auth on 401mock.module("@modelcontextprotocol/sdk/client/streamableHttp.js", () => ({StreamableHTTPClientTransport: class MockStreamableHTTP {- authProvider: {- state?: () => Promise<string>- redirectToAuthorization?: (url: URL) => Promise<void>- saveCodeVerifier?: (v: string) => Promise<void>- } | undefined+ authProvider:+ | {+ state?: () => Promise<string>+ redirectToAuthorization?: (url: URL) => Promise<void>+ saveCodeVerifier?: (v: string) => Promise<void>+ }+ | undefinedconstructor(url: URL, options?: { authProvider?: unknown }) {this.authProvider = options?.authProvider as typeof this.authProvidertransportCalls.push({