Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(mcp): suppress noisy warning on first-run missing mcp-state.json
NotFound is expected on first run — silence it. Still warn on actual errors like corrupt JSON or permission denied.
  • Loading branch information
danielxxomg committed May 20, 2026
commit 08b1301aac6cdcaef8d4e8e6da025199edeb79b1
5 changes: 4 additions & 1 deletion packages/opencode/src/mcp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ export const layer = Layer.effect(
return new Set(obj.disabledMcpServerIds.filter((x): x is string => typeof x === "string"))
}),
Effect.catchCause((cause) => {
log.warn("failed to read mcp-state.json", { cause: Cause.squash(cause) })
const err = Cause.squash(cause)
if (err && typeof err === "object" && "_tag" in err && err._tag === "NotFound")
return Effect.succeed(new Set<string>())
log.warn("failed to read mcp-state.json", { cause: err })
return Effect.succeed(new Set<string>())
}),
Comment on lines +286 to +292
)
Expand Down
Loading