Commit Graph
7366 Commits
Author SHA1 Message Date
Robby He 372de6d2c5 docs: add developer_instructions config option and update descriptions (#8376)
Updates the configuration documentation to clarify and improve the
description of the `developer_instructions` and `instructions` fields.

Documentation updates:

* Added a description for the `developer_instructions` field in
`docs/config.md`, clarifying that it provides additional developer
instructions.
* Updated the comments in `docs/example-config.md` to specify that
`developer_instructions` is injected before `AGENTS.md`, and clarified
that the `instructions` field is ignored and that `AGENTS.md` is
preferred.

___

ref #7973 

Thanks to @miraclebakelaser for the message. I have double-confirmed
that developer instructions are always injected before user
instructions. According to the source code
[codex_core::codex::Session::build_initial_context](https://github.com/openai/codex/blob/rust-v0.77.0-alpha.2/codex-rs/core/src/codex.rs#L1279),
we can see the specific order of these instructions.
2025-12-22 07:37:37 -07:00
jif-oai 7a8407bbb6 chore: un-ship undo (#8424) 2025-12-22 09:53:03 +01:00
Josh McKinney 4e6d6cd798 fix(tui2): constrain transcript mouse selection bounds (#8419)
Ignore mouse events outside the transcript region so composer/footer
interactions do not start or mutate transcript selection state.

A left-click outside the transcript also cancels any active selection.
Selection changes schedule a redraw because mouse events don't
inherently trigger a frame.
2025-12-22 00:11:36 -08:00
Josh McKinney 3c353a3aca test(tui2): re-enable ANSI for VT100 tests (#8423)
Codex Unified Exec injects NO_COLOR=1 (and TERM=dumb) into shell tool
commands to keep output stable. Crossterm respects NO_COLOR and
suppresses ANSI escapes, which breaks our VT100-backed tests that assert
on parsed ANSI color output (they see vt100::Color::Default everywhere).

Force ANSI color output back on in the VT100 test backend by overriding
crossterm's memoized NO_COLOR setting in VT100Backend::new. This keeps
Unified Exec behavior unchanged while making the VT100 tests meaningful
and deterministic under Codex.

> [!WARNING]  
> it's possible that this might be a race condition problem for this and
need to be solved a different way. Feel free to revert if it causes the
opposite problem for other tests that assume NOCOLOR is set. If it does
then we need to probably add some extra AGENTS.md lines for how to run
tests when using unified exec.

(this same change was made in tui, so it's probably safe).
2025-12-22 00:00:32 -08:00
Charlie Weems 99cbba8ea5 Update ghost_commit flag reference to undo (#8091)
Minor documentation update to fix #7966 (documentation of undo flag).
2025-12-21 23:27:54 -08:00
Ahmed Ibrahim aa83d7da24 fix: do not panic on alphas (#8406)
alphas are used sometimes as stable release
2025-12-22 00:20:53 +00:00
Eric Traut d281bcfcd4 Point skills docs to developer documentation site (#8407) 2025-12-21 16:18:58 -08:00
Gav Verma fab1ded484 Remove plan from system skills (#8374)
Removes plan from system skills. It has been rewritten into
`create-plan` for evaluation and feedback:
https://github.com/openai/skills/pull/22
2025-12-20 19:42:53 -08:00
Shijie Rao 987dd7fde3 Chore: remove rmcp feature and exp flag usages (#8087)
### Summary
With codesigning on Mac, Windows and Linux, we should be able to safely
remove `features.rmcp_client` and `use_experimental_use_rmcp_client`
check from the codebase now.
2025-12-20 14:18:00 -08:00
Josh McKinney 63942b883c feat(tui2): tune scrolling inpu based on (#8357)
## TUI2: Normalize Mouse Scroll Input Across Terminals (Wheel +
Trackpad)

This changes TUI2 scrolling to a stream-based model that normalizes
terminal scroll event density into consistent wheel behavior (default:
~3 transcript lines per physical wheel notch) while keeping trackpad
input higher fidelity via fractional accumulation.

Primary code: `codex-rs/tui2/src/tui/scrolling/mouse.rs`

Doc of record (model + probe-derived data):
`codex-rs/tui2/docs/scroll_input_model.md`

### Why

Terminals encode both mouse wheels and trackpads as discrete scroll
up/down events with direction but no magnitude, and they vary widely in
how many raw events they emit per physical wheel notch (commonly 1, 3,
or 9+). Timing alone doesn’t reliably distinguish wheel vs trackpad, so
cadence-based heuristics are unstable across terminals/hardware.

This PR treats scroll input as short *streams* separated by silence or
direction flips, normalizes raw event density into tick-equivalents,
coalesces redraws for dense streams, and exposes explicit config
overrides.

### What Changed

#### Scroll Model (TUI2)

- Stream detection
  - Start a stream on the first scroll event.
  - End a stream on an idle gap (`STREAM_GAP_MS`) or a direction flip.
- Normalization
- Convert raw events into tick-equivalents using per-terminal
`tui.scroll_events_per_tick`.
- Wheel-like vs trackpad-like behavior
- Wheel-like: fixed “classic” lines per wheel notch; flush immediately
for responsiveness.
- Trackpad-like: fractional accumulation + carry across stream
boundaries; coalesce flushes to ~60Hz to avoid floods and reduce “stop
lag / overshoot”.
- Trackpad divisor is intentionally capped: `min(scroll_events_per_tick,
3)` so terminals with dense wheel ticks (e.g. 9 events per notch) don’t
make trackpads feel artificially slow.
- Auto mode (default)
  - Start conservatively as trackpad-like (avoid overshoot).
- Promote to wheel-like if the first tick-worth of events arrives
quickly.
- Fallback for 1-event-per-tick terminals (no tick-completion timing
signal).

#### Trackpad Acceleration

Some terminals produce relatively low vertical event density for
trackpad gestures, which makes large/faster swipes feel sluggish even
when small motions feel correct. To address that, trackpad-like streams
apply a bounded multiplier based on event count:

- `multiplier = clamp(1 + abs(events) / scroll_trackpad_accel_events,
1..scroll_trackpad_accel_max)`

The multiplier is applied to the trackpad stream’s computed line delta
(including carried fractional remainder). Defaults are conservative and
bounded.

#### Config Knobs (TUI2)

All keys live under `[tui]`:

- `scroll_wheel_lines`: lines per physical wheel notch (default: 3).
- `scroll_events_per_tick`: raw vertical scroll events per physical
wheel notch (terminal-specific default; fallback: 3).
- Wheel-like per-event contribution: `scroll_wheel_lines /
scroll_events_per_tick`.
- `scroll_trackpad_lines`: baseline trackpad sensitivity (default: 1).
- Trackpad-like per-event contribution: `scroll_trackpad_lines /
min(scroll_events_per_tick, 3)`.
- `scroll_trackpad_accel_events` / `scroll_trackpad_accel_max`: bounded
trackpad acceleration (defaults: 30 / 3).
- `scroll_mode = auto|wheel|trackpad`: force behavior or use the
heuristic (default: `auto`).
- `scroll_wheel_tick_detect_max_ms`: auto-mode promotion threshold (ms).
- `scroll_wheel_like_max_duration_ms`: auto-mode fallback for
1-event-per-tick terminals (ms).
- `scroll_invert`: invert scroll direction (applies to wheel +
trackpad).

Config docs: `docs/config.md` and field docs in
`codex-rs/core/src/config/types.rs`.

#### App Integration

- The app schedules follow-up ticks to close idle streams (via
`ScrollUpdate::next_tick_in` and `schedule_frame_in`) and finalizes
streams on draw ticks.
  - `codex-rs/tui2/src/app.rs`

#### Docs

- Single doc of record describing the model + preserved probe
findings/spec:
  - `codex-rs/tui2/docs/scroll_input_model.md`

#### Other (jj-only friendliness)

- `codex-rs/tui2/src/diff_render.rs`: prefer stable cwd-relative paths
when the file is under the cwd even if there’s no `.git`.

### Terminal Defaults

Per-terminal defaults are derived from scroll-probe logs (see doc).
Notable:

- Ghostty currently defaults to `scroll_events_per_tick = 3` even though
logs measured ~9 in one setup. This is a deliberate stopgap; if your
Ghostty build emits ~9 events per wheel notch, set:

  ```toml
  [tui]
  scroll_events_per_tick = 9
  ```

### Testing

- `just fmt`
- `just fix -p codex-core --allow-no-vcs`
- `cargo test -p codex-core --lib` (pass)
- `cargo test -p codex-tui2` (scroll tests pass; remaining failures are
known flaky VT100 color tests in `insert_history`)

### Review Focus

- Stream finalization + frame scheduling in `codex-rs/tui2/src/app.rs`.
- Auto-mode promotion thresholds and the 1-event-per-tick fallback
behavior.
- Trackpad divisor cap (`min(events_per_tick, 3)`) and acceleration
defaults.
- Ghostty default tradeoff (3 vs ~9) and whether we should change it.
2025-12-20 12:48:12 -08:00
Michael Bolin 63762b2481 merge commit for archive created by Sapling 2025-12-19 23:48:08 -08:00
Michael Bolin 78f679b1ce feat: add support for project_root_markers in config.toml 2025-12-19 23:48:00 -08:00
Michael Bolin 7f38c988fb feat: support in-repo .codex/config.toml entries as sources of config info 2025-12-19 23:38:30 -08:00
Michael Bolin 2570fc2cba merge commit for archive created by Sapling 2025-12-19 22:18:19 -08:00
Michael Bolin 3374782fba feat: support in-repo .codex/config.toml entries as sources of config info 2025-12-19 22:17:38 -08:00
Michael Bolin d01869ee92 Merge fe14df10a7 into sapling-pr-archive-bolinfest 2025-12-19 22:04:05 -08:00
Michael Bolin fe14df10a7 feat: support in-repo .codex/config.toml entries as sources of config info 2025-12-19 22:04:02 -08:00
Michael Bolin 09ec2300f2 merge commit for archive created by Sapling 2025-12-19 22:02:11 -08:00
Michael Bolin c35f47c9b4 feat: support in-repo .codex/config.toml entries as sources of config info 2025-12-19 22:02:07 -08:00
Michael Bolin c6c98abee9 merge commit for archive created by Sapling 2025-12-19 22:01:49 -08:00
Michael Bolin cc2a4ed7e6 feat: support in-repo .codex/config.toml entries as sources of config info 2025-12-19 22:01:44 -08:00
Michael Bolin 804a6ad870 merge commit for archive created by Sapling 2025-12-19 21:52:45 -08:00
Michael Bolin 5176630127 feat: support in-repo .codex/config.toml entries as sources of config info 2025-12-19 21:52:39 -08:00
Michael Bolin 740d2e0d53 merge commit for archive created by Sapling 2025-12-19 20:20:35 -08:00
Michael Bolin d54427812e feat: support in-repo .codex/config.toml entries as sources of config info 2025-12-19 20:20:06 -08:00
Michael Bolin a6974087e5 chore: enusre the logic that creates ConfigLayerStack has access to cwd (#8353)
`load_config_layers_state()` should load config from a
`.codex/config.toml` in any folder between the `cwd` for a thread and
the project root. Though in order to do that,
`load_config_layers_state()` needs to know what the `cwd` is, so this PR
does the work to thread the `cwd` through for existing callsites.

A notable exception is the `/config` endpoint in app server for which a
`cwd` is not guaranteed to be associated with the query, so the `cwd`
param is `Option<AbsolutePathBuf>` to account for this case.

The logic to make use of the `cwd` will be done in a follow-up PR.
2025-12-19 20:11:27 -08:00
Michael Bolin 8ea54d5e9e Merge b11a453498 into sapling-pr-archive-bolinfest 2025-12-19 18:43:21 -08:00
Michael Bolin b11a453498 chore: enusre the logic that creates ConfigLayerStack has access to cwd 2025-12-19 18:43:17 -08:00
Michael Bolin 64fea6e7e6 merge commit for archive created by Sapling 2025-12-19 18:41:26 -08:00
Michael Bolin 4edd4d3c3f chore: enusre the logic that creates ConfigLayerStack has access to cwd 2025-12-19 18:41:18 -08:00
Michael Bolin 3e4f654bce merge commit for archive created by Sapling 2025-12-19 18:35:40 -08:00
Michael Bolin 08a2f423ba chore: enusre the logic that creates ConfigLayerStack has access to cwd 2025-12-19 18:35:31 -08:00
Michael Bolin 8e3c84f6c7 merge commit for archive created by Sapling 2025-12-19 18:13:08 -08:00
Michael Bolin e3c9421f7f chore: enusre the logic that creates ConfigLayerStack has access to cwd 2025-12-19 18:13:00 -08:00
Michael Bolin 13c4bd7e6b Merge 41833c879b into sapling-pr-archive-bolinfest 2025-12-19 18:02:33 -08:00
Michael Bolin 41833c879b chore: enusre the logic that creates ConfigLayerStack has access to cwd 2025-12-19 18:02:24 -08:00
Ahmed Ibrahim f0dc6fd3c7 Rename OpenAI models to models manager (#8346)
# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.
2025-12-19 16:20:05 -08:00
sayan-oai 797a68b9f2 bump cargo-deny-action ver (#8345) 2025-12-19 15:23:02 -08:00
Michael Bolin dc61fc5f50 feat: support allowed_sandbox_modes in requirements.toml (#8298)
This adds support for `allowed_sandbox_modes` in `requirements.toml` and
provides legacy support for constraining sandbox modes in
`managed_config.toml`. This is converted to `Constrained<SandboxPolicy>`
in `ConfigRequirements` and applied to `Config` such that constraints
are enforced throughout the harness.

Note that, because `managed_config.toml` is deprecated, we do not add
support for the new `external-sandbox` variant recently introduced in
https://github.com/openai/codex/pull/8290. As noted, that variant is not
supported in `config.toml` today, but can be configured programmatically
via app server.
2025-12-19 21:09:20 +00:00
Michael Bolin 736a04f71d merge commit for archive created by Sapling 2025-12-19 12:52:57 -08:00
Michael Bolin 88bb409c84 feat: support allowed_sandbox_modes in requirements.toml 2025-12-19 12:52:52 -08:00
RQfreefly ec3738b47e feat: move file name derivation into codex-file-search (#8334)
## Summary

  - centralize file name derivation in codex-file-search
  - reuse the helper in app-server fuzzy search to avoid duplicate logic
  - add unit tests for file_name_from_path

  ## Testing

  - cargo test -p codex-file-search
  - cargo test -p codex-app-server
2025-12-19 12:50:55 -08:00
Josh McKinney 1d4463ba81 feat(tui2): coalesce transcript scroll redraws (#8295)
Problem
- Mouse wheel events were scheduling a redraw on every event, which
could backlog and create lag during fast scrolling.

Solution
- Schedule transcript scroll redraws with a short delay (16ms) so the
frame requester coalesces bursts into fewer draws.

Why
- Smooths rapid wheel scrolling while keeping the UI responsive.

Testing
- Manual: Scrolled in iTerm and Ghostty; no lag observed.
- `cargo clippy --fix --all-features --tests --allow-dirty
--allow-no-vcs -p codex-tui2`
2025-12-19 12:19:01 -08:00
Michael Bolin a585800106 merge commit for archive created by Sapling 2025-12-19 12:17:39 -08:00
Michael Bolin 552df01861 feat: support allowed_sandbox_modes in requirements.toml 2025-12-19 12:13:59 -08:00
github-actions[bot]andaibrahim-oai e3d3445748 Update models.json (#8168)
Automated update of models.json.

Co-authored-by: aibrahim-oai <219906144+aibrahim-oai@users.noreply.github.com>
2025-12-19 12:06:34 -08:00
Michael Bolin 40a5809cc6 merge commit for archive created by Sapling 2025-12-19 11:29:56 -08:00
Michael Bolin a2fd63643e feat: support allowed_sandbox_modes in requirements.toml 2025-12-19 11:29:49 -08:00
Michael Bolin 0a7021de72 fix: enable resume_warning that was missing from mod.rs (#8333)
This test was introduced in https://github.com/openai/codex/pull/6507,
but was not included in `mod.rs`. It does not appear that it was getting
compiled?
2025-12-19 19:21:47 +00:00
Michael Bolin ce429b29c3 Merge fc9fb9c8a2 into sapling-pr-archive-bolinfest 2025-12-19 11:16:32 -08:00