Summary
On Windows 11, generation can fail with a raw main-process IPC error:
Error invoking remote method 'codesign:v1:generate': CodesignError: Unexpected end of JSON input
The error is surfaced directly to the user instead of being translated into an actionable message or recovered gracefully.
Environment
- OS: Windows 11
- App: open-codesign desktop
- Provider/model: unknown from screenshot
- Flow: normal generate via
codesign:v1:generate
Repro
- Open open-codesign on Windows 11.
- Start a normal generation.
- The run fails immediately or early in the request lifecycle.
- A modal appears with:
Error invoking remote method 'codesign:v1:generate': CodesignError: Unexpected end of JSON input
Actual
- Generation aborts.
- The user sees a raw JSON parse error.
- The UI does not indicate which local file/state is malformed or how to recover.
Expected
- Generate should not expose a raw
Unexpected end of JSON input error to end users.
- If a local JSON-backed state file is truncated/corrupt, the app should:
- detect it,
- report which state source failed,
- recover safely when possible, or
- show an actionable error message (for example: re-login, reset preferences, or repair local state).
Suspected area
This looks like an uncaught JSON.parse failure somewhere on the main-process generate path.
Relevant entry points / likely parse sites:
apps/desktop/src/main/index.ts codesign:v1:generate
packages/providers/src/codex/token-store.ts reads persisted ChatGPT Codex auth via JSON.parse
apps/desktop/src/main/preferences-ipc.ts reads preferences.json
- other local JSON-backed state read during generate/bootstrap
One likely failure mode is a partially written or truncated local JSON file on Windows, with the raw parse error bubbling through IPC.
Why this matters
This is a poor recovery path for a user-visible flow:
- it blocks generation completely,
- the message is too low-level,
- and it gives the user no clue which state file is broken or what action to take.
Suggested fix direction
- Wrap all JSON reads reachable from generate with source-specific error handling.
- Replace raw parse failures with structured
CodesignErrors.
- Include the failing store/source in logs.
- Show a user-facing recovery hint instead of the raw parse message.
Summary
On Windows 11, generation can fail with a raw main-process IPC error:
Error invoking remote method 'codesign:v1:generate': CodesignError: Unexpected end of JSON inputThe error is surfaced directly to the user instead of being translated into an actionable message or recovered gracefully.
Environment
codesign:v1:generateRepro
Error invoking remote method 'codesign:v1:generate': CodesignError: Unexpected end of JSON inputActual
Expected
Unexpected end of JSON inputerror to end users.Suspected area
This looks like an uncaught
JSON.parsefailure somewhere on the main-process generate path.Relevant entry points / likely parse sites:
apps/desktop/src/main/index.tscodesign:v1:generatepackages/providers/src/codex/token-store.tsreads persisted ChatGPT Codex auth viaJSON.parseapps/desktop/src/main/preferences-ipc.tsreadspreferences.jsonOne likely failure mode is a partially written or truncated local JSON file on Windows, with the raw parse error bubbling through IPC.
Why this matters
This is a poor recovery path for a user-visible flow:
Suggested fix direction
CodesignErrors.