Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Model picker empty on launch: jsonrpc read loop dies on 'unexpected end of hex escape' (partial-chunk parse), cancelling list_models #836

Copy link
Copy link
@jyoungpak

Description

@jyoungpak
Issue body actions

Summary

The model picker fails to populate (clicking it does nothing) because the app's JSON-RPC read loop to the Copilot CLI core dies at startup with a parse error, cancelling all in-flight requests — including list_models. This reproduces on essentially every app launch.

Impact

  • Model picker renders empty / does not open on launch.
  • Same failure intermittently takes out list_global_skills and get_account_quota (whatever requests are in-flight when the read loop dies).
  • Self-recovers later (a subsequent on-demand fetch returns the full model list), so it presents as flaky rather than permanently broken.

Root cause (evidence)

The reader in github_copilot_sdk::jsonrpc fails with:

ERROR jsonrpc_read_loop: github_copilot_sdk::jsonrpc: error reading from CLI
      error=unexpected end of hex escape at line 1 column N
ERROR handlers::misc: failed to list models error=request cancelled
ERROR frontend: [WebSocket] Server error: Failed to list models: request cancelled

The failure column N varies across launches — observed values: 23940, 23972, 23973, 27207, 27570, 27571, 28537, 28538, 29217, 30877, 31480, 32952 (all in the ~24K–33K range).

A varying "unexpected end of hex escape" at a large, non-fixed column is the classic signature of a message-framing/buffering bug: a large JSON-RPC response line is split across read chunks, and when the chunk boundary lands inside a \uXXXX escape sequence, the reader attempts to JSON-parse the partial buffer instead of first accumulating a complete line/frame. Parsing then fails on the truncated escape and the whole read loop tears down, cancelling every pending request.

Reproduction

  1. Launch the app.
  2. Observe the read-loop error in the app log near startup.
  3. Open the model picker — it is empty / unresponsive.

Reproduced on 21 of 21 recent launch logs.

Observed in

  • App version: 0.2.25 and 0.2.26 (also present with 0.2.27 staged)
  • CLI core: GitHub Copilot CLI 1.0.58
  • Platform: macOS (darwin-arm64)

Suggested fix

In the github_copilot_sdk::jsonrpc read loop, accumulate a full delimited line/frame from the CLI stream before JSON-parsing, rather than parsing partial read chunks. Additionally, a read-loop parse error should fail only the offending message (or trigger a reconnect/retry) instead of cancelling all concurrently in-flight requests.

Workaround

Relaunching the app re-establishes the connection and the picker repopulates.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.