Commit Graph

8490 Commits

Author SHA1 Message Date
Michael Bolin
cbee448ac4 merge commit for archive created by Sapling 2026-02-25 15:01:03 -08:00
Michael Bolin
56de2a411b feat: include available decisions in command approval requests 2026-02-25 15:00:54 -08:00
Michael Bolin
c88bdad675 Merge 0aa942c125 into sapling-pr-archive-bolinfest 2026-02-25 14:52:34 -08:00
Michael Bolin
0aa942c125 feat: include available decisions in command approval requests 2026-02-25 14:52:29 -08:00
Michael Bolin
e4d21de6cb merge commit for archive created by Sapling 2026-02-25 14:51:52 -08:00
Michael Bolin
b9887e2c0d feat: include available decisions in command approval requests 2026-02-25 14:51:46 -08:00
Michael Bolin
c1ca7aad24 merge commit for archive created by Sapling 2026-02-25 14:51:09 -08:00
Michael Bolin
a6e83ef28e feat: include available decisions in command approval requests 2026-02-25 14:50:51 -08:00
Celia Chen
b6d20748e0 Revert "Ensure shell command skills trigger approval (#12697)" (#12721)
This reverts commit daf0f03ac8.

# 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.
2026-02-25 22:49:53 +00:00
Michael Bolin
2569ac2006 Merge 9f008e0faa into sapling-pr-archive-bolinfest 2026-02-25 14:40:55 -08:00
Michael Bolin
9f008e0faa feat: scope execve session approvals by approved skill metadata 2026-02-25 14:40:32 -08:00
Ahmed Ibrahim
f86087eaa8 Revert "only use preambles for realtime" (#12830)
Reverts openai/codex#12806
2026-02-25 14:30:48 -08:00
Michael Bolin
ad130d641b merge commit for archive created by Sapling 2026-02-25 14:29:03 -08:00
Michael Bolin
73224678bf feat: scope execve session approvals by approved skill metadata 2026-02-25 14:28:19 -08:00
Michael Bolin
7707752ae1 feat: include available decisions in command approval requests 2026-02-25 14:28:19 -08:00
Ahmed Ibrahim
c1851be1ed only use preambles for realtime (#12806)
# 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.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-02-25 13:41:54 -08:00
Michael Bolin
a8ae76a5ae merge commit for archive created by Sapling 2026-02-25 13:33:25 -08:00
Michael Bolin
43daba8cb6 feat: scope execve session approvals by approved skill metadata 2026-02-25 13:33:16 -08:00
Owen Lin
21f7032dbb feat(app-server): thread/unsubscribe API (#10954)
Adds a new v2 app-server API for a client to be able to unsubscribe to a
thread:
- New RPC method: `thread/unsubscribe`
- New server notification: `thread/closed`

Today clients can start/resume/archive threads, but there wasn’t a way
to explicitly unload a live thread from memory without archiving it.
With `thread/unsubscribe`, a client can indicate it is no longer
actively working with a live Thread. If this is the only client
subscribed to that given thread, the thread will be automatically closed
by app-server, at which point the server will send `thread/closed` and
`thread/status/changed` with `status: notLoaded` notifications.

This gives clients a way to prevent long-running app-server processes
from accumulating too many thread (and related) objects in memory.

Closed threads will also be removed from `thread/loaded/list`.
2026-02-25 13:14:30 -08:00
Michael Bolin
1acbef8d92 merge commit for archive created by Sapling 2026-02-25 13:11:49 -08:00
Michael Bolin
ddf331f618 feat: scope execve session approvals by approved skill metadata 2026-02-25 13:11:38 -08:00
Michael Bolin
e87fabb967 Merge 4eaec7be7d into sapling-pr-archive-bolinfest 2026-02-25 13:02:32 -08:00
Michael Bolin
2383104d3f feat: include available decisions in command approval requests 2026-02-25 13:02:23 -08:00
Michael Bolin
4eaec7be7d feat: scope execve session approvals by approved skill metadata 2026-02-25 13:02:23 -08:00
sayan-oai
d45ffd5830 make 5.3-codex visible in cli for api users (#12808)
5.3-codex released in api, mark it visible for API users via bundled
`models.json`.
2026-02-25 13:01:40 -08:00
Michael Bolin
4cae7ce19c Merge a8d528affb into sapling-pr-archive-bolinfest 2026-02-25 12:37:47 -08:00
Michael Bolin
a8d528affb feat: scope execve session approvals by approved skill metadata 2026-02-25 12:37:28 -08:00
Michael Bolin
86b4ebc19e Merge 7d9c3547fe into sapling-pr-archive-bolinfest 2026-02-25 12:30:11 -08:00
Michael Bolin
f523c45e65 feat: include available decisions in command approval requests 2026-02-25 12:29:40 -08:00
Michael Bolin
7d9c3547fe feat: scope execve session approvals by approved skill metadata 2026-02-25 12:29:40 -08:00
Michael Bolin
be5bca6f8d fix: harden zsh fork tests and keep subcommand approvals deterministic (#12809)
## Why
The prior
`turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2`
assertion was brittle under Bazel: command approval payloads in the test
could include environment-dependent wrapper/command formatting
differences, which makes exact command-string matching flaky even when
behavior is correct.

(This regression was knowingly introduced in
https://github.com/openai/codex/pull/12800, but it was urgent to land
that PR.)

## What changed
- Hardened
`turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2`
in
[`turn_start_zsh_fork.rs`](https://github.com/openai/codex/blob/main/codex-rs/app-server/tests/suite/v2/turn_start_zsh_fork.rs):
- Replaced strict `approval_command.starts_with("/bin/rm")` checks with
intent-based subcommand matching.
- Subcommand approvals are now recognized by file-target semantics
(`first.txt` or `second.txt`) plus `rm` intent.
- Parent approval recognition is now more tolerant of command-format
differences while still requiring a definitive parent command context.
- Uses a defensive loop that waits for all target subcommand decisions
and the parent approval request.
- Preserved the existing regression and unit test fixes from earlier
commits in `unix_escalation.rs` and `skill_approval.rs`.

## Verification
- Ran the zsh fork subcommand decline regression under this change:
-
`turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2`
- Confirmed the test is now robust against approval-command-string
variation instead of hardcoding one expected command shape.
2026-02-25 12:23:30 -08:00
Eric Traut
f6fdfbeb98 Update Codex docs success link (#12805)
Fix a stale documentation link in the sign-in flow
2026-02-25 12:02:41 -08:00
Ahmed Ibrahim
3f30746237 Add simple realtime text logs (#12807)
Update realtime debug logs to include the actual text payloads in both
input and output paths.

- In `core/src/realtime_conversation.rs`:
- `handle_start`: add extracted assistant text output to the
`[realtime-text]` debug log.
- `handle_text`: add incoming text input (`params.text`) to the
`[realtime-text]` debug log.

No tests were run (per request).
2026-02-25 12:01:48 -08:00
Owen Lin
a0fd94bde6 feat(app-server): add ThreadItem::DynamicToolCall (#12732)
Previously, clients would call `thread/start` with dynamic_tools set,
and when a model invokes a dynamic tool, it would just make the
server->client `item/tool/call` request and wait for the client's
response to complete the tool call. This works, but it doesn't have an
`item/started` or `item/completed` event.

Now we are doing this:
- [new] emit `item/started` with `DynamicToolCall` populated with the
call arguments
- send an `item/tool/call` server request
- [new] once the client responds, emit `item/completed` with
`DynamicToolCall` populated with the response.

Also, with `persistExtendedHistory: true`, dynamic tool calls are now
reconstructable in `thread/read` and `thread/resume` as
`ThreadItem::DynamicToolCall`.
2026-02-25 12:00:10 -08:00
Michael Bolin
685b91c326 Merge dd82918404 into sapling-pr-archive-bolinfest 2026-02-25 11:20:26 -08:00
Michael Bolin
dd82918404 fix: make turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2 succeed on Bazel 2026-02-25 11:20:18 -08:00
Rasmus Rygaard
73eaebbd1c Propagate session ID when compacting (#12802)
We propagate the session ID when sending requests for inference but we
don't do the same for compaction requests. This makes it hard to link
compaction requests to their session for debugging purposes
2026-02-25 19:17:38 +00:00
Michael Bolin
648a420cbf fix: enforce sandbox envelope for zsh fork execution (#12800)
## Why
Zsh fork execution was still able to bypass the `WorkspaceWrite` model
in edge cases because the fork path reconstructed command execution
without preserving sandbox wrappers, and command extraction only
accepted shell invocations in a narrow positional shape. This can allow
commands to run with broader filesystem access than expected, which
breaks the sandbox safety model.

## What changed
- Preserved the sandboxed `ExecRequest` produced by
`attempt.env_for(...)` when entering the zsh fork path in
[`unix_escalation.rs`](https://github.com/openai/codex/blob/main/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs).
- Updated `CoreShellCommandExecutor` to execute the sandboxed command
and working directory captured from `attempt.env_for(...)`, instead of
re-running a freshly reconstructed shell command.
- Made zsh-fork script extraction robust to wrapped invocations by
scanning command arguments for `-c`/`-lc` rather than only matching the
first positional form.
- Added unit tests in `unix_escalation.rs` to lock in wrapper-tolerant
parsing behavior and keep unsupported shell forms rejected.
- Tightened the regression in
[`skill_approval.rs`](https://github.com/openai/codex/blob/main/codex-rs/core/tests/suite/skill_approval.rs):
- `shell_zsh_fork_still_enforces_workspace_write_sandbox` now uses an
explicit `WorkspaceWrite` policy with `exclude_tmpdir_env_var: true` and
`exclude_slash_tmp: true`.
- The test attempts to write to `/tmp/...`, which is only reliably
outside writable roots with those explicit exclusions set.

## Verification
- Added and passed the new unit tests around `extract_shell_script`
parsing behavior with wrapped command shapes.
  - `extract_shell_script_supports_wrapped_command_prefixes`
  - `extract_shell_script_rejects_unsupported_shell_invocation`
- Verified the regression with the focused integration test:
`shell_zsh_fork_still_enforces_workspace_write_sandbox`.

## Manual Testing

Prior to this change, if I ran Codex via:

```
just codex --config zsh_path=/Users/mbolin/code/codex2/codex-rs/app-server/tests/suite/zsh --enable shell_zsh_fork
```

and asked:

```
what is the output of /bin/ps
```

it would run it, even though the default sandbox should prevent the
agent from running `/bin/ps` because it is setuid on MacOS.

But with this change, I now see the expected failure because it is
blocked by the sandbox:

```
/bin/ps exited with status 1 and produced no output in this environment.
```
2026-02-25 11:05:27 -08:00
Michael Bolin
c79fe45647 merge commit for archive created by Sapling 2026-02-25 10:54:18 -08:00
Michael Bolin
0bef1901f7 fix: zsh-shell-fork was not honoring sandbox 2026-02-25 10:54:10 -08:00
Michael Bolin
1fb2583be8 merge commit for archive created by Sapling 2026-02-25 10:47:40 -08:00
Michael Bolin
e94c837e7c fix: zsh-shell-fork was not honoring sandbox 2026-02-25 10:47:30 -08:00
Michael Bolin
53a0a2457b Merge 520ae99801 into sapling-pr-archive-bolinfest 2026-02-25 10:38:26 -08:00
Michael Bolin
520ae99801 fix: zsh-shell-fork was not honoring sandbox 2026-02-25 10:38:17 -08:00
pakrym-oai
9d7013eab0 Handle websocket timeout (#12791)
Sometimes websockets will timeout with 400 error, ensure we retry it.
2026-02-25 10:31:37 -08:00
jif-oai
7b39e76a66 Revert "fix(bazel): replace askama templates with include_str! in memories" (#12795)
Reverts openai/codex#11778
2026-02-25 18:06:17 +00:00
Ahmed Ibrahim
947092283a Add app-server v2 thread realtime API (#12715)
Add experimental `thread/realtime/*` v2 requests and notifications, then
route app-server realtime events through that thread-scoped surface with
integration coverage.

---------

Co-authored-by: Codex <noreply@openai.com>
2026-02-25 09:59:10 -08:00
Curtis 'Fjord' Hawthorne
0543d0a022 Promote js_repl to experimental with Node requirement (#12712)
## Summary

- Promote `js_repl` to an experimental feature that users can enable
from `/experimental`.
- Add `js_repl` experimental metadata, including the Node prerequisite
and activation guidance.
- Add regression coverage for the feature metadata and the
`/experimental` popup.

## What Changed

- Changed `Feature::JsRepl` from `Stage::UnderDevelopment` to
`Stage::Experimental`.
- Added experimental metadata for `js_repl` in `core/src/features.rs`:
  - name: `JavaScript REPL`
- description: calls out interactive website debugging, inline
JavaScript execution, and the required Node version (`>= v24.13.1`)
- announcement: tells users to enable it, then start a new chat or
restart Codex
- Added a core unit test that verifies:
  - `js_repl` is experimental
  - `js_repl` is disabled by default
- the hardcoded Node version in the description matches
`node-version.txt`
- Added a TUI test that opens the `/experimental` popup and verifies the
rendered `js_repl` entry includes the Node requirement text.

## Testing

- `just fmt`
- `cargo test -p codex-tui`
- `cargo test -p codex-core` (unit-test phase passed; stopped during the
long `tests/all.rs` integration suite)
2026-02-25 09:44:52 -08:00
Michael Bolin
593630a088 merge commit for archive created by Sapling 2026-02-25 09:21:52 -08:00
Michael Bolin
e045e06d6c feat: include availableDecisions with command approvals 2026-02-25 09:19:43 -08:00