Removed redundant comments that simply restate what the code is doing.
Kept only comments that provide valuable context or explain complex behavior.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The CLIJSONDecodeError constructor expects an Exception as the second
argument, not None. Changed to pass a ValueError with details about
the buffer size limit being exceeded.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds buffering to accumulate incomplete JSON messages that are split
across multiple stream reads due to asyncio's 64KB default buffer limit.
- Implement 1MB buffer to accumulate partial JSON
- Clear buffer on successful parse or size limit exceeded
- Add comprehensive tests for split JSON scenarios
Fixes CLIJSONDecodeError when reading large minified JSON files.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The CLI only sends total_cost_usd, not cost_usd. This PR:
- Removes the non-existent cost_usd field from ResultMessage
- Makes total_cost_usd optional since it may be missing
- Handles GeneratorExit gracefully in subprocess transport
- Removes unnecessary cancel scope call
Fixes the error users were experiencing:
- KeyError: 'cost_usd'
- Field required [type=missing, input_value=...]
The anyio cancel scope error still appears in logs but doesn't affect functionality.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>