Repository navigation
refactor(executor): modularize Codex runtime - #2136
Conversation
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe Codex executor was reorganized into dedicated modules for home management, diagnostics, interaction routing, and run-state processing. The main orchestration file now wires these modules, while tests and architecture documentation were moved or updated accordingly. ChangesCodex runtime modularization
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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 `@executor/src/agents/codex/diagnostics.rs`:
- Around line 34-39: Update raw_log_preview and its sanitize_raw_log_value path
to prevent secrets from appearing in previews: redact sensitive key, token,
API-key, authentication-file, and content fields or apply a safe allowlist
before serialization and truncation. Preserve useful non-sensitive diagnostics,
and add a regression test covering representative secret values and asserting
none appear in the generated preview.
In `@executor/src/agents/codex/home.rs`:
- Around line 160-165: Update executor_home’s WEGENT_EXECUTOR_HOME lookup to
reject empty environment values before converting them to PathBuf, matching
wework_codex_home’s !value.is_empty() handling; preserve the existing
home-directory and relative fallback behavior for absent or empty values.
In `@executor/src/agents/codex/interaction.rs`:
- Around line 29-51: The answer-routing loop in the spawned interaction receiver
silently discards responses when interaction_answer_key returns no key and
state.pending is not exactly one entry. Update this branch to make unroutable
answers observable by logging the discarded answer and relevant routing context,
while preserving normal keyed delivery and single-pending fallback behavior.
- Around line 55-73: Update receive so it checks state.pending for an existing
correlation key before inserting the new oneshot sender. Return the duplicate
pending interaction error without modifying the existing entry, preserving the
original waiter's sender and response routing.
In `@executor/src/agents/codex/run_state.rs`:
- Around line 350-363: Update log_codex_run_state_error to pass params through
the existing raw_log_preview sanitization helper, matching
log_codex_raw_turn_message, before truncating and logging params_preview. Remove
the direct unsanitized serialization path while preserving the existing
serialization-failure handling and logged fields.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 34eb15dc-2d25-4f84-aaf0-1823ac4d2eee
📒 Files selected for processing (8)
docs/en/wegent/developer-guide/architecture.mddocs/zh/wegent/developer-guide/architecture.mdexecutor/src/agents/codex.rsexecutor/src/agents/codex/diagnostics.rsexecutor/src/agents/codex/home.rsexecutor/src/agents/codex/interaction.rsexecutor/src/agents/codex/run_state.rsexecutor/src/agents/codex/tests.rs
Summary
Why
executor/src/agents/codex.rsmixed configuration, authentication, interaction correlation, event reduction, diagnostics, orchestration, and tests in one high-churn file. Separating stable responsibility boundaries reduces coupling while preserving the public API and runtime behavior.Impact
No protocol or user-facing behavior changes.
codex.rsremains the public API and orchestration layer; focused implementation and tests now live underexecutor/src/agents/codex/.Validation
cargo test --manifest-path executor/Cargo.toml --no-fail-fastcargo clippy --manifest-path executor/Cargo.toml --all-targets -- -D warningscargo fmt --check,cargo test --all-features --lib,cargo clippyCodex重构验证通过Summary by CodeRabbit
Documentation
Bug Fixes
Tests