mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-08 00:54:38 +02:00
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>