Commit Graph

4258 Commits

Author SHA1 Message Date
Ahmed Ibrahim
dbd356b39b chore: ci green proof run 2
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:31:48 -08:00
Ahmed Ibrahim
4815a04306 chore: ci green proof run 1
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:31:45 -08:00
Ahmed Ibrahim
cbedebdad5 fix: avoid stdio-to-uds socket read deadlock in test
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:17:04 -08:00
Ahmed Ibrahim
fd620b4fbb chore: data-point commit 6
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:01:23 -08:00
Ahmed Ibrahim
3fc06fde14 chore: data-point commit 5
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:01:19 -08:00
Ahmed Ibrahim
2c84206154 chore: data-point commit 4
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:01:16 -08:00
Ahmed Ibrahim
8bcf6897ff chore: data-point commit 3
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:01:12 -08:00
Ahmed Ibrahim
de5cafaf43 chore: data-point commit 2
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:01:08 -08:00
Ahmed Ibrahim
2378388ed6 chore: data-point commit 1
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 14:01:04 -08:00
Ahmed Ibrahim
9622840751 chore: retrigger ci after cancelled run
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:58:28 -08:00
Ahmed Ibrahim
8729c59558 chore: ci probe marker remove 10
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:11 -08:00
Ahmed Ibrahim
549dd4da66 chore: ci probe marker add 10
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
72ab1249e3 chore: ci probe marker remove 9
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
debd2ff239 chore: ci probe marker add 9
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
0fce5b72e4 chore: ci probe marker remove 8
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
0725aac484 chore: ci probe marker add 8
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
0444499d4a chore: ci probe marker remove 7
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
181c98ca0c chore: ci probe marker add 7
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
31b629dd4b chore: ci probe marker remove 6
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
86cebd5d0e chore: ci probe marker add 6
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
e5552599ec chore: ci probe marker remove 5
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
7e37683e85 chore: ci probe marker add 5
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
3edde7e2ed chore: ci probe marker remove 4
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
782b021c07 chore: ci probe marker add 4
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
52e33b41b3 chore: ci probe marker remove 3
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:10 -08:00
Ahmed Ibrahim
a19b30e5c0 chore: ci probe marker add 3
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:09 -08:00
Ahmed Ibrahim
b5c275be3c chore: ci probe marker remove 2
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:09 -08:00
Ahmed Ibrahim
b94ac7b982 chore: ci probe marker add 2
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:09 -08:00
Ahmed Ibrahim
344bf7e31b chore: ci probe marker remove 1
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:09 -08:00
Ahmed Ibrahim
f9581760b8 chore: ci probe marker add 1
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:09 -08:00
Ahmed Ibrahim
2354f861e7 Fix flaky app-server/core tests and remove temporary logging
Co-authored-by: Codex <noreply@openai.com>
2026-03-04 13:55:09 -08:00
Owen Lin
8dfd654196 feat(app-server-test-client): OTEL setup for tracing (#13493)
### Overview
This PR:
- Updates `app-server-test-client` to load OTEL settings from
`$CODEX_HOME/config.toml` and initializes its own OTEL provider.
- Add real client root spans to app-server test client traces.

This updates `codex-app-server-test-client` so its Datadog traces
reflect the full client-driven flow instead of a set of server spans
stitched together under a synthetic parent.

Before this change, the test client generated a fake `traceparent` once
and reused it for every JSON-RPC request. That kept the requests in one
trace, but there was no real client span at the top, so Datadog ended up
showing the sequence in a slightly misleading way, where all RPCs were
anchored under `initialize`.

Now the test client:
- loads OTEL settings from the normal Codex config path, including
`$CODEX_HOME/config.toml` and existing --config overrides
- initializes tracing the same way other Codex binaries do when trace
export is enabled
- creates a real client root span for each scripted command
- creates per-request client spans for JSON-RPC methods like
`initialize`, `thread/start`, and `turn/start`
- injects W3C trace context from the current client span into
request.trace instead of reusing a fabricated carrier

This gives us a cleaner trace shape in Datadog:
- one trace URL for the whole scripted flow
- a visible client root span
- proper client/server parent-child relationships for each app-server
request
2026-03-04 13:30:09 -08:00
jif-oai
2322e49549 feat: external artifacts builder (#13485)
This PR reverts the built-in artifact render while a decision is being
reached. No impact expected on any features
2026-03-04 20:22:34 +00:00
Felipe Coury
98923e53cc fix(tui): decode ANSI alpha-channel encoding in syntax themes (#13382)
## Problem

The `ansi`, `base16`, and `base16-256` syntax themes are designed to
emit ANSI palette colors so that highlighted code respects the user's
terminal color scheme. Syntect encodes this intent in the alpha channel
of its `Color` struct — a convention shared with `bat` — but
`convert_style` was ignoring it entirely, treating every foreground
color as raw RGB. This caused ANSI-family themes to produce hard-coded
RGB values (e.g. `Rgb(0x02, 0, 0)` instead of `Green`), defeating their
purpose and rendering them as near-invisible dark colors on most
terminals.

Reported in #12890.

## Mental model

Syntect themes use a compact encoding in their `Color` struct:

| `alpha` | Meaning of `r` | Mapped to |
|---------|----------------|-----------|
| `0x00` | ANSI palette index (0–255) | `RtColor::Black`…`Gray` for 0–7,
`Indexed(n)` for 8–255 |
| `0x01` | Unused (sentinel) | `None` — inherit terminal default fg/bg |
| `0xFF` | True RGB red channel | `RtColor::Rgb(r, g, b)` |
| other | Unexpected | `RtColor::Rgb(r, g, b)` (silent fallback) |

This encoding is a bat convention that three bundled themes rely on. The
new `convert_syntect_color` function decodes it; `ansi_palette_color`
maps indices 0–7 to ratatui's named ANSI variants.

| macOS - Dark | macOS - Light | Windows - ansi | Windows - base16 |
|---|---|---|---|
| <img width="1064" height="1205" alt="macos-dark"
src="https://github.com/user-attachments/assets/f03d92fb-b44b-4939-b2b9-503fde133811"
/> | <img width="1073" height="1227" alt="macos-light"
src="https://github.com/user-attachments/assets/2ecb2089-73b5-4676-bed8-e4e6794250b4"
/> |
![windows-ansi](https://github.com/user-attachments/assets/d41029e6-ffd3-454e-ab72-6751607e5d5c)
|
![windows-base16](https://github.com/user-attachments/assets/b48aafcc-0196-4977-8ee1-8f8eaddd1698)
|

## Non-goals

- Background color decoding — we intentionally skip backgrounds to
preserve the terminal's own background. The decoder supports it, but
`convert_style` does not apply it.
- Italic/underline changes — those remain suppressed as before.
- Custom `.tmTheme` support for ANSI encoding — only the bundled themes
use this convention.

## Tradeoffs

- The alpha-channel encoding is an undocumented bat/syntect convention,
not a formal spec. We match bat's behavior exactly, trading formality
for ecosystem compatibility.
- Indices 0–7 are mapped to ratatui's named variants (`Black`, `Red`, …,
`Gray`) rather than `Indexed(0)`…`Indexed(7)`. This lets terminals apply
bold/bright semantics to named colors, which is the expected behavior
for ANSI themes, but means the two representations are not perfectly
round-trippable.

## Architecture

All changes are in `codex-rs/tui/src/render/highlight.rs`, within the
style-conversion layer between syntect and ratatui:

```
syntect::highlighting::Color
  └─ convert_syntect_color(color)  [NEW — alpha-dispatch]
       ├─ a=0x00 → ansi_palette_color()  [NEW — index→named/indexed]
       ├─ a=0x01 → None (terminal default)
       ├─ a=0xFF → Rgb(r,g,b) (standard opaque path)
       └─ other  → Rgb(r,g,b) (silent fallback)
```

`convert_style` delegates foreground mapping to `convert_syntect_color`
instead of inlining the `Rgb(r,g,b)` conversion. The core highlighter is
refactored into `highlight_to_line_spans_with_theme` (accepts an
explicit theme reference) so tests can highlight against specific themes
without mutating process-global state.

### ANSI-family theme contract

The ANSI-family themes (`ansi`, `base16`, `base16-256`) rely on upstream
alpha-channel encoding from two_face/syntect. We intentionally do
**not** validate this contract at runtime — if the upstream format
changes, the `ansi_themes_use_only_ansi_palette_colors` test catches it
at build time, long before it reaches users. A runtime warning would be
unactionable noise.

### Warning copy cleanup

User-facing warning messages were rewritten for clarity:
- Removed internal jargon ("alpha-encoded ANSI color markers", "RGB
fallback semantics", "persisted override config")
- Dropped "syntax" prefix from "syntax theme" — users just think "theme"
- Downgraded developer-only diagnostics (duplicate override, resolve
fallback) from `warn` to `debug`

## Observability

- The `ansi_themes_use_only_ansi_palette_colors` test enforces the
ANSI-family contract at build time.
- The snapshot test provides a regression tripwire for palette color
output.
- User-facing warnings are limited to actionable issues: unknown theme
names and invalid custom `.tmTheme` files.

## Tests

- **Unit tests for each alpha branch:** `alpha=0x00` with low index
(named color), `alpha=0x00` with high index (`Indexed`), `alpha=0x01`
(terminal default), unexpected alpha (falls back to RGB), ANSI white →
Gray mapping.
- **Integration test:**
`ansi_family_themes_use_terminal_palette_colors_not_rgb` — highlights a
Rust snippet with each ANSI-family theme and asserts zero `Rgb`
foreground colors appear.
- **Snapshot test:** `ansi_family_foreground_palette_snapshot` — records
the exact set of unique foreground colors each ANSI-family theme
produces, guarding against regressions.
- **Warning validation tests:** verify user-facing warnings for missing
custom themes, invalid `.tmTheme` files, and bundled theme resolution.

## Test plan

- [ ] `cargo test -p codex-tui` passes all new and existing tests
- [ ] Select `ansi`, `base16`, or `base16-256` theme and verify code
blocks render with terminal palette colors (not near-black RGB)
- [ ] Select a standard RGB theme (e.g. `dracula`) and verify no
regression in color output
2026-03-04 12:03:34 -08:00
pash-openai
b200a5f45b [tui] Update Fast slash command description (#13458)
## Summary
- update the /fast slash command description to mention fastest
inference
- mention the 3X plan usage tradeoff in the help copy

## Testing
- cargo test -p codex-tui slash_command (currently blocked by an
unrelated latest-main codex-tui compile error in chatwidget.rs:
refresh_queued_user_messages missing)

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-04 19:30:51 +00:00
Val Kharitonov
26f4b8e2f1 remove serviceTier from app-server examples (#13489)
Documentation-only
2026-03-04 19:12:40 +00:00
Owen Lin
27724f6ead feat(core, tracing): add a span representing a turn (#13424)
This is PR 3 of the app-server tracing rollout.

PRs https://github.com/openai/codex/pull/13285 and
https://github.com/openai/codex/pull/13368 gave us inbound request spans
in app-server and propagated trace context through Submission. This
change finishes the next piece in core: when a request actually starts a
turn, we now create a core-owned long-lived span that stays open for the
real lifetime of the turn.

What changed:
- `Session::spawn_task` can now optionally create a long-lived turn span
and run the spawned task inside it
- `turn/start` uses that path, so normal turn execution stays under a
single core-owned span after the async handoff
- `review/start` uses the same pattern
- added a unit test that verifies the spawned turn task inherits the
submission dispatch trace ancestry

**Why**
The app-server request span is intentionally short-lived. Once work
crosses into core, we still want one span that covers the actual
execution window until completion or interruption. This keeps that
ownership where it belongs: in the layer that owns the runtime
lifecycle.
2026-03-04 11:09:17 -08:00
iceweasel-oai
54a1c81d73 allow apps to specify cwd for sandbox setup. (#13484)
The electron app doesn't start up the app-server in a particular
workspace directory.
So sandbox setup happens in the app-installed directory instead of the
project workspace.

This allows the app do specify the workspace cwd so that the sandbox
setup actually sets up the ACLs instead of exiting fast and then having
the first shell command be slow.
2026-03-04 10:54:30 -08:00
Alex Daley
8a59386273 add new scopes to login (#12383)
Validated login + refresh flows. Removing scopes from the refresh
request until we have upgrade flow in place. Confirmed that tokens
refresh with existing scopes.
2026-03-04 16:41:54 +00:00
jif-oai
f72ab43fd1 feat: memories in workspace write (#13467) artifact-runtime-v2.3.4 2026-03-04 13:00:26 +00:00
jif-oai
df619474f5 nit: citation prompt (#13468) 2026-03-04 13:00:11 +00:00
jif-oai
e07eaff0d3 feat: add metric for per-turn tool count and add tmp_mem flag (#13456) 2026-03-04 11:25:58 +00:00
jif-oai
bda3c49dc4 feat: disable request input on sub agent (#13460)
https://github.com/openai/codex/issues/13289
2026-03-04 11:25:49 +00:00
jif-oai
e6b2e3a9f7 fix: bad merge (#13461) 2026-03-04 11:00:48 +00:00
jif-oai
e4a202ea52 fix: pending messages in /agent (#13240) 2026-03-04 10:17:29 +00:00
jif-oai
49634b7f9c add metric for per-turn token usage (#13454) 2026-03-04 10:17:25 +00:00
jif-oai
a4ad101125 feat: ordinal nick name (#13412) 2026-03-04 09:41:29 +00:00
jif-oai
932ff28183 feat: better multi-agent prompt (#13404) 2026-03-04 09:41:20 +00:00
Won Park
fa2306b303 image-gen-core (#13290)
Core tool-calling for image-gen, handles requesting and receiving logic
for images using response API
2026-03-03 23:11:28 -08:00
Val Kharitonov
4f6c4bb143 support 'flex' tier in app-server in addition to 'fast' (#13391) 2026-03-03 22:46:05 -08:00