Skip to content

fix(openrouter-models,openrouter-images): surface network/JSON/FS errors cleanly - #128

Open
trippyogi wants to merge 3 commits into
OpenRouterTeam:mainfrom
trippyogi:fix/skills-17-json-fs-errors
Open

fix(openrouter-models,openrouter-images): surface network/JSON/FS errors cleanly#128
trippyogi wants to merge 3 commits into
OpenRouterTeam:mainfrom
trippyogi:fix/skills-17-json-fs-errors

Conversation

@trippyogi

@trippyogi trippyogi commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Test plan

  • tsc --strict clean on both modified lib.ts files
  • Smoke-tested missing input file: readImageAsDataUrl('does-not-exist.png') prints a clean Could not read image file error and exits 1 (no stack trace)
  • Happy path: list-models.ts returns model JSON successfully; images discover.ts / getImageModels returns 38 models
  • Happy path: generate.ts "a tiny red dot on white" with a valid key — exit 0, saved ~490KB JPEG via saveImage (google/gemini-3.1-flash-image-preview)

…ors cleanly

Bare res.json() and unwrapped filesystem calls crashed agents with stack traces on transient failures. Align with the analytics/generations error style (OpenRouterTeam#17).
@trippyogi
trippyogi marked this pull request as ready for review July 31, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: network errors and JSON parse failures throw unhandled exceptions in lib.ts (models + images)

1 participant