Skip to content

CodexLogReader duplicates every response chunk #99

@bookandlover

Description

@bookandlover

Bug Description

When using ask codex to send requests, every response from Codex contains each line/chunk duplicated. The actual content is correct, but each piece appears twice in the captured output.

Reproduction Steps

  1. Send any request via ask codex "some message"
  2. Wait for Codex to complete and respond
  3. Read the captured response — every chunk appears twice

Root Cause Analysis

Traced through the code flow:

  1. Single send confirmed: codex.py:handle_task() (line ~111) sends the message exactly once via backend.send_text(pane_id, prompt)
  2. Double read in CodexLogReader: The CodexLogReader reads from Codex's session JSONL file and captures each response chunk twice
  3. Likely cause: The reader is capturing responses from both a primary path and a fallback/duplicate path simultaneously within the JSONL parsing stage

Affected Code

  • ~/.local/share/codex-dual/lib/askd/adapters/codex.pyCodexLogReader class
  • The JSONL session file parsing logic

Impact

  • Cosmetic only: The duplicated content doesn't affect Codex's actual processing correctness
  • Annoying: Makes it harder to read responses, doubles the output length
  • All downstream consumers (hooks, pend codex, etc.) see duplicated text

Environment

  • CCB version: v5.2.4
  • Installation: ~/.local/share/codex-dual/
  • OS: macOS (Darwin 25.3.0)

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