Skip to content

JSONL readers split messages at U+2028/U+2029 on newer Node: an LS in a window title hangs every read of that window #565

Done

Description

@SSFSKIM

Problem

On newer Node, node:readline ends a line at U+2028 (LS) and U+2029 (PS) as well as at LF. JSON.stringify leaves both characters raw, so any JSON message carrying them in a string is cut in two by a readline-based JSONL reader. Both halves then fail JSON.parse, and the readers drop them silently.

  • Version behaviour: checked on this Mac with the same script. Node v22.23.2 gives 1 line; Node v26.7.0 splits {"t":"a
b"} into 2. cua's own kernel needs Node 24 or later.
  • Live evidence (linux171, Linux: the tree text's escapes (\r \n \t) are undocumented for the model, and VT/FF/NEL/LS/PS stay raw (a forging path) #558's x64 check at 657d7f7 and at main cf02ca3, private Xvfb, cua-engine 0.4.4): U+2028 or U+2029 anywhere in node text, a window title or an app id hangs listWindows/getApp. The cell answers "js execution timed out; kernel reset" after 60 s, and that window can never be read. Any app or web page whose title contains LS can therefore block every read of its window. Evidence is on dc-linux171-1e68 in ~/.local/share/cua-171/check558/ (README.md).
  • Readers to audit (main cf02ca3): src/repl-host/kernel-child.mjs:365 (kernel and worker messages), src/repl-host/supervisor.mjs:736, src/mcp/server.mjs:400 (MCP client requests), src/mcp/http.mjs:275, src/mcp/upstream.mjs:72, src/runtime/engine.mjs:878, src/sandbox/app-server.mjs:40. Some of their writers are the vendor's, which cua can't change, so the fix belongs on the reading side.

Fix

  • Every JSONL reader cua owns splits on \n only: a small shared splitter that replaces createInterface for JSON channels, with CR trimmed where a channel allows CRLF.
  • Where cua writes JSONL itself, it may also escape U+2028/U+2029 (
/
) as defence in depth.
  • Tests: a message whose string holds LS or PS survives every reader whole, on the Node versions cua supports, including a window title with LS through listWindows on the own host.
  • Check the macOS own host too. It uses the same kernel-child and supervisor, so a macOS window title with LS likely hangs the same way.

Relation

Found by #558's live check. #558's LS/PS tree escape is correct (unit-tested) but can't be shown live until this lands.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P1
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 24, 2026
  2. SSFSKIM commented on Nov 24, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: Taken by cursor235 (ruling 1190)

  3. added
    status:in-review
    and removed
    status:in-progress
    on Nov 24, 2026
  4. SSFSKIM commented on Nov 24, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: Draft PR #571 (0.29.18); review + live checks pending

  5. SSFSKIM commented on Nov 24, 2026

    @SSFSKIM
    OwnerAuthor

    [review-trail] reviewer-high on PR #571: 0e7f3de..97f606e found 4 P2s (2 jsonl.mjs lifecycle issues and probe-runtime fixed in-PR; wire.rs went to #512 and linux-engine-diff to after #568, per ruling 1192). The scoped re-review of 97f606e..cb3eac6 is correct, with no material findings.

  6. removed
    status:in-review
    on Nov 24, 2026
  7. SSFSKIM commented on Nov 24, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #571 (cua 0.29.20)

  8. added 5 commits that reference this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions