Skip to content

Add Claude stream-json stdin support#269

Merged
konard merged 4 commits intomainfrom
issue-268-60db55a2b7be
May 1, 2026
Merged

Add Claude stream-json stdin support#269
konard merged 4 commits intomainfrom
issue-268-60db55a2b7be

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented May 1, 2026

Fixes #268

Summary

  • Add --input-format stream-json for Claude-compatible JSONL stdin frames.
  • Parse user/user_prompt, system, and interrupt frames one line at a time, with auto-merge disabled in stream-json mode.
  • Emit Claude-style replay acknowledgements for consumed stream-json user prompts when --output-format stream-json is used.
  • Add --output-format stream-json as an alias for Claude NDJSON output, plus Rust CLI option parity and release fragments.

Reproduction and Verification

  • Reproduces the issue at the queue boundary: stream-json frames are no longer merged and each user frame becomes a separate prompt.
  • Added js/tests/input-queue.js coverage for Claude user, simplified user_prompt, system, interrupt, and invalid non-text frames.

Tests

  • cd js && bun test ./tests/input-queue.js ./tests/cli.ts ./tests/cli_options.ts
  • cd rust && cargo test --test cli --test cli_options
  • cd js && npm test
  • cd js && npm run check
  • cd rust && cargo test
  • git diff --check

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #268
@konard konard self-assigned this May 1, 2026
@konard konard changed the title [WIP] Add bidirectional NDJSON I/O via --input-format stream-json (parity with Claude Code) Add Claude stream-json stdin support May 1, 2026
@konard konard marked this pull request as ready for review May 1, 2026 09:39
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 1, 2026

Working session summary

Implemented and pushed the fix to PR #269: #269

What changed:

  • Added --input-format stream-json for Claude-compatible JSONL stdin frames.
  • Added --output-format stream-json alias mapping to Claude NDJSON output.
  • Parses user/user_prompt, system, and interrupt frames without auto-merging.
  • Emits Claude-style replay acknowledgements for consumed stream-json user prompts.
  • Added JS parser/CLI tests, Rust CLI option parity, and release fragments.

Verification:

  • cd js && npm test
  • cd js && npm run check
  • cd rust && cargo test
  • git diff --check
  • Latest JS and Rust CI runs on commit 3627542 are passing.

PR #269 is marked ready for review, and the working tree is clean.


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 1, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $19.720062

📊 Context and tokens usage:

  • peak request: 15.0M / 1.1M (1431%) input tokens, 42.6K / 128K (33%) output tokens

Total: (309.0K + 14.7M cached) input tokens, 42.6K output tokens, $19.720062 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (40675KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 1, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit f2f847c into main May 1, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bidirectional NDJSON I/O via --input-format stream-json (parity with Claude Code)

1 participant