Skip to content

fix(analyze): stream sessions larger than the V8 string limit #39

Description

@drewstone

Reproduction

On commit c052989, run:

pnpm exec tsx src/cli.ts analyze --harness codex --last 1 --cwd /home/drew/code/agent-dev-container-sandbox011 --out /tmp/codex-current-trace-analysis.md

Observed: exits 1 with error: Invalid string length. The selected active Codex rollout is 805,291,116 bytes. traces list can discover it, but analysis materializes enough content to exceed V8 string limits.

Required behavior

  • Parse and normalize arbitrarily large JSONL sessions incrementally.
  • Bound retained prompt, response, tool, span, report, and external-analysis payload bytes explicitly.
  • Preserve counts, timing, failures, and truncation receipts when text is clipped.
  • Add a sparse-file/generated large-session regression that proves analysis completes without allocating the full session as one string.
  • Keep explicit-session and --last selection behavior identical.

This blocks analyzing long-running operator sessions with the current published/local CLI.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions