Description
Found ~30 instances of catch {} or catch { } in production code that suppress errors completely without any logging.
Most critical locations:
auth/index.ts:62 — JSON.parse of OPENCODE_AUTH_CONTENT fails silently, causing auth to be silently absent
session/message-v2.ts:1191 — stream error JSON parse fails silently
session/session.ts:508 — session remove() catches error but lets it succeed anyway
lsp/client.ts:150 — server stderr at debug level (startup errors invisible by default)
pty/index.ts:125 — process kill/close failures could create zombie processes
mcp/index.ts:524 — SIGTERM failures not reported
global/index.ts:54 — cache directory cleanup failure not logged
provider/error.ts:71 — JSON parse errors in response handling not logged
util/filesystem.ts — statSync, realpathSync, glob scan failures not logged
util/error.ts:11 — JSON.stringify failure not logged
Also session/llm.ts:258 uses catch (e: any) instead of catch (e: unknown).
Reproduction steps
- Search for
catch {} or catch { } in packages/opencode/src/
- Observe that no logging occurs within these blocks
- Errors that cause failures in these paths are silently lost
Environment info
- OS: all platforms
- Bun version: 1.3.x
- OpenCode version: current dev branch
Description
Found ~30 instances of
catch {}orcatch { }in production code that suppress errors completely without any logging.Most critical locations:
auth/index.ts:62— JSON.parse ofOPENCODE_AUTH_CONTENTfails silently, causing auth to be silently absentsession/message-v2.ts:1191— stream error JSON parse fails silentlysession/session.ts:508— sessionremove()catches error but lets it succeed anywaylsp/client.ts:150— server stderr at debug level (startup errors invisible by default)pty/index.ts:125— process kill/close failures could create zombie processesmcp/index.ts:524— SIGTERM failures not reportedglobal/index.ts:54— cache directory cleanup failure not loggedprovider/error.ts:71— JSON parse errors in response handling not loggedutil/filesystem.ts— statSync, realpathSync, glob scan failures not loggedutil/error.ts:11— JSON.stringify failure not loggedAlso
session/llm.ts:258usescatch (e: any)instead ofcatch (e: unknown).Reproduction steps
catch {}orcatch { }inpackages/opencode/src/Environment info