Commit Graph

10426 Commits

Author SHA1 Message Date
felixxia-oai
0337192dfd Centralize Guardian transcript policy in context profiles (#43806)
## What changed

Add `ContextProfile` to `codex-guardian-context` and route synchronous and asynchronous Guardian transcript rendering through it. Move default limits, retention, formatting, and async chunked eviction into the shared crate while preserving the distinct retention policies and host-managed full/delta cursors.

Carry transcript truncation observations through `RenderedTranscript` into context composition, and derive async image collection flags from the resolved profile.

## Testing

Add a profile regression test covering distinct sync/async retention priorities, original entry numbering, omission notes, and async truncation observations. Adapt existing transcript tests to the updated input API.

GitOrigin-RevId: 7f7dc249629d8017e9547085f6617f815ae43a1b
2026-09-08 12:17:28 +00:00
felixxia-oai
0034ef93a7 Centralize Guardian context composition (#43805)
## Why

Synchronous approval reviews and asynchronous scoring assemble Guardian evidence separately, duplicating transcript framing and section placement.

## What changed

- Move evidence ordering, framing, and delivery into `codex-guardian-context`, while keeping transcript retention, budgets, and delta cursors with their callers.
- Pass composed messages directly to the asynchronous sampler, preserving roles, annotations, trusted message boundaries, and image placement.
- Reject unsupported synchronous delivery with `SectionError::UnsupportedDelivery` instead of silently dropping content.

## Testing

Add composition coverage for preserving separate messages and rejecting them for synchronous delivery. Extend Guardian integration coverage to check trusted tool and skill messages, mixed text and image evidence ordering, and full and delta review framing.

GitOrigin-RevId: efc06695ee4e2b7400b123b77ef2a21c8bf40646
2026-09-08 12:06:44 +00:00
jif
74d3a5bf10 Add summary-only extraction for memory v2 (#43800)
## Why

Memory summaries should preserve task history and the scope of user corrections and preferences without turning task-specific instructions into general claims about the user.

## What changed

- Give memory v2 dedicated extraction prompts that emphasize chronological task history, evidence provenance, and uncertainty, with working directory and branch hints.
- Require only `rollout_summary` and `rollout_slug` for v2, store an empty raw memory, and redact secrets before truncating summaries with a 9,000-byte budget.
- Split v2 input into memory context messages while preserving the v1 prompts and output contract.

## Testing

Extend startup tests to check v2 output storage, schema, branch hints, and redaction before truncation. Verify that budgeted input preserves human and agent evidence in order, omits media payloads and lower-priority noise, and keeps message chunks bounded.

GitOrigin-RevId: 89e1c797450bd8f8e192fbe7161b5159bff8f931
2026-09-08 11:25:15 +00:00
jif
6924ce636b Prioritize human evidence in memory v2 extraction (#43799)
## Why

Memory extraction has a limited rollout budget. Select evidence by source so human input and assistant final responses take priority over commentary, context, and tool output.

## What changed

- Use tiered selection for memory v2, preferring newer evidence within each tier and rendering selected items in chronological order with omission markers.
- Keep answered `request_user_input` questions alongside human replies, label evidence sources, replace message media with placeholders, and bound tool output and individual rows.
- Add typed memory context fragments with bounded messages and Unicode-safe extraction chunking.

## Testing

Add tests for memory v2 startup using tiered input and for extraction chunks preserving Unicode evidence within message bounds.

GitOrigin-RevId: 1b2bba4e3264b4fda271e429ad3b7d5f69caed59
2026-09-08 11:12:01 +00:00
jif
5371951292 Batch non-user history eviction to preserve Guardian transcript deltas (#43798)
## Why

Evicting entries on every append once history fills invalidates Guardian's transcript cursor, forcing repeated full transcripts instead of deltas.

## What changed

On non-user history overflow, evict at least the oldest half of existing non-user entries, removing more if needed to meet the byte limit. This leaves room for subsequent appends without invalidating the cursor. Preserve the separate user-message retention limits.

## Testing

Update retention assertions and add a regression test that verifies a full transcript after eviction, followed by a delta on the same Guardian thread, while retaining the user's earlier restriction.

GitOrigin-RevId: 7ba18f01e2962d3de35488d981b667ccbb8995c7
2026-09-08 11:03:44 +00:00
jif
3f76e88a48 Add configurable memory versions with isolated storage (#43797)
## What changed

- Add `memories.version` with `v1` as the default and `v2` as an opt-in selection.
- Route memory generation, summaries, and retrieval tools through the selected version. Store `v2` artifacts in `memories_v2` and lazily create a separate SQLite database, keeping jobs and outputs isolated while sharing the thread catalog.
- Preserve the initial memory version across extension config updates so summaries and retrieval tools use the same namespace.
- Clear both versions on memory reset and remove thread memory from both stores on thread deletion. Recognize both artifact roots in shell usage telemetry.

## Testing

Add regression coverage for version defaults and validation, independent job claims and outputs, deletion and reset across versions, and shell usage classification for both memory roots.

GitOrigin-RevId: aa799bf87ab6ec10c8f5668213931e57547d080b
2026-09-08 10:55:48 +00:00
felixxia-oai
35d9e4bc4d Preserve reasoning effort through compaction and reset it on success (#43796)
## Why

With reasoning effort overrides enabled, compaction used the selected effort even when sampling requests still used an earlier pinned effort. Successful compaction also left that old pin active in the new context window.

## What changed

- Use the pinned request effort for local and remote compaction when it matches the model.
- Resolve fallback models' effort without mutating the live pin, preserving it if compaction fails.
- Reset the pin after successful compaction so the next sampling request establishes the selected effort as its baseline without a redundant `configuration_update`.

## Testing

Add regression coverage for remote compaction success and failure, fallback model effort selection, pin preservation during fallback lookup, and compaction after resuming with overrides disabled.

GitOrigin-RevId: 35e666b0c8026553500715ddbe7bef02cd759f4a
2026-09-08 10:46:07 +00:00
felixxia-oai
31ccaf40c2 Pin request reasoning effort while configuration overrides are active (#43795)
## Why

Reasoning-effort changes should preserve the request baseline while trusted `configuration_update` items carry the selected effort.

## What changed

- Pin request-level reasoning effort for the current model when reasoning-effort overrides are available, including during WebSocket prewarm.
- Re-establish the selected effort after rollback, resume, or a model switch, refreshing the trusted override even when the selection is unchanged.
- Continue using the selected request effort when overrides are unavailable.

## Testing

Add regression coverage for WebSocket prewarm and reconnect, rollback, resume, and model switches. Update transition tests to assert that request-level effort stays pinned while configuration updates change.

GitOrigin-RevId: 89cfee6289543230347b0488d1388190b4da7216
2026-09-08 10:41:15 +00:00
jif
df522cae16 Limit app-server storage metrics to session directories (#43790)
## What changed

Restrict the startup size scan to `sessions` and `archived_sessions` under
`CODEX_HOME`, and stop emitting the aggregate `directory=codex_home` sample.
Skip missing session directories and inspect scan roots without following
symlinks.

GitOrigin-RevId: c046d097de9b630af68cc9ad70e87cdd63e49319
2026-09-08 10:18:59 +00:00
riley-oai
d6489472f3 Enable user verification for the bundled TUI on supported devices (#43715)
## Why

The app server's device-support probe always returned `false`, preventing the bundled TUI from advertising user verification even on supported hardware.

## What changed

Use `native::device_supported` to enable the existing initialization path for in-process `codex-tui` clients that opt into `experimentalApi`. Eligible clients advertise the `userVerification` MCP extension capability and can receive verification requests.

## Testing

Add tests covering initialization eligibility, rejection of responses from non-owning connections, ownership release before disconnected RPC handlers finish draining, and cancellation of pending requests when authentication changes.

GitOrigin-RevId: cdacc026e8f830b3340f2e6f273851c4a3031a7e
2026-09-08 05:57:24 +00:00
riley-oai
c7f81afc19 Enable MCP user verification in the TUI (#43712)
## Why

The TUI automatically canceled MCP user verification requests, preventing users from completing verification and approving them.

## What changed

- Show verification prompts for active and inactive threads, with actions to verify and approve or cancel.
- Run approved verification through the local app-server's `userVerification/verify` RPC and return the proof to the original request. Cancel on failure and show a warning in the requesting thread; remote workspaces remain unsupported.
- Deduplicate prompts, preserve foreground streaming when another thread requests verification, and surface queued prompts when returning from a side conversation.
- Cancel verification when its thread is discarded and ignore stale results after cancellation.

## Testing

Add RPC, routing, and snapshot tests covering successful verification, unsupported binaries and remote workspaces, cancellation and late proofs, prompt replay, side conversation switching, and foreground stream preservation.

GitOrigin-RevId: 2ae12f47c443e17de25f4ec033f6078ac28b1e03
2026-09-08 05:39:17 +00:00
riley-oai
95327467c3 Add TUI request bookkeeping for user verification (#43708)
## What changed

- Track verification parameters and attempt IDs with cancellation tokens so callers can reject stale results after cancellation, server resolution, or reconnect.
- Add `ResolveUserVerification` to send acceptance proofs or cancellation through MCP elicitation responses, omit proofs from session recordings, and remove resolved prompts from thread replay.
- Add typed verification error messages with safe fallbacks that omit raw provider diagnostics.

## Testing

Add unit coverage for attempt invalidation, duplicate attempt prevention, proof serialization, resolved prompt replay, and safe error messages.

GitOrigin-RevId: 3466c9a83fe5f512a861fec062bef10dcd3025c8
2026-09-08 05:12:10 +00:00
Benjamin Carlsson
ef6c058202 Disable clock synchronization in the voice audio sink (#43704)
Set the GStreamer audio sink's `slave-method` to `none` instead of
`resample`, and disable sink synchronization with `set_sync(false)`.

GitOrigin-RevId: a74f3e6d70e0d817c75bd963b31f16c69c2732ab
2026-09-08 04:55:29 +00:00
riley-oai
54e04f25db Add a TUI user verification prompt component (#43702)
## What changed

Add a presentation-only `UserVerificationView` with explicit verify and cancel choices, request details, and a waiting state. Report decisions through a callback, suppress duplicate approvals while waiting, and allow cancellation before or during verification. Dismiss the view when its matching MCP elicitation request resolves.

Add a full-screen request details overlay that can be opened without making a decision. Wrap prompt text and long URLs for narrow terminals. The view is not yet connected to incoming verification requests.

## Testing

Add tests and snapshots covering prompt and waiting rendering, narrow layouts, long URLs, duplicate approval suppression, cancellation, matching request dismissal, and full-screen inspection and scrolling.

GitOrigin-RevId: de1ff80d0defb3707b641e9bfccff9e2b91255ec
2026-09-08 04:47:42 +00:00
Benjamin Carlsson
6b6fdc3572 Preserve split-flap animation state when voice transcripts scroll (#43699)
## Why

Trimming the live voice transcript to its 1,024-byte window could restart
animations for retained words or skip animations for new text that repeats
existing text.

## What changed

Track discarded prefix bytes and render the retained text to identify which
tiles survive. Preserve their arrival times and animation phase so only new
tiles begin animating. Start fresh when the speaker changes or the retained
text no longer matches.

## Testing

Add regression coverage for repeated text, retained-word visibility, Unicode
and Markdown rendering, reduced motion, and replaced or changed-speaker windows.

GitOrigin-RevId: dd33f76441baa4d7787d0a9a1e72b281476acb4c
2026-09-08 04:39:31 +00:00
Eric Traut
49a9d78999 Make older app-server notices configurable in the TUI (#43698)
## What changed

Add `tui.show_server_version_notice`, enabled by default. Set it to `false` to suppress informational notices about older stable app servers at startup, on reconnect, and in the agents overview. Compatibility errors and version status remain unaffected.

Refresh the overview notice when local settings change, clearing pending notices when the setting is disabled.

## Testing

Add coverage for disabling and re-enabling overview notices, clearing pending notice state, and preserving remote version status. Extend reconnect and local-settings tests to cover the new setting.

GitOrigin-RevId: d50dcf4472ee221ce31cdd7ab2cd766f901a8039
2026-09-08 04:35:21 +00:00
Benjamin Carlsson
9a3af22d01 Stabilize realtime voice meter sampling across redraws (#43695)
## Why

Footer updates and transcript animation can trigger redraws before more audio arrives, consuming peaks too early and adding spurious quiet samples. Old peaks also linger in the meter after a channel becomes quiet.

## What changed

- Sample microphone and speaker peaks at most once every 100 ms, preserving accumulated peaks on early redraws and scheduling the next sampling frame.
- Clear each channel's meter history on its first quiet sample without clearing the other channel.

## Testing

Add regression tests for early redraw scheduling, peak preservation, independent channel silence, delayed sampling, and sampling after a conversation reset. Snapshot the meters at wide and narrow widths and after each channel becomes quiet.

GitOrigin-RevId: d7b116af2c099a2eaeb6db0d66bca93b230db970
2026-09-08 04:21:46 +00:00
Benjamin Carlsson
45305dd229 Make the voice mute shortcut configurable in the TUI (#43690)
## Why

Voice mute used a hard-coded `Ctrl+X` shortcut and footer hint, so keymap customization could not change or disable it.

## What changed

- Wire `tui.keymap.chat.toggle_voice_mute` into runtime keybindings and the keymap picker, supporting custom keys, chords, and unbinding.
- Keep `Ctrl+X` as the default, but let existing configured shortcuts and overlapping chord prefixes take precedence. Validate explicitly configured mute bindings for conflicts.
- Activate voice chords only when the microphone shortcut is available, excluding pagers and overlays.
- Refresh the voice footer when bindings change, showing the configured shortcut or `/voice mute` when unbound.

## Testing

Add regression tests for binding resolution, conflicts, voice chord context, and live keymap updates. Add footer snapshots covering custom keys, chords, and unbinding in muted and listening states at wide and narrow widths.

GitOrigin-RevId: ec9385f3956aa268bba34dcf2cc2b0c92a31bfec
2026-09-08 04:03:42 +00:00
Benjamin Carlsson
98c7c0415b Move voice controls into a dedicated composer strip (#43683)
## Why

Voice controls replaced the normal footer and could be truncated at narrow widths. Give them dedicated space while keeping the status line visible.

## What changed

- Render voice status, `ctrl+x` mute/unmute, and `/voice stop` above the draft, with separate microphone and Codex audio history meters.
- Keep control positions stable across mute states, prioritize stop at narrow widths, and hide the strip when vertical space is needed for the draft and cursor.
- Reflect actual microphone capture in the recording indicator, respect reduced motion, and allow muting during connection once the audio handle is available.
- Preserve speaker history when muting the microphone and clear speaker samples when playback is suppressed.

## Testing

Add layout and snapshot regressions for voice states, narrow and clipped composers, recording colors, independent audio histories, and status-line visibility. Extend coverage for audio intensity scaling and spoken transcript rendering.

GitOrigin-RevId: 9deb432654f4328cc8a577b8896eee088a0a1d5e
2026-09-08 03:39:58 +00:00
Benjamin Carlsson
3caf9f9586 Style spoken prompts and link workspace files in voice transcripts (#43676)
## What changed

- Render spoken user prompts with a bold red chevron, preserving its color during live transcript animation. Trim leading whitespace for display while retaining the raw transcript text.
- Underline and link file references such as `src/lib.rs:42` in spoken assistant transcripts using terminal hyperlinks. Preserve existing links and support Windows-style relative separators.
- Restrict generated file links to existing files with allowed extensions inside the workspace, rejecting hidden paths, traversal, and symlink escapes.

## Testing

Add rendering and transcript tests for the spoken marker, raw text preservation, file links, Unicode column offsets, and Windows-style paths, plus validation tests for rejected file destinations.

GitOrigin-RevId: 5fa180aa606acdc579a916441520602cb2bf3655
2026-09-08 03:15:37 +00:00
Benjamin Carlsson
4e93cf9b4e Animate live voice transcripts with split-flap tiles (#43656)
## What changed

Render live voice transcripts with a split-flap effect, a black background, and brief speaker-colored highlights as characters settle. Preserve settled characters when text is appended and include animation ticks in the active transcript cache key so frames refresh.

Respect `animations = false`, preserve Unicode graphemes and raw transcript text, and keep completed transcripts as ordinary history cells. Stop requesting animation frames once the effect settles.

## Testing

Add frame snapshots and regression coverage for row styling, speaker colors, appended text, reduced motion, Unicode width, frame scheduling, and unchanged final transcript history.

GitOrigin-RevId: 934f577c7279158f9161d6232634087ab32b0ea3
2026-09-08 02:46:14 +00:00
Benjamin Carlsson
4b0d9669cc Add voice mute shortcut and recording activity indicators (#43651)
## What changed

- Add `Ctrl+X` to toggle the microphone for the active voice session on the current thread, with a footer hint and guards for modals, popups, and repeated key events.
- Show a recording dot in the terminal title's activity indicator while the microphone is listening, respecting title settings and clearing it when capture stops.
- Replace the microphone and speaker bars with compact Braille meters showing four recent amplitude samples.
- Briefly show `heard` when voice input interrupts speech, when animations are enabled.

## Testing

Add regression tests for shortcut routing, amplitude glyphs, interruption acknowledgment, and terminal title lifecycle, plus updated voice footer snapshots.

GitOrigin-RevId: e1dc0c1744667e646e0040e247c5a0409b416075
2026-09-08 02:29:17 +00:00
Benjamin Carlsson
6fee98cc85 Expand TUI regression coverage for realtime voice conversations (#43645)
## What changed

- Add app-to-RPC tests for voice startup, shutdown, thread switching, speech delivery, and rejected or stale speech, using a recording app server without audio hardware.
- Cover session retries, typed and voice handoffs, reasoning visibility, and recovery of undelivered answers in focused chat widget test modules.
- Add transcript and buffered replay tests for caption reconciliation, partial transcript preservation, and voice output ownership across thread changes, with rendering snapshots.

GitOrigin-RevId: 8a76523907289f94f257fe97386db7d2e7f33ca5
2026-09-08 02:09:29 +00:00
riley-oai
e7637306bc Add macOS user verification with Secure Enclave signing (#43624)
## Why

The user-verification API previously returned an unsupported provider on macOS. Enable native verification using biometric-protected credentials.

## What changed

- Implement credential status, creation, reuse, deletion, and challenge signing with P-256 Secure Enclave keys in the Data Protection Keychain.
- Require biometric authentication through the key's access-control policy and use a fresh `LAContext` for each signature.
- Report Touch ID hardware support independently of enrollment and current readiness, and map native failures to structured verification errors.
- Serialize credential operations across processes with cancellable file-lock waits. Invalidate pending authentication on cancellation and wait for the signer to exit before releasing the lock.

## Testing

Add unit tests for lock contention and cancellation, authentication teardown and late-result rejection, native error classification, and validation of Secure Enclave key attributes.

GitOrigin-RevId: 93268962cd824b2befc1a0c54b99dcb77a0f1044
2026-09-08 00:13:28 +00:00
Eric Traut
530383e36d Warn when the connected Codex service is older than the CLI (#43622)
## What changed

Show an older-service notice at startup and reconnect when both versions are official stable releases. Display it in conversation history or the agents overview, with wrapping and a compact fallback for small terminals.

For the implicit local daemon, suggest `codex app-server daemon update` and warn that updating may interrupt active or queued work. Suppress repeated notices for the same service and version pair, and defer fresh-session notices until session attachment.

## Testing

Add coverage for version notice eligibility, local-only update guidance, service identity, startup ordering, reconnect deduplication, and overview rendering at narrow and short sizes.

GitOrigin-RevId: e0a5b306e0a4d405544c5f6eaa72f77df6d68e6d
2026-09-07 23:52:29 +00:00
Benjamin Carlsson
4b0f44d304 Add worktree classification to thread telemetry (#43621)
## What changed

Add `is_worktree` to thread initialization analytics and the `codex.thread.started` metric using validated Git repository metadata. Classify linked worktrees as `true` and primary checkouts as `false`; report an unavailable classification as `null` in analytics and `unknown` in metrics. Subagent initialization analytics leave the field unset (`null`).

## Testing

Add analytics coverage for primary checkouts, linked worktrees, unknown repositories, and event serialization. Extend the account-switch telemetry test to check that the `is_worktree` tag reaches the next account's collector.

GitOrigin-RevId: bc9bcd3c0212c0a123e4bcfed0c7020eef17dda6
2026-09-07 23:38:35 +00:00
Eric Traut
c977cc0c19 Add a stable TUI/app-server version comparison helper (#43619)
## What changed

Add `is_official_server_older` to check whether a stable TUI version is newer than the app-server version. Require both versions to contain exactly three numeric components without leading zeros, and return `false` for source builds (`0.0.0`), prereleases, and malformed versions.

## Testing

Add unit coverage for older, equal, and newer server versions, plus invalid versions in either argument.

GitOrigin-RevId: afcc90b56e188df1bf410c69ca238765b4658000
2026-09-07 23:28:57 +00:00
rhan-oai
8e694e955a Exclude base instructions from the bundled model catalog (#43604)
## What changed

Remove `base_instructions` from `codex-rs/models-manager/models.json` and filter out the field in the `rust-release-prepare` workflow so automated catalog updates keep it excluded.

GitOrigin-RevId: 711d43c21a90aadc98e5622b8c24847bc4642c83
2026-09-07 22:11:52 +00:00
Felipe Coury
7d2c58e6e0 Recover missed tmux resize notifications in the TUI (#43603)
## Why

Lost tmux resize notifications can leave the TUI using stale terminal dimensions.

## What changed

Add a background size monitor for tmux on Unix that checks terminal dimensions every 500 ms and delivers detected changes as resize events. Queries run off the UI thread so a slow query does not block input.

Pause monitoring during terminal handoffs and discard samples invalidated by newer geometry or pause/resume transitions. Ignore unchanged, invalid, or failed samples, and stop monitoring without waiting for a blocked query.

## Testing

Add tests for missed-resize recovery and text wrapping, input responsiveness during blocked queries, stale sample rejection, pause/resume handling, nonblocking shutdown, and tmux-only activation.

GitOrigin-RevId: 461f09bf792f1d9760672dd33b125ecdf0ebd1e0
2026-09-07 22:03:58 +00:00
felixxia-oai
d75ed505d7 Move Guardian REPL evidence rendering into the shared context registry (#43602)
## What changed

Move completed REPL response rendering into `codex-guardian-context` and register a synchronous-only `NodeReplEvidence` section. Core supplies a borrowed view of its evidence snapshot and retains responsibility for capture, storage eviction, and the delivery cursor.

Preserve the existing text and multimodal layouts, rendering bounds, omission markers, image ordering, and deduplication. Exclude evidence payloads from the rendered section's debug output.

## Testing

Adapt the existing evidence tests to exercise the shared renderer. Extend registry coverage to verify synchronous-only inclusion, rendered content, and omission of evidence payloads from debug output.

GitOrigin-RevId: eb181870558a7f2f77270dee7c17d36700f3e148
2026-09-07 21:54:56 +00:00
felixxia-oai
b4373e53ab Move Guardian image selection into shared context sections (#43601)
## What changed

Move bounded transcript image collection into `codex-guardian-context` and expose it through an optional `TranscriptImages` section. Update the async scorer to consume this section, preserving source filtering, image detail, omission accounting, and the existing limits of four images and 8 MiB of image URL data.

## Testing

Add coverage for source order, tool-output filtering, disabled image collection, oldest-image eviction, oversized images, and omitted-byte accounting.

GitOrigin-RevId: 097799ea1be6d73b347088f959de1fd23f02ec2c
2026-09-07 21:46:23 +00:00
felixxia-oai
f5331dc237 Move trusted skill evidence into the Guardian context registry (#43599)
## What changed

Move trusted skill rendering into `codex-guardian-context` as `TrustedSkills` and collect it through an async-only context section. Pass the collected section to the sampler, preserving the separate developer message and bounded JSON rendering. Omit skill paths from `Debug` output, exposing only their count.

## Testing

Move rendering tests alongside the shared type, covering multiple paths and escaped UTF-8 within the size budget. Extend registry tests to cover async-only inclusion, omission for empty input, section ordering, and path redaction in debug output.

GitOrigin-RevId: c0778067f19d31e693ca954aee1a7d7be8f9739a
2026-09-07 21:38:25 +00:00
felixxia-oai
2554239561 Move trusted tool metadata into shared Guardian context (#43597)
## What changed

Represent host-verified tool metadata as `TrustedTool` in `codex-guardian-context` and collect it through an async-only context section. Route Guardian v2 sampling through that section while preserving separate developer-message delivery and the 512-token rendering budget. Omit tool metadata from debug output.

## Testing

Move the rendering-budget test into the shared crate, extend registry coverage for async-only collection and debug redaction, and narrow the scoped approval test to messages tagged `guardian.trusted_tool`.

GitOrigin-RevId: ee7cb4e9b9ceced70438cb58060d1a2973e1dc6a
2026-09-07 21:29:31 +00:00
felixxia-oai
0b9b5ecff3 Centralize bounded Guardian review evidence in guardian-context (#43595)
## What changed

Move prior-review rendering and developer-message construction into `codex_guardian_context`, and route async scorer evidence through a dedicated `PreviousReviews` context section.

Validate a maximum of eight review fragments and a per-fragment byte budget equivalent to 1,000 approximate tokens. Reject oversized evidence without rewriting or dropping records, and fail closed when validation fails. Preserve authorization-version filtering and the existing developer-role delivery. Keep review contents out of debug output.

## Testing

Add coverage for count and UTF-8 byte-size boundaries, preservation of accepted fragments, async-only section delivery, and omission of review contents from debug output.

GitOrigin-RevId: 05e9f53a6405f490b2424b2491a834cd90ab24f0
2026-09-07 21:20:31 +00:00
felixxia-oai
a444546564 Remove a stale transcript field assignment from the TUI (#43584)
`TranscriptState` has no `had_work_activity` field. Remove the assignment
from computer tool call completion handling to fix the resulting compile
error.

GitOrigin-RevId: 2adb15a213992e40a58dc6f217d7ae8d64c48154
2026-09-07 20:33:54 +00:00
Benjamin Carlsson
b01c3986fd Add live WebRTC voice conversations to the TUI (#43581)
## What changed

- Add feature-gated `/voice`, `/voice mute`, and `/voice stop` commands with local WebRTC audio and app-server signaling.
- Show live transcripts, conversation status, and microphone and speaker levels. Preserve captions and undelivered answers across thread switches.
- Speak final answers from voice handoffs while keeping delegated reasoning and commentary hidden and typed answers unspoken.
- Retry eligible startup failures once and clean up voice sessions on thread switches and disconnects.
- Stop voice and block late handoffs after a misalignment policy violation. Remove realtime event payloads and spoken text from receipt and debug logs.

## Testing

Add coverage for voice command mapping, rejected starts, disconnect cleanup, delegated final-answer speech, late handoff rejection, and transcript and footer rendering.

GitOrigin-RevId: 11def1f86b0e023b21d0d92072d6636ccad89815
2026-09-07 20:25:30 +00:00
Felipe Coury
4110342321 Group adjacent computer actions in the TUI (#43576)
## What changed

Render adjacent `cua_repl` calls as a compact “Using computer” or “Used computer” group with action and failure counts. Show the current action while running, and prioritize failures and screenshots in completed previews while preserving their chronological order.

Keep full call arguments and output in the expanded transcript, with a `ctrl+t` hint for hidden actions. End groups at other history items and turn boundaries, preserve completed results when pending actions are interrupted, and use the same grouping for live events and history replay.

## Testing

Add unit and snapshot coverage for live/replay parity, grouping boundaries, out-of-order completion, interruption, failure and screenshot previews, full transcript details, and narrow-terminal and Unicode rendering.

GitOrigin-RevId: 8e61ccf4c9f6d1a4d56d674a6d41ca5160d42c82
2026-09-07 20:01:28 +00:00
Eric Traut
a51608398d Make the managed app-server shutdown grace period configurable (#43572)
## Why

Managed app-server shutdowns use a fixed 60-second grace period. Allow users to adjust how long shutdown waits before forcing the process to exit.

## What changed

- Add `shutdownGraceSeconds` to daemon settings, accepting integers from 0 through 300 and defaulting to 60. Zero requests graceful shutdown and then forces termination immediately.
- Apply the setting to managed app-server stops and restarts, including updater-triggered restarts, and extend the lifecycle lock timeout to accommodate the maximum grace period.
- Keep `stop` usable with unreadable or invalid settings by falling back to the default grace period.

## Testing

Add tests for setting defaults and bounds, invalid-value fallback, preservation when saving remote-control settings, graceful process exit, and forced termination with zero or finite grace periods.

GitOrigin-RevId: 8627b391323cf27b40df96935a82e66aa715f572
2026-09-07 19:51:53 +00:00
jif
98a5cb46b1 Manage synchronous Guardian reviewers through the thread manager (#43570)
## What changed

- Store the shared `GuardianReviewSessionManager` in thread extension data and let the Guardian extension spawn and fork reviewers through `ThreadManager`, independently of async scorer startup.
- Preserve reviewer reuse, concurrent forks, cancellation, inherited environments, and user instructions. Gate managed reviewer startup on parent registration and remove terminated reviewers from the manager.
- Retain the `guardian` subagent identity in saved conversations. Reject resume of live Guardian reviewers and reject client archive or delete of live owner-managed workers with JSON-RPC error `-32600`; allow normal access after the owner releases them.
- Keep standalone reviewer support for inline delegates and remove duplicated extension prompt and configuration code.

## Testing

Add app-server tests covering reviewer reuse and concurrent forks, inherited instructions and prompt cache keys, live resume and removal rejection, saved reviewer discovery and resume after parent shutdown, and strict Guardian assessment inside an inline review.

GitOrigin-RevId: 4f9893c1ade151eacb4c11ffeae3d9e9ec019187
2026-09-07 19:43:10 +00:00
riley-oai
ca6fb194b6 Wire app-server user verification RPCs to the native provider (#43568)
## Why

The existing `userVerification/*` handlers always returned unavailability, leaving local clients unable to use the native verification provider.

## What changed

- Dispatch status, enrollment, deletion, and challenge signing through an account-scoped provider. Enrollment creates or reuses a local key; it does not register credentials with a server.
- Restrict enrollment, deletion, and signing to stdio and in-process connections, rejecting WebSocket and remote-control callers before parameter validation.
- Bound native work to one operation per service with a 120-second timeout, and propagate in-process caller cancellation. Recheck connection, cancellation, and authentication state before delivering results, including after waiting for response queue capacity.
- Add device-gated verification capability wiring for the experimental in-process `codex-tui` client, with automatic activation still disabled by default.

## Testing

Add tests for local key reuse and deletion, decoded challenge signing, cancellation, authentication changes during verification and response queuing, concurrent worker rejection, and stdio/WebSocket RPC behavior.

GitOrigin-RevId: 7eac15a5ffb049d27bf8fedcfbae19a49a3f6a3d
2026-09-07 19:34:23 +00:00
Eric Traut
daca1fab84 Add an explicit app-server daemon update command (#43562)
## What changed

Add `codex app-server daemon update` to check the latest stable release once, even when automatic updates are disabled. The command requires an installer-owned latest-channel standalone installation and reports `updated`, `noUpdate`, or `unsupported` as JSON, including installed and running versions.

Route manual requests through the updater so scheduled and manual installs share one owner and accepted updates continue if the CLI exits. Restart a running managed daemon when its binary or version differs from the selected installation; this may interrupt active or queued work. Return installer failures as command errors and retry requests across updater replacement.

## Testing

Add coverage for manual updates with automatic updates disabled, queued requests, same-version binary replacement, updater handoff retries, and unsupported installations or unmanaged servers.

GitOrigin-RevId: 240b63c79bae3a64a80768131a30da70900a4d62
2026-09-07 19:11:41 +00:00
Felipe Coury
333c41eef6 Show completion timestamps after successful TUI turns (#43558)
## What changed

Replace horizontal turn separators with dim completion metadata after the final answer, including plain conversational answers. Show local completion times such as `done 2:32 PM`, adding the date for other days and the year for other years. Retain `Worked for` durations above sixty seconds and runtime metrics, and wrap metadata on narrow terminals.

Restore saved completion metadata when resuming conversations or loading older history. Keep each footer after its turn's items and deduplicate it across repeated notifications and overlapping pages. Only live completions fall back to the current time when a saved timestamp is unavailable. Failed, interrupted, and in-progress turns do not receive success footers.

Avoid submitting queued input or emitting completion notifications while replaying history.

## Testing

Add unit and snapshot coverage for timestamp formatting, duration thresholds, muted styling, narrow layouts, live and replayed completions, missing metadata, and pagination boundaries with overlapping pages.

GitOrigin-RevId: 308c35c6720720da43c9a391aa5a68c1b231c9a5
2026-09-07 19:01:08 +00:00
Eric Traut
769a6a5bcd Record the launched app-server executable identity in PID files (#43552)
## Why

An installer can retarget the selected executable symlink or junction while an app server is running. Recording the launch-time identity preserves which binary was started after that path changes.

## What changed

- Resolve the executable path before launching on all platforms and store an optional executable identity in app-server PID records. Continue accepting older records without this field and expose the identity only for an active process.
- Use BLAKE3 for executable identity digests and make `ExecutableIdentity` serializable.
- Schedule updater checks with an explicit deadline in `tokio::select!`, preserving persisted update intervals, settings-error retries, and termination handling.

## Testing

Add a Unix test that verifies the recorded identity matches the resolved launch binary, differs from a retargeted symlink's binary, and remains optional when reading legacy PID records.

GitOrigin-RevId: 4821130b9a5e75b417a8e39c583b30427a872ff8
2026-09-07 18:52:37 +00:00
riley-oai
b7ad941b1f Add user-verification provider abstractions and RPC adapters (#43547)
## What changed

- Introduce `codex-user-verification` with a provider interface for credential status, creation, deletion, and challenge signing. Include typed errors, shared cancellation guards, and hashed account-user key namespaces.
- Add P-256 public-key encoding as unpadded base64url SPKI DER, derive credential IDs from its SHA-256 digest, and redact proof fields in debug output.
- Add app-server helpers to validate challenge and display-text bounds and map provider errors to typed RPC errors without exposing provider diagnostics.

The platform implementation reports verification as unsupported. App-server requests still return typed unavailability, with the message updated to mention build or account availability.

## Testing

Add tests for credential encoding and signature verification, invalid curve points, cancellation across guard clones, stable and distinct account namespaces, and invalid challenge or display values. Update the app-server unavailability test for the revised message.

GitOrigin-RevId: fe4a4eb37c68d7fdc547704e76aa257abf3e9c81
2026-09-07 18:43:20 +00:00
jif
4f1a2bb5ff Preserve fork runtime versions without loading full model context (#43545)
## Why

A fork cutoff can exclude the `TurnContext` that records the source's multi-agent runtime version. Recovering that version should not require loading the source's full model context.

## What changed

- Preserve `multi_agent_version` in fork session metadata before applying the cutoff. If absent, scan backward for the newest version-bearing `TurnContext`, respecting inherited segment boundaries and stopping once resolved.
- Load the latest model context for paginated forks only when approval or permission settings need to be restored.

## Testing

Add regression tests covering stored-version precedence, early termination without reading older segments, and version recovery within inherited segment cutoffs.

GitOrigin-RevId: 00e66bcce6f4092805e273cde99bd50f304fb39e
2026-09-07 18:34:49 +00:00
Eric Traut
7d8e2dd6c5 Make app-server daemon automatic updates configurable (#43542)
## Why

The managed daemon's updater used a fixed hourly cadence with no saved preference to disable automatic updates.

## What changed

- Read `updater.autoUpdateEnabled` and `updater.updateIntervalMinutes` from `CODEX_HOME/app-server-daemon/settings.json`, defaulting to enabled with a 60-minute interval. Keep the initial five-minute delay and require a positive interval.
- Apply the enabled preference during daemon lifecycle operations and re-read settings before updates and recurring waits. Preserve updater preferences and unknown fields when saving remote-control settings, using atomic file replacement.
- Signal the updater's process group on Unix so stopping it also terminates installer children. Allow daemon shutdown even when settings are malformed.
- Document updater configuration and remote-control preference behavior. Manual `codex update` remains unaffected.

## Testing

Add tests for settings preservation, interval validation, recurring waits, enabling and disabling updates across restart and bootstrap, Unix installer termination, and shutdown with malformed settings.

GitOrigin-RevId: 5dbb72c5939e9ced2390b3760a7265608c8b61a0
2026-09-07 18:26:04 +00:00
jif
cc737efd65 Preserve the multi-agent version when forking at a turn cutoff (#43540)
## Why

A fork cutoff can remove the only `TurnContext` recording the source thread's selected multi-agent version. Forking before the first turn must preserve that version, including when the child is resumed before its first turn.

## What changed

Recover the version from the untrimmed source history or loaded parent, independently of permission overrides, and carry it into the fork's session metadata for `last_turn_id` and `before_turn_id` cutoffs.

## Testing

Add regression coverage for forks before the first turn across legacy and paginated history modes, with loaded and unloaded parents and explicit permission overrides. Verify that the child persists `MultiAgentVersion::V2` and still uses the `collaboration` tools after restarting and resuming.

GitOrigin-RevId: d7e30cf8bfdeb4f755fefab3d1d0884964d7c977
2026-09-07 18:17:39 +00:00
felixxia-oai
81f23bc186 Move Guardian permission context into the shared section registry (#43538)
## What changed

Represent denied read paths and globs with `PermissionContext` and render them through a sync-only section in `codex-guardian-context`. Keep policy resolution in the host and preserve the existing permission warning in Guardian review prompts.

## Testing

Extend registry tests to verify permission sections appear only for synchronous reviews. Extend the session reuse test to check that resolved denied paths and globs appear in both the initial review request and the next review's delta.

GitOrigin-RevId: a966a14b367f1eedb5a577f7ed74a869559ae646
2026-09-07 18:10:05 +00:00
felixxia-oai
93ac341410 Preserve Guardian context sections and share planned-action rendering (#43534)
## What changed

- Replace `ComposedContext` with ordered `ContextSection` values that retain section identities through transcript selection and rendering.
- Add a shared `PlannedAction` section and renderer for core synchronous approval prompts and the Guardian V2 asynchronous scorer, preserving full, delta, terminal-input, and network-request framing.
- Keep action JSON and retry reasons out of `PlannedAction` debug output.

## Testing

Update registry and transcript tests to assert section identities and source roles. Extend registry coverage to verify planned-action collection for both consumers and omission of action JSON and reasons from debug output.

GitOrigin-RevId: 675b841a2cad06afce03f414615b4d7aa0553b13
2026-09-07 18:02:06 +00:00
felixxia-oai
53ba408a2f Fix jemalloc tools and compiler flags for Bazel musl builds (#43533)
The musl CLI allocator needs declared native tools and consistent header
flags. Configure `tikv-jemalloc-sys` to use Bazel's Make toolchain and LLVM's
`llvm-nm` and `llvm-ranlib`, and patch its build script to honor `MAKE`.
Preserve `CFLAGS` and `CXXFLAGS` when generating jemalloc header dependencies
so dependency generation uses the same compiler flags as compilation.

GitOrigin-RevId: 4022b587ce0c8bce9331c541adbdf29c1d245558
2026-09-07 17:53:04 +00:00