Skip to content

[Bug]: Large rollout files crash thread detail fallback with ERR_STRING_TOO_LONG #52

Description

@iWiley

Language

  • I wrote this issue in English, or included a concise English summary first.

Network checklist

Not applicable: the phone can reach Relay through the configured tunnel and load thread content. These reports concern request compatibility or local thread metadata/rollout handling after a connection has already been established.

Versions

  • Codex Relay: 1.4.5
  • Codex CLI / app-server: 0.146.0
  • Node.js: 24.7.0
  • OS: macOS 26.5.2
  • Mobile app: version not exposed in the client UI

Summary

Relay can fail to open a persisted thread whose rollout JSONL file is large. The rollout fallback reads the complete file as one UTF-8 string and then splits it into lines. Observed files around 600–750 MB exceed the Node.js maximum string length.

Steps to reproduce

  1. Create or use a persisted Codex rollout JSONL file larger than the Node.js maximum string length.
  2. Run Relay in shared app-server mode.
  3. Open the affected thread from the mobile client so rollout-message fallback runs.

Expected behavior

The persisted conversation remains accessible, or Relay returns a bounded/paginated result without crashing.

Actual behavior

Thread detail fails, and the affected conversation cannot be continued reliably from Relay.

Logs or screenshots

Error: Cannot create a string longer than 0x1fffffe8 characters
code: ERR_STRING_TOO_LONG

Private rollout paths have been omitted.

Possible fix

Parse rollout JSONL incrementally with a stream/readline parser instead of readFileSync(rolloutPath, "utf8").split("\n"). Prefer app-server pagination when available, with a file-size guard and bounded tail-reading fallback. A sparsely generated large rollout can exercise this path in a regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions