Skip to content

Wrap paseo CLI JSON.parse calls with diagnosable errors - #7

Merged
4mGLn merged 1 commit into
mainfrom
fix/paseo-json-parse-error
Sep 13, 2026
Merged

4mGLn merged 1 commit into
mainfrom
fix/paseo-json-parse-error

Conversation

@4mGLn

@4mGLn 4mGLn commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • wire-paseo and paseo-status crashed with an opaque native SyntaxError ("Unexpected non-whitespace character after JSON at position 2") when paseo ... --json returned malformed output — observed alongside a Transport closed (code 1006) daemon reconnect, which can leave two JSON values concatenated on stdout with no separator.
  • Added parsePaseoJson() to wrap every JSON.parse call on paseo CLI/daemon-config output, so a parse failure now names the command and includes a snippet of the raw output plus a pointer to check paseo daemon status, instead of a bare, uninformative SyntaxError.

Test plan

  • Added a regression test simulating concatenated JSON output ("{}[]") on paseo plugin ls --json, asserting the thrown error names the command.
  • Full suite: 135/135 passing.
  • tsc --noEmit clean.

Raw JSON.parse threw an opaque native SyntaxError with no indication of
which paseo command produced it. Wrap each call site with a helper that
reports the command and a snippet of the actual output, since a
Transport-closed daemon reconnect can leave malformed/concatenated JSON
on stdout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@4mGLn
4mGLn merged commit 9392de1 into main Sep 13, 2026
4 checks passed
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.

1 participant