CodeVetter · Repo Unpack · Contributor handoff
openai/codex
Work in `codex-rs` unless the task is the Node launcher or the TS/Python SDK. Read AGENTS.md before editing. Prefer a new crate or a new module over growing `codex-core`, `chatwidget.rs`, or `app.rs`. Run `just fmt` after edits and `just test -p <crate>` for the crate you touched. Do not hand-edit generated schema without the just recipe. Do not touch sandbox env-var constants. Match existing clap, serde, and ratatui styles. Integration tests, not unit tests, are required for agent-loop changes.
- Style traps: inline `format!` args; collapse nested ifs; prefer method references; no `#[async_trait]` or `#[allow(async_fn_in_trait)]` — use RPITIT with `impl Future<Output = T> + Send`. Avoid boolean or ambiguous `Option` parameters. Positional `None`/bool/number literals need `/*param_name*/` comments.
- TUI style traps: use ratatui `Stylize` (`"text".dim()`, `.red()`) rather than `Span::styled`. Do not use `.white()`. Wrap plain strings with `textwrap::wrap` and ratatui lines with `tui/src/wrapping.rs`. Prefix lines with `prefix_lines` from line_utils. UI changes need insta snapshots.
- Do not edit `CODEX_SANDBOX_NETWORK_DISABLED` or `CODEX_SANDBOX` plumbing. Those constants exist so tests skip when the agent harness has already sandboxed the process. Changing them breaks CI and the sandbox contract.
- Module size trap: files over ~800 LoC should gain a new module, not more methods. `chatwidget.rs` in particular should not grow standalone methods. When extracting, move the tests and the doc comment with the code.
- Tracing trap: instrument the function definition with `#[tracing::instrument]`, not `.instrument()` at the callsite, and do not double-instrument a callee that already has the attribute.
- Test authoring trap: agent behavior belongs in `core/suite` using `mount_sse_once` and `pretty_assertions`. Do not add tests that only assert static tables, do not add negative tests for removed logic, and do not put test-only helpers on the public crate API.
- Docs trap: do not add product docs under `docs/` except app-server API docs. Contributor rules live in `AGENTS.md`; user docs (`config.md`, `sandbox.md`, `exec.md`, `authentication.md`) are the existing canonical pages and should be updated in place rather than duplicated.