Files
PaperClipAI/packages
Jannes StubbemannandClaude Fable 5 6eeb8039e9 fix(opencode-local): browser-safe modelProfiles env access + note on invalid PAPERCLIP_OPENCODE_PROVIDERS
Two fixes on the gateway-routing PR:

- index.ts is shared client/server code (the UI imports it for
  DEFAULT_OPENCODE_LOCAL_MODEL et al.), but buildOpenCodeModelProfiles()
  defaulted its env parameter to a bare `process.env` evaluated at module
  load. Under the e2e lane the UI is served through Vite dev middleware,
  which does not rewrite `process.env`, so the browser threw
  "ReferenceError: process is not defined" at module evaluation and the
  entire app failed to render — breaking every UI e2e spec. Guard with
  `typeof process` and fall back to an empty env.

- parseProviderConfig() silently swallowed JSON.parse failures of
  PAPERCLIP_OPENCODE_PROVIDERS, making a misconfigured value
  undiagnosable. It now appends a note ("contains invalid JSON" /
  "is not a JSON object") so the skipped provider block is visible in the
  run notes. Tests cover both malformed-JSON and non-object values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 11:41:57 +02:00
..