#23720: Feat/cli backend runtime tuning
agents
size: L
Cluster:
Session Management and Fixes
## Summary
Describe the problem and fix in 2–5 bullets:
- Problem:
- Why it matters:
- What changed:
- What did NOT change (scope boundary):
## Change Type (select all)
- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [ ] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [ ] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
## Linked Issue/PR
- Closes #
- Related #
## User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write `None`.
## Security Impact (required)
- New permissions/capabilities? (`Yes/No`)
- Secrets/tokens handling changed? (`Yes/No`)
- New/changed network calls? (`Yes/No`)
- Command/tool execution surface changed? (`Yes/No`)
- Data access scope changed? (`Yes/No`)
- If any `Yes`, explain risk + mitigation:
## Repro + Verification
### Environment
- OS:
- Runtime/container:
- Model/provider:
- Integration/channel (if any):
- Relevant config (redacted):
### Steps
1.
2.
3.
### Expected
-
### Actual
-
## Evidence
Attach at least one:
- [ ] Failing test/log before + passing after
- [ ] Trace/log snippets
- [ ] Screenshot/recording
- [ ] Perf numbers (if relevant)
## Human Verification (required)
What you personally verified (not just CI), and how:
- Verified scenarios:
- Edge cases checked:
- What you did **not** verify:
## Compatibility / Migration
- Backward compatible? (`Yes/No`)
- Config/env changes? (`Yes/No`)
- Migration needed? (`Yes/No`)
- If yes, exact upgrade steps:
## Failure Recovery (if this breaks)
- How to disable/revert this change quickly:
- Files/config to restore:
- Known bad symptoms reviewers should watch for:
## Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write `None`.
- Risk:
- Mitigation:
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds streaming support for the Claude CLI backend by introducing a new `stream-json-parser` module and integrating it into the CLI runner. The parser buffers incomplete JSON lines, emits text deltas in real-time, and captures session metadata.
Key changes:
- Added `streaming` flag to backend config (defaults to `false` for Claude backend)
- Set watchdog timeout to max int32 (2,147,483,647ms) effectively disabling output timeout for long sessions
- Changed `serialize` from `true` to `false` for concurrent execution
- Added environment variable cleanup for `CLAUDECODE` and `CLAUDE_CODE`
- Modified system prompt to reduce narration verbosity
- Comprehensive test coverage for the streaming parser (300 lines)
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with thorough testing
- Well-structured implementation with comprehensive test coverage, proper error handling, and backward compatibility. The streaming parser has 14 test cases covering edge cases. The main concern is the significant runtime behavior changes (disabling serialization, removing output timeout, enabling concurrency) which need production validation.
- Pay close attention to `src/agents/cli-backends.ts` for the watchdog timeout and serialization changes, and `src/agents/cli-runner.ts` for the streaming integration logic
<sub>Last reviewed commit: 0e61a13</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#15522: fix(codex-cli): compatible resume args + JSONL chunk streaming bridge
by chungjchris · 2026-02-13
78.7%
#12384: feat(cli): add --stream-json flag for live NDJSON streaming
by kumarabhirup · 2026-02-09
77.8%
#12999: feat(agents): Add streaming response metrics tracking
by trevorgordon981 · 2026-02-10
77.0%
#19673: fix(telegram): avoid starting streaming replies with only 1-2 words
by emanuelst · 2026-02-18
76.7%
#9006: fix: streaming UI, session locks, routing performance, plugin sandb...
by facundollamas2007 · 2026-02-04
75.9%
#21555: fix: abort streaming runs after 90s of inactivity
by jg-noncelogic · 2026-02-20
75.8%
#19814: Codex/align delimiter parsing assertion with parser
by Johnsonbros · 2026-02-18
75.8%
#13881: fix: Address Greptile feedback - test isolation and channel resolution
by trevorgordon981 · 2026-02-11
75.5%
#17265: fix: abort streaming runs after 90s of inactivity
by jg-noncelogic · 2026-02-15
75.2%
#21271: fix(commands): pass channel/capabilities/shell/os to runtime in com...
by evansantos · 2026-02-19
75.2%