Commit Graph
13086 Commits
Author SHA1 Message Date
Eric Traut 2f83e4843f Surface session lookup errors in the TUI (#64014)
## Why

Looking up a session by ID treated every `thread/read` failure as a
missing session, hiding errors such as unreadable session metadata.

## What changed

Startup resume and fork report lookup failures after cleaning up the
app-server session. In an active TUI, `/resume` displays lookup errors
in the current chat or invokes transport recovery when applicable. If
a Cloud chat must be opened first, `/resume` directs the user to run
the command without an ID and select the chat from the picker.

## Testing

Add regression coverage for missing and unreadable sessions, preserving
the active session after a failed lookup, and showing picker guidance
for an unopened Cloud chat.

GitOrigin-RevId: dddac289a2959133809c050b8701975ab474ef13
2026-11-25 22:54:19 +00:00
Eric Traut 653def34fb Preserve native exit codes in Windows PowerShell hooks (#64013)
## Why

PowerShell's `-Command` can report a native command's exit code `2` as
`1`, so a `PreToolUse` hook can fail to block a tool call.

## What changed

Use `$?` to preserve successful hook results and forward
`$LASTEXITCODE` on failure when available. Pass scripts with named
blocks through as written because PowerShell forbids trailing
top-level statements after those blocks.

## Testing

Add Windows regression coverage for a native command and a PowerShell
`end` block that each exit with code `2`. Both cases check that
`PreToolUse` denies `apply_patch` before approval, reports the denial
reason, and leaves the target file uncreated.

GitOrigin-RevId: 9668b1382bb56f168794dd8d4d2fecac13d2f649
2026-11-25 22:53:41 +00:00
sayan-oai e54baff042 Move environment selection tests into a dedicated file (#64012)
Move the existing selection, readiness, and configuration inheritance
tests into `environment_selection_tests.rs` and keep them wired up as
the `environment_selection::tests` module.

GitOrigin-RevId: 304944a8875c5d92e21bcc2ab39e760e41083d37
2026-11-25 22:53:05 +00:00
teddywyly-oai 3d5a786a20 Clean up abandoned MCP sessions during HTTP recovery (#64011)
## Why

A Streamable HTTP server can assign a replacement session ID before the
initialization handshake finishes. If recovery fails or times out at
that point, the abandoned session can occupy server capacity needed by
the next attempt.

## What changed

- Track replacement sessions as soon as the server returns
  `Mcp-Session-Id`. Coordinate a single `DELETE` between handshake cleanup
  and SDK teardown, leaving successfully initialized sessions active.
- Let cleanup finish in the background when the caller's deadline
  expires. Coordinate cleanup with OAuth refresh so the deletion can use
  updated credentials.
- Keep the service, OAuth state, and expiry signal together for each
  connection. Keep recovery scoped to the failed connection and
  recheck client state before returning a replacement so shutdown can
  take precedence.

## Testing

Cover interrupted JSON and SSE handshakes, cleanup before retry on a
server with limited session capacity, OAuth refresh during cleanup,
concurrent calls on expired sessions, and recovery racing with shutdown.

GitOrigin-RevId: 0caa1b1271f4e7ae667f90f15bfa86b1bdfe7d0b
2026-11-25 22:52:27 +00:00
Joe Savona 09b1cfd337 Add inline badges to custom statuslines (#64010)
Add a `badge` element to the statusline UI tree and TypeScript contract.
It renders one string as a padded, single-line label with normalized
whitespace. The optional `color` accepts `secondary` (the default),
`info`, `success`, `warning`, or `danger`. The renderer uses the
active theme for the label and blends the fill with the surrounding
background when its color is known.

Badges wrap as a unit. When a line limit requires an ellipsis after
earlier content, a trailing badge that cannot fit is dropped. At the
viewport edge, the right padding can clip while the full label remains
visible.

## Testing

Add rendering tests for wrapping, clipping, theme colors, and linked
badges, along with checks for UI tree limits and the TypeScript contract.

GitOrigin-RevId: be9e9799d6832976d325ba5fda48f5793dbbc722
2026-11-25 22:51:53 +00:00
Joe Savona 8d8de8f693 Add flexible spacers to custom statusline layouts (#64009)
## Why

Statusline authors can set fixed gaps or justify a whole row. An expandable gap lets them place a field at the far edge by putting a spacer between it and the other fields.

## What changed

Add the empty `spacer` element to the statusline renderer and its bundled TypeScript contract. Spacers share the remaining width on each wrapped row line before `justify` is applied. In columns stretched by a taller sibling, spacers share the added height.

## Testing

Add renderer tests for wrapped and nested layouts, background fill, and clipping. Cover empty spacer declarations and reject spacer children in the parser and TypeScript contract tests.

GitOrigin-RevId: d8bb58304b2a1f10ac0c60ec198aa3c25a169cae
2026-11-25 22:51:18 +00:00
Joe Savona 163c555f18 Add a directional box element for custom status lines (#64008)
## What changed

Custom status lines can choose between row and column layouts by setting
`direction` on a `box`. Omitting `direction` stacks children in a column.
Both layouts require `gap`, and only rows accept `wrap` and `justify`.

Horizontal boxes group adjacent strings into one layout item even when
`justify` is omitted. Use separate elements to insert a gap between
text items.

## Testing

Add renderer tests for default column layout, wrapping and alignment in
rows, and spacing around empty boxes. Extend the TypeScript contract
checks to cover dynamic direction, required gaps, and rejection of
row-only props on columns.

GitOrigin-RevId: 3ff9b4a8be6ae79b90512c1ad1ec1c16dafad0cf
2026-11-25 22:50:40 +00:00
Joe Savona b8498ada1c Add maxLines to statusline text blocks (#64007)
## Why

Long statusline text can wrap across enough lines to push fields below it out of view.

## What changed

Set `maxLines` to a positive safe integer to cap a text block after wrapping. If content exceeds the cap, the last visible line ends with an ellipsis when space permits. Long words can break at grapheme boundaries so a clamped block can shrink alongside other fields.

## Testing

Cover invalid limits, visibility of neighboring fields, and truncation that preserves whole graphemes and leaves the ellipsis outside hyperlinks.

GitOrigin-RevId: 42f57b3f92e81860f888b733ce6121bb94dc78c3
2026-11-25 22:50:04 +00:00
Eric Traut 897d47ac95 Batch native scrollback replays during history refill (#64005)
## Why

Refilling terminal scrollback can take several history pages. Replaying
scrollback after each page rebuilds it while more history is still loading.

## What changed

Buffer older pages while the next page is loading, then replay them together
when the refill finishes. Flush buffered history if a page request fails,
the transcript overlay opens during the refill, or the five-second deadline
from the first buffered page expires. The overlay still updates page by page.

## Testing

Extend the scrollback refill test to cover batching across pages, replay
after a page failure, and replay at the deadline with a request still pending.

GitOrigin-RevId: 577b9f7394e2741267099e4595f69345a6a70a21
2026-11-25 22:48:50 +00:00
jif 9b6a7e3d0e Update the TUI thread replay snapshot to include composer borders (#64004)
GitOrigin-RevId: ba97eedebbe9558cd698f0af4955a16c3041c5aa
2026-11-25 22:48:14 +00:00
jif 30d71606a1 Allow callers to redact encoded JSON request bodies from logs (#64003)
## Why

Callers need a way to keep encoded JSON payloads out of request
diagnostics while preserving what the server receives.

## What changed

Add `EncodedJsonBody::omit_from_logs()` to replace the trace body with
`<redacted>` and show only the byte length in debug output. Preserve the
setting through private JSON enrichment and request preparation. The
setting leaves the wire payload and redirect policy unchanged.

## Testing

Add a regression test that checks trace redaction and debug output for
both plain and enriched bodies before and after preparation, and
verifies that decompressing the wire body yields the expected bytes.

GitOrigin-RevId: 5b1ae2c810242f8c7f35bcdf653af9127360c29c
2026-11-25 22:47:37 +00:00
jif 44d359767f Preserve initial turn input when suspension races with startup (#64002)
## Why

Suspension can detach the active task just as startup tries to save
unrecorded input before reading the host roster. If detachment wins,
cleanup can miss the initial submission when saving the turn for recovery.

## What changed

Store pending initial input in the shared `TurnContext` during host
admission and startup steps that can wait on the host roster. Save the
input before checking whether the task is still active, so suspension
and abort cleanup can retrieve it after the task exits. Reclaim it under
the active-turn lock when startup completes so only one path records
the submission.

GitOrigin-RevId: 2f180fc372daaa8f2d8e0ebcb4787a1b2cfd61fa
2026-11-25 22:47:01 +00:00
iceweasel-oai f39c3c78d7 Initialize Statsig feature gates across Codex launch modes (#64001)
## Why

Enabling `statsig_gates` can only load evaluations if the process starts
the Statsig runtime. Several Codex entry points never started it.

## What changed

Start Statsig in standalone and embedded app servers, the TUI when it
connects to a separate app server, eligible `codex sandbox` launches, and
local and remote exec servers. This also covers `codex exec` through its
embedded app server. Use the serving or local account where applicable
and installation identity for remote execution. Share the runtime with
the embedded TUI and flush it on normal shutdown.

## Testing

Add a CLI integration test that checks which evaluation endpoint each
launch mode requests, including signed-in and signed-out sandbox launches.
Supply a bundled fixture key in Bazel and nextest CI builds so the test runs.

GitOrigin-RevId: 64df9933c1a9783a86be8712fa012b495f34b0f8
2026-11-25 22:46:26 +00:00
jif f3c6076ac2 Skip SessionEnd hooks when child threads shut down (#64000)
## Why

A hosted child thread can inherit the root session ID and use a custom
session source. The existing subagent source check can miss that child,
allowing its shutdown to fire `SessionEnd` while the root is still active.

## What changed

Before preparing `SessionEnd` hooks, skip threads whose ID does not match
the session ID.

## Testing

Extend the shutdown test to close a hosted child with an inherited
session ID before closing the root and verify that exactly one
`SessionEnd` hook invocation is logged for the session.

GitOrigin-RevId: 4c80a17724cab57003b33080482d00f3cc2afea4
2026-11-25 22:45:49 +00:00
Felipe Coury b420c7ca54 Preserve sidebar clicks when the terminal gains focus (#63999)
## Why

A terminal can report a focus gain between mouse-down and mouse-up.
Clearing the pending sidebar press on that event causes the release to
be ignored, so clicking the tab chooser's close button can fail to open
the confirmation dialog.

## What changed

Keep the pending sidebar press on `TuiEvent::FocusGained` so the mouse
release can complete the click.

## Testing

Extend the tab chooser test to send a focus gain between the press and
release and check that the close confirmation dialog appears.

GitOrigin-RevId: 4173292c50383304e9ef62104251434be7580789
2026-11-25 22:45:11 +00:00
Felipe Coury fd95d89146 Skip reasoning effort animations during TUI thread replay (#63998)
## Why

Switching back to a thread restores its current settings before replaying
older updates. Those updates can trigger reasoning effort animations and
leave the status line temporarily showing an older effort level.

## What changed

Set the composer's reasoning effort baseline before refreshing it for
each replayed settings update. The status line reflects the replayed
effort immediately, and live changes still animate.

## Testing

Add a regression test that replays earlier effort changes after restoring
a thread, checks the displayed effort, and verifies that a subsequent
live change starts the animation.

GitOrigin-RevId: 3daadc7b8b5917eba1055940c67399b8ab729eda
2026-11-25 22:44:36 +00:00
Felipe Coury 03f4f4e6b7 Make TUI workspace divider drags more responsive (#63997)
## Why

Rapid mouse motion can queue more drag reports than the TUI needs to
resize a pane. Rebuilding sidebar document layouts at each preview width
also adds work while the divider moves.

## What changed

- Share drag handling between the Command Center and sidebar dividers.
  Let users grab either column of the Command Center gutter, keep the
  grab offset, and highlight the divider on hover and during a drag.
- Use the release position for the final width. If focus loss interrupts
  a valid drag, keep the last width. When the terminal holds image pixels,
  show a guide and defer pane reflow until the drag ends.
- Batch consecutive mouse motion reports during divider drags while
  preserving input order at batch boundaries. Rewrap cached sidebar
  document content during live previews and rebuild its layout at the
  final width.

## Testing

Cover gutter hit testing, grab offsets, release and focus-loss behavior,
drag batching at input boundaries, and document layout reuse during
preview followed by a rebuild.

GitOrigin-RevId: 949a805a42d269f4bac1a86ac7e4b7f8c2a4cacf
2026-11-25 22:43:58 +00:00
Felipe Coury 76696132f0 Fix clipboard notices in the transcript overlay (#63996)
## Why

Copying a whole message can leave the overlay showing “Copying selection…”
because the copy has no active selection to receive the clipboard result.

## What changed

Track which clipboard request owns the notice so its completion can show
success or failure even without an active selection. Older results leave a
newer notice intact.

Track the last rendered transcript width for resize detection and render
prewrapped rows without hyperlinks using Ratatui’s `Paragraph`.

## Testing

Add a snapshot test that checks pending, failure, and success notices
without a selection, verifies that an older result leaves the notice
intact, and confirms the overlay stays open.

GitOrigin-RevId: c4076ccc425240ca39af9fd5c8cf6fca96303dda
2026-11-25 22:43:24 +00:00
felixxia-oai 9938ffba35 Notify extensions when Guardian policy changes the approvals reviewer (#63995)
## Why

A Guardian policy refresh can switch a running thread from Auto Review
to user approvals. Without a config change notification, Guardian's
shadow reviewers can stay active after that switch.

## What changed

Notify config contributors with the previous and updated effective
configs when a policy refresh changes the approvals reviewer. Send the
notification after releasing the session locks, even if the refreshed
policy blocks the current model.

## Testing

Extend the Guardian shadow test to refresh policy on a root thread and
its child. Verify that both receive the reviewer change, that switching
to user approvals cancels their shadow reviewers, and that allowing
Auto Review again restores the requested reviewer.

GitOrigin-RevId: fd61acf7fb161be341a63a2e867582e6c308d0dc
2026-11-25 22:42:49 +00:00
Charlie Marsh 71cf244137 Avoid cloning thread metadata during rollout read repair (#63994)
When the stored rollout path matches, compare the normalized working
directory and computed archive timestamp with the stored values. Return
early if both match. Otherwise, reuse the existing metadata to build
the updated row.

GitOrigin-RevId: 2c5d3e98851f2c8f72414bd688ccc99b2219adeb
2026-11-25 22:42:11 +00:00
jif 06c718ae68 Remove the shadow skill ranking experiment (#63993)
## What changed

Remove the background ranking of skill candidates and the metrics that
compared those rankings with skills actually used. Drop the experiment's
per-thread state and metrics wiring.

Continue accepting `skill_search` in existing feature configurations as
an ignored compatibility key.

## Testing

Extend the feature configuration test to cover both `true` and `false`
values for `skill_search`.

GitOrigin-RevId: 9492533bdeea58d4976bc9fbcffb6b82036b7894
2026-11-25 22:41:36 +00:00
Eric Traut db360f8b00 Suppress Kitty graphics replies on every pet image chunk (#63992)
The first chunk of a Kitty pet image upload already requests quiet mode,
but continuation chunks omit that setting. Send `q=2` on every
continuation chunk, including the final one, to suppress terminal replies
throughout the upload.

## Testing

Extend the command snapshot test to check the headers of a three-chunk
upload, including the final `m=0,q=2` header.

GitOrigin-RevId: cd12c3e6f4c27320c4823f593657ab92824c83ff
2026-11-25 22:40:59 +00:00
Charlie Marsh a089ec6a93 Use lightweight settings for app-server thread metadata (#63990)
## Why

Enriching loaded thread results builds a full configuration snapshot,
including an execution permission profile, just to read display settings.

## What changed

Read the configured model, reasoning effort, environment selections, and
session source directly from the loaded thread when enriching results.
The environment data still includes the working directory and runtime
workspace roots.

## Testing

Extend the core test to verify that reading display settings matches the
configured snapshot's display fields without triggering a model lookup.
Extend the app-server test to verify that thread reads and lists return
explicit runtime workspace roots.

GitOrigin-RevId: f7053554fdb0f02bebb51b4cafda2ef39e6e81a5
2026-11-25 22:40:22 +00:00
Felipe Coury ceed625df9 Keep TUI tool groups independent when results arrive late (#63989)
## Why

When a command or tool finishes in a different transcript group from where it
started, both groups can share an identity. The later group can inherit the
original group's expanded state or steal its keyboard focus.

## What changed

Assign distinct identities to repeated tool activity in chronological order.
Keep those identities stable as the live transcript updates and results move
into history, so each group retains its own expansion state and focus.

## Testing

Add regression tests for a command that finishes after assistant commentary
and an MCP tool that returns an error in a later turn.

GitOrigin-RevId: ca69a68bb32746bdbe22ec7bc9633e4323f38347
2026-11-25 22:39:45 +00:00
felixxia-oai d800b00e88 Restart Guardian v3 shadow intake when Auto Review resumes (#63988)
## Why

Switching an enrolled thread to user approvals stops Guardian v3 shadow
intake. Previously, switching the same thread back to Auto Review left
intake stopped for subsequent turns.

## What changed

Restart intake in the background with a fresh evidence board after
checking that the thread still routes approvals to Auto Review. Start
at the end of persisted history so the new board only receives new
evidence. Existing child threads can attach to the new board on their
next turn.

## Testing

Add app-server coverage for routing later turns after Auto Review
resumes without replaying earlier turns. Extend the host test to cover
stale settings notifications, cancellation of a queued restart, and
creation of a fresh board and reviewer.

GitOrigin-RevId: 5201d7f7a7e3f2c045c69b9584b036467a5767d7
2026-11-25 22:39:08 +00:00
Dylan Hurd 1c1e383a7b Harden Guardian v2 hosted messaging tests (#63987)
## What changed

Wait for worker creation with its own timeout before waiting for MCP
delivery in the cached approval invalidation test. This gives a missing
worker a distinct failure from a delivery that never reaches the server.

Disable analytics in the Code Mode conversation history test so hosted
messaging only contacts the mock servers.

GitOrigin-RevId: 15887b9f37cc48b938fd67801a0dda9374027492
2026-11-25 22:38:31 +00:00
jif c6bbf8a413 Extract shared network policy types from the proxy crate (#63986)
## Why

The protocol and feature configuration crates depend on the network proxy
crate for data types. Give them a smaller dependency that contains the
shared definitions.

## What changed

Move environment network policies, domain and Unix socket permissions,
policy decisions and their sources, and credential provider definitions
into `codex-network-policy-types`. Use the new crate directly from
`codex-protocol` and `codex-features`.

Re-export the moved types from `codex-network-proxy` and keep environment
policy conversion and application, along with credential provider
validation, in the proxy crate.

GitOrigin-RevId: 8af684da746830bce45ac00135aed8052dba3824
2026-11-25 16:09:51 +00:00
felixxia-oai 06f334aa4b Add opt-in shadow intake for Guardian V3 (#63949)
## What changed

Add the default-off `features.guardianv3_shadow` flag and ignore it in
project config. When Guardian V2 handles Auto Review and Guardian V3
is disabled, enroll eligible new threads in background evidence intake
while Guardian V2 keeps making approval decisions.

Share an in-memory evidence board between the root and its child agents.
Keep shadow reviewer sessions ephemeral and suppress their events in
the parent thread. Retry failed intake startup on a later turn, and
stop shadow work when the root leaves Auto Review or shuts down.

## Testing

Cover enrollment for opted-in new threads, startup retry, child
attachment and cancellation, and the absence of an on-disk board.
Verify that project config cannot set the flag.

GitOrigin-RevId: 7c31c1d831498ba012193579123ac87779b76b85
2026-11-25 16:07:45 +00:00
felixxia-oai cc6e8a968d Use reset checks for attached Guardian V3 reviews (#63948)
## Why

Attached reviewers need to detect root history resets that can invalidate an approval. Preparing an attached review previously fetched root conversation evidence even though the reviewer did not use it for preparation.

## What changed

- Check the root history version before starting an attached review and while it runs. Local MultiAgent V2 workers resolve the currently loaded root thread, and hosted workers use the host's root snapshot.
- Skip root evidence capture when preparing or prewarming attached reviewers. Skip per-attempt evidence collection for attached observers and sessions without an evidence store. Live reviewers with an evidence store still record their verdicts.

## Testing

Add coverage for root history version changes on reset, version stability on append, root resolution after reload, and verdict recording when the first approval reuses a prewarmed reviewer.

GitOrigin-RevId: b3ff7e58883d5f72bea3d774e05ba2f678df45fc
2026-11-25 16:04:45 +00:00
felixxia-oai b144e0e239 Remove unused Guardian evidence write acknowledgments (#63942)
## Why

Guardian's public review path does not consume per-write acknowledgments. The session still needs to finish saving accepted evidence when a turn is canceled.

## What changed

Replace the acknowledgment tracker with a `PreserveReviewWrites` opt-in for Guardian root sessions. The session continues to save changed evidence across turn cancellation and waits for those writes during shutdown. Remove the append callback from `LiveThread`.

## Testing

Add a regression test that interrupts a turn while forwarded user instructions are still being saved, then checks that the instructions appear in persisted history.

GitOrigin-RevId: 01e8b2665034f46e766cb382ace99c416f29aab6
2026-11-25 15:38:14 +00:00
felixxia-oai d1e982d7eb Let Guardian V3 review actions while evidence routing is pending (#63941)
## Why

Guardian V3 approval reviews waited for the housekeeper to catch up on
conversation history before they could start. Slow evidence routing could
delay an action review, and a routing failure could prevent a verdict.

## What changed

Each review attempt, including retries, drains the reviewer's available
inbox when it reserves the reviewer. The housekeeper flushes and routes
history independently in response to thread activity.

## Testing

Cover reviews that start with an empty board or while evidence routing
resumes after a root thread reload. Verify that a revocation published
during an in-flight verdict is available to a subsequent review.

GitOrigin-RevId: f84f424b57538fa9562d8f4d47e38ce7a0a84dcd
2026-11-25 15:37:35 +00:00
felixxia-oai 34fcbc8caf Keep Guardian V3 verdicts valid across unrelated context updates (#63940)
## Why

An unrelated thread goal update could invalidate a pending Guardian V3
approval and trigger a second assessment even though the update never
reached the attached reviewer.

## What changed

Let attached Guardian V3 reviewers finish with the evidence admitted for
the current attempt. Later evidence can inform subsequent reviews. Keep
the cancellation, deadline, and root history checks for attached verdicts.

## Testing

Update the app-server regression test to change the thread goal while
an MCP approval is pending and verify that the original approval stands
after a single assessment.

GitOrigin-RevId: 6e7ffad243c7c59f0f97bdbe555886ff58531835
2026-11-25 15:36:14 +00:00
jif 44eb0838df Limit the sandbox’s codex-otel dependency to Windows (#63937)
GitOrigin-RevId: b169b2d687df0be2ca964c59083e4b25a71eba42
2026-11-25 15:19:27 +00:00
jif ecb223f525 Remove the connector dependency from codex-tools (#63929)
## What changed

Have core pass connector IDs, names, descriptions, and install URLs
through `DiscoverableConnectorInfo` for tool discovery and install
prompts. Move installation verification into the core handler, where it
checks accessibility using `AppInfo`.

Enable `serde_json`'s `arbitrary_precision` feature directly in
`codex-tools` to preserve large numbers in tool arguments and results.

## Testing

Cover install verification for accessible, inaccessible, and missing
connectors, including an accessible connector that is disabled.

GitOrigin-RevId: fd84e8e9b739d86658396e17e4dcd7b48a4b2fdd
2026-11-25 14:34:40 +00:00
jif d3ca5182df Present encrypted subagent replies as evidence in Guardian reviews (#63926)
## Why

Encrypted replies from subagents can provide evidence for a Guardian
decision. Reviewer compaction can drop those replies when it filters
descendant progress and completion messages.

## What changed

When native multi-agent history is enabled and the reviewer uses the
OpenAI provider, send encrypted replies from descendants to ancestors
as standalone `guardian.subagent_reply` tool outputs in Guardian review
and async scoring requests. Include the sender and recipient, preserve
the encrypted payload, and keep native message IDs in stored history
for deduplication.

Retain qualifying replies across reviewer compaction within the existing
per-message and shared token budgets.

## Testing

Extend regression coverage for incremental reviews, compaction recovery
with and without native agent review, and reply ID stability across
retained WebSocket scoring requests.

GitOrigin-RevId: bb46149426b1a60a6ed5cac6765283ec77682d23
2026-11-25 14:22:54 +00:00
Dylan Hurd e8fb104cd6 Make the context spill threshold configurable for MCP hooks (#63922)
## Why

MCP hooks could only use the default spill threshold. Hooks that return
larger context, such as a session-start memory hook, need a way to keep
more of that context inline.

## What changed

Allow `mcp_tool` hooks to set `additionalContextLimit` for events that
can emit `additionalContext`. Plaintext context spills to disk above
approximately 2,500 tokens by default. MCP hooks can set a threshold
from 1 to 10,000 tokens. A value of 0 or above 10,000 warns and uses
10,000. Hook trust hashes use the effective threshold.

Expose the setting in app-server configuration requirements and hook
list responses.

## Testing

Cover limit normalization, warnings, trust hashes, and app-server
reporting. Verify that a bundled memory hook with a higher threshold
injects its full context at startup and after compaction.

GitOrigin-RevId: 318704ac1532267b3eb2f138f130b6799863a5c0
2026-11-25 14:03:11 +00:00
jif 9f3cb25953 Drop the production dependency on codex-core from app-server transport (#63898)
## What changed

Use `codex-utils-home-dir` to locate Codex home and `codex-utils-path`
to write daemon recovery snapshots atomically. Keep `codex-core` as a
dev-dependency.

Enable `serde_json`'s `arbitrary_precision` feature directly to preserve
large numbers in JSON-RPC payloads and daemon recovery snapshots. Vendor
OpenSSL for standalone x86-64 and AArch64 Linux musl builds.

GitOrigin-RevId: f03116e49ca8f53acfa58922eeb3cbf260a12d35
2026-11-25 12:07:36 +00:00
jif f0f3d650b0 Move plugin skill namespace resolution into the skills loader (#63897)
## Why

The skills loader is the only consumer of the plugin namespace lookup
that uses the execution environment's filesystem. Keeping the lookup
there lets the shared plugin utilities drop their dependency on
`codex-exec-server`.

## What changed

Move the manifest name lookup into the skills loader. It still uses the
shared manifest search order and falls back to the plugin directory name
when the manifest name is missing or blank.

## Testing

Cover namespace resolution through the skills loader for Codex, Claude,
and Cursor manifests. Extend the local manifest lookup test to verify
that it falls back to the Cursor manifest after the other two are removed.

GitOrigin-RevId: 1f2cea60f660880377b0a39cb1e4f42034aded95
2026-11-25 12:06:53 +00:00
jif 1c69d01451 Publish process exit status and exit code together (#63896)
## Why

Separate reads and writes of the exit flag and exit code could let
unified exec observe a process as exited before seeing its exit code,
or return a live session ID alongside an exit code.

## What changed

Store the exit code in a shared `OnceLock` for pipe, PTY, and
driver-backed processes. Derive `has_exited()` from the presence of
that code. Unified exec reads the code when it retires the session,
after any pending output it needs to retain has been drained.

## Testing

Extend the pipe, PTY, and driver-backed tests to check that the
process handle exposes the exit code reported by the exit notification.
The driver-backed test also verifies that output arriving after the
notification is still collected.

GitOrigin-RevId: 6192e5ceb9c71c6321e76f750c531c0ea6554dca
2026-11-25 12:06:15 +00:00
Dylan Hurd 6cb4fd1d2d Drain stdout through closure in the PTY attachment test (#63894)
The exit status can arrive before the PTY reader delivers its final bytes.
Drain stdout to channel closure while awaiting the exit status so the test
compares complete output with and without file descriptor attachments.

GitOrigin-RevId: c695a1c1cd00c11071bd17523cfc2ca7effc697c
2026-11-25 12:04:48 +00:00
Dylan Hurd 077eab36fd Isolate Git discovery in remote apply_patch turn diff tests (#63889)
## Why

An ancestor's `.git` marker can change the repository root discovered by
the tests, which affects the paths in the emitted turn diffs. Manual
cleanup at the end of the shared-path test can also be skipped when the
test fails early.

## What changed

- Add `.git` markers to keep repository discovery within the fixtures.
- Reuse the executor's working-directory path on both filesystems and
  give the local directory a `TempDir` owner so both fixtures are cleaned
  up when the test exits early.

GitOrigin-RevId: 2534688ae1ed4aace16d47f6f58e461e546dc8ee
2026-11-25 11:50:50 +00:00
Eric Traut 590be70f75 Fix pasting packed bitmap images on Windows (#63888)
## Why

When a packed `CF_DIBV5` bitmap stores pixels immediately after its
header, the clipboard decoder skips the first three pixels as if they
were additional color masks. This can cause a short read or shift the
image when the clipboard buffer includes trailing padding.

## What changed

For supported 32-bit `CF_DIBV5` bitmaps, supply an explicit BMP pixel
offset and enforce the decoder's allocation limits. Keep PNG as the
preferred clipboard format and handle bitmaps that repeat the color masks
before the pixels.

## Testing

Add a regression test for packed, padded, and repeated-mask bitmaps that
checks decoded RGBA values and allocation limits. The test also covers
missing pixel data.

GitOrigin-RevId: 7bb47a180584633c8a3f47c909b0e291d0003020
2026-11-25 11:50:14 +00:00
Felipe Coury 600595d67c Wait for subagent transcripts before enabling sidebar selection (#63887)
## Why

The sidebar can learn about a subagent from live activity before it can
open the transcript. During that gap, the chooser can offer a row whose
transcript is still unavailable.

## What changed

- Start transcript discovery when the TUI observes subagent activity
  and retry when the chooser opens with disabled rows.
- Keep starting and unconfirmed subagents visible but skip their rows
  during keyboard and mouse selection. Show whether an unconfirmed
  transcript is loading or unavailable once the subagent leaves
  `Starting`.
- Resolve provisional status from discovered threads, including idle
  and unloaded ones, while preserving newer live outcomes. Open
  transcript links only after discovery confirms the subagent.

## Testing

Extend TUI coverage for discovery retries, status updates arriving
during discovery, disabled row navigation and clicks, and transcript
links that wait for a follow-up refresh.

GitOrigin-RevId: e4d3b992830884532531239507083e4bd2df6687
2026-11-25 11:49:41 +00:00
psachdeva-oai 16466d9e3a Carry prompt wellbeing results through answer moderation (#63886)
## What changed

Add optional `promptWellbeingResults` to answer moderation metadata.
Each result contains the scored input item's ID, labels, and numeric
scores. Preserve the results on live agent messages and when rebuilding
thread history, and expose them in the app-server v2 schemas and Python
SDK models.

Ignore malformed wellbeing results when reading stored moderation so
the moderation decision and its display instruction can still be applied.

## Testing

Cover serialization round trips with and without a display instruction,
and verify that older moderation records without wellbeing results
deserialize.

GitOrigin-RevId: b3ed41fb529e33638eb5486bf2a22ff8b926f82a
2026-11-25 11:48:12 +00:00
Eric Traut cec14d27b5 Show the quota plan in /status (#63877)
## Why

The ChatGPT plan shown in `/status` can differ from the plan reported alongside the rate limits. Refreshing the limits could leave the card showing the old plan.

## What changed

Use the cached quota plan for new status cards when available. If a rate-limit refresh changes the plan label, update the existing card in place, including when `/status` runs before a thread starts.

## Testing

Cover a rate-limit response that changes the label from Plus to Pro 200 in terminal scrollback, copied status output, and subsequent `/status` cards.

GitOrigin-RevId: c8def774ac2b344a2bb14b5eb834dec1d07d0099
2026-11-25 10:30:05 +00:00
Eric Traut ebd0765aaf Render bidirectional text in full-screen transcripts (#63845)
## Why

The terminal's bidirectional layout was already used for scrollback, but
full-screen transcripts could still show mixed right-to-left and left-to-right
text in source order.

## What changed

Use the terminal's bidirectional layout setting in the live transcript,
history pager, and resume picker previews. Reorder each wrapped row for
display and map its screen columns back to the source graphemes. This keeps
hyperlink hit targets and search highlights aligned with the displayed text.
Mouse selection follows the displayed glyphs, while copying preserves source
order.

## Testing

Add regression coverage for mixed Arabic, Hebrew, and Latin text across
terminal widths, including link hit targets, highlights, and logical text
order. Exercise mouse and keyboard selection and verify right-to-left
rendering in the resume picker preview.

GitOrigin-RevId: ea0518ea8791d0fcc031dd0ebf306775918f373b
2026-11-25 06:40:44 +00:00
Eric Traut f0c0f0a14d Render bidirectional transcript text on terminals without native ordering (#63844)
## Why

Terminals that leave bidirectional ordering to the application can display
Arabic and Hebrew transcript text in the wrong order, especially when it
includes URLs, numbers, or inline code.

## What changed

Use the terminal's bidirectional mode report when available on a direct
connection, with a fallback for Windows Terminal, Ghostty, and Alacritty.

Resolve direction before wrapping and reorder graphemes for display in the
live transcript and scrollback. Preserve styling, hyperlink destinations,
and logical text for copying. Keep URLs and inline literals left to right,
and skip reordering for code blocks, tables, and lines with shell syntax
that could be misrepresented.

Measure hyperlink columns by painted graphemes so Arabic ligatures do not
shift clickable ranges in the transcript or composer.

## Testing

Cover agreement between streaming and finalized scrollback, preservation
of shell command boundaries, startup probe reply handling, and wrapped
composer links following Arabic text.

GitOrigin-RevId: 9ffa0f491a93c78fef423acfc6a951cb037abd4d
2026-11-25 06:40:04 +00:00
pakrym-oai ba4e278273 Raise the per-value additional context limit to 10,000 tokens (#63843)
## What changed

Increase the truncation threshold from 1,000 to 10,000 tokens so more
of each additional context value reaches the model. Add a 40 KiB bucket
boundary to the `codex.additional_context.value_bytes` histogram.

## Testing

Update the integration tests to check middle truncation and size metrics
at the new limit, verify that an application context value at the limit
survives compaction, and check that representative truncated values
fit in the new histogram bucket.

GitOrigin-RevId: 260dae5c01816e2383c10d81ddb90b8e937fd8c0
2026-11-25 06:38:46 +00:00
Eric Traut 1698314bb3 Scope TUI rate limits to the active thread's provider (#63838)
## Why

A resumed thread can use a different provider from the server default.
A successful account quota read can then show warnings and banners for
quota the thread does not use.

## What changed

Apply account quota reads and prefetch quota only when the active
provider uses account quota. Preserve remote provider definitions when
reloading local preferences, refresh custom provider definitions on
remote resume, and clear cached quota when the provider or its
definition changes.

For providers with independent quota, use turn updates for warnings and
composer notices. Keep omitted windows from sparse updates, clear the
notice when reported usage falls below the warning threshold, and omit
the `/status` hint. Limit the model-switch prompt to the built-in OpenAI
provider.

## Testing

Extend coverage for starting and resuming sessions across providers,
including an authentication change under the same provider ID. Verify
that custom-provider turn updates can show and clear a quota notice
without triggering a model-switch prompt.

GitOrigin-RevId: 4e6c95efe46ec420cee7b09d5f5a94862307530c
2026-11-25 06:20:31 +00:00
Eddie Chen 1ed2a3f22d Record root turn IDs in Guardian review analytics (#63837)
## Why

The review's `turn_id` alone can't identify the root turn of the action
being reviewed. For example, a background terminal can request network
access during a later turn.

## What changed

Add an optional `root_turn_id` to `codex_guardian_review` events. When
a verified execution tag ties a network request to a registered tool
call, use the root turn ID captured when the call started. Leave the
field unset when the reviewed action's root turn is unknown.

## Testing

Extend the MCP approval test to check the reported root turn ID. Cover
untagged network requests and verify that a cross-turn network review
reports the active turn's `turn_id` alongside the issuing turn's
`root_turn_id`.

GitOrigin-RevId: f0ae40ec4fc441891b4d843912f823a2385fa36f
2026-11-25 06:19:21 +00:00