Skip to content

fix(broker): bulk-inject Codex PTY tasks#1357

Merged
khaliqgant merged 1 commit into
mainfrom
fix/codex-bulk-injection
Jul 25, 2026
Merged

fix(broker): bulk-inject Codex PTY tasks#1357
khaliqgant merged 1 commit into
mainfrom
fix/codex-bulk-injection

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

  • default Codex and codex.exe PTY injection to the historical bulk-write path
  • preserve paced injection for Claude and other CLIs
  • preserve RELAY_INJECT_RATE_MS as an explicit override for every CLI
  • document the patch in the root changelog

Live failure and proof

On sf-mini with Codex 0.144.4, the global 5 ms per-atom default took more than 111 seconds to type the first Relay reminder and never reached the trailing Enter before release. The pending initial task was then dead-lettered as agent_released.

With the equivalent bulk path enabled, a Fleet-targeted Codex worker completed the full CLI flow over Agent Relay:

  • ACK-SF-1751
  • steer via agent-relay message dm send --mode steer
  • RES-SF-1751 host=SF-Mac-Mini.home head=d3573492
  • release via agent-relay fleet release

No claude -p or SSH coordination was used for the proof.

Validation

  • cargo fmt --all -- --check
  • cargo test -p agent-relay-broker --lib (813 passed, 4 ignored)
  • cargo clippy -p agent-relay-broker --lib -- -D warnings
  • git diff --check
  • fresh Agent Relay review on sf-mini: CLAUDE-REVIEW-PASS
  • fresh Agent Relay review on sf-mini: CODEX-REVIEW-PASS

The broader all-target clippy command still reports three pre-existing test-only warnings in snippets.rs, runtime/api.rs, and runtime/worker_events.rs; the production library clippy gate is clean.

Review in cubic

@khaliqgant
khaliqgant requested a review from willwashburn as a code owner July 23, 2026 18:02
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

PTY injection-rate resolution is now CLI-aware: Codex defaults to bulk injection, while other CLIs retain paced injection. RELAY_INJECT_RATE_MS overrides these defaults, including 0 to disable pacing, with unit coverage and a changelog update.

Changes

PTY injection pacing

Layer / File(s) Summary
CLI-specific rate resolution
crates/broker/src/pty_worker.rs
Adds CLI-aware defaults, environment override parsing, and tests for Codex, non-Codex, invalid, blank, zero, and explicit values.
Worker wiring and release note
crates/broker/src/pty_worker.rs, CHANGELOG.md
Passes the resolved CLI into injection-rate selection and documents the Codex bulk-write fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: willwashburn, barryollama

Poem

I’m a rabbit with a keyboard bright,
Bulk-bound tasks now hop just right.
Codex skips the sluggish pace,
Overrides keep their proper place.
One quick write—then ears up high!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main Codex PTY injection change.
Description check ✅ Passed The description includes the summary and validation details, and the main required information is present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/codex-bulk-injection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 8: Update the changelog’s unreleased section heading from “Unreleased -
Patch” to the standard “Unreleased” form, preserving the existing heading level.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a176deea-5a5b-4407-af98-c856673f925c

📥 Commits

Reviewing files that changed from the base of the PR and between d4d0d44 and 71dd98f.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • crates/broker/src/pty_worker.rs

Comment thread CHANGELOG.md
@khaliqgant
khaliqgant merged commit 659e482 into main Jul 25, 2026
39 checks passed
@khaliqgant
khaliqgant deleted the fix/codex-bulk-injection branch July 25, 2026 05:57
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