Skip to content

fix: prevent local CLI-agent providers from deadlocking - #4

Merged
Traigor merged 1 commit into
mainfrom
CLI-1890-bitloops-inference-cli-agents-can-deadlock-on-undr
May 21, 2026
Merged

Traigor merged 1 commit into
mainfrom
CLI-1890-bitloops-inference-cli-agents-can-deadlock-on-undr

Conversation

@Traigor

@Traigor Traigor commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes CLI-1890 by preventing local CLI-agent providers from deadlocking when child processes write large stdout/stderr output.

Changes

  • Drain CLI-agent stdout and stderr concurrently while the child process runs.
  • Bound captured diagnostics per stream while continuing to drain overflow.
  • Include stdout_truncated and stderr_truncated in nonzero-exit diagnostics.
  • Return a clear error when successful stdout is truncated before JSON parsing.
  • Document Codex config propagation behavior and avoid unsupported temperature/token flags.
  • Add regression coverage for large stdout, large stderr, bounded diagnostics, and Codex argv behavior.

Verification

  • cargo check -p bitloops-inference
  • cargo test -p bitloops-inference --lib provider::cli_agent -- --nocapture
  • cargo test -p bitloops-inference --test protocol_loop codex_exec_runtime_returns_normalised_parsed_json -- --nocapture
  • cargo test -p bitloops-inference --test protocol_loop claude_code_print_runtime_passes_prompt_model_and_schema -- --nocapture
  • cargo test -p bitloops-inference

@Traigor
Traigor merged commit 59ae536 into main May 21, 2026
6 checks passed
@Traigor
Traigor deleted the CLI-1890-bitloops-inference-cli-agents-can-deadlock-on-undr branch May 21, 2026 11:11
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.

1 participant