Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/opencode/src/cli/cmd/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ export const McpDebugCommand = cmd({
prompts.log.info(`Auth status: ${getAuthStatusIcon(authStatus)} ${getAuthStatusText(authStatus)}`)

if (entry?.tokens) {
prompts.log.info(` Access token: ${entry.tokens.accessToken.substring(0, 20)}...`)
prompts.log.info(` Access token: ${entry.tokens.accessToken ? "present" : "missing"}`)
if (entry.tokens.expiresAt) {
const expiresDate = new Date(entry.tokens.expiresAt * 1000)
const isExpired = entry.tokens.expiresAt < Date.now() / 1000
Expand Down
4 changes: 2 additions & 2 deletions packages/opencode/src/server/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const ErrorMiddleware: ErrorHandler = (err, c) => {
return c.json(new NamedError.Unknown({ message: err.message }).toObject(), { status: 409 })
}
if (err instanceof HTTPException) return err.getResponse()
const message = err instanceof Error && err.stack ? err.stack : err.toString()
const message = err instanceof Error ? err.message : err.toString()
return c.json(new NamedError.Unknown({ message }).toObject(), {
status: 500,
})
Expand Down Expand Up @@ -80,7 +80,7 @@ export function CorsMiddleware(opts?: { cors?: string[] }): MiddlewareHandler {
if (input === "tauri://localhost" || input === "http://tauri.localhost" || input === "https://tauri.localhost")
return input

if (/^https:\/\/([a-z0-9-]+\.)*opencode\.ai$/.test(input)) return input
if (/^https:\/\/([a-z0-9-]+\.)*mimo\.xiaomi\.com$/.test(input)) return input
if (opts?.cors?.includes(input)) return input
},
})
Expand Down