Commit Graph
11541 Commits
Author SHA1 Message Date
xli-oai 9563713df2 Notify lifecycle extensions of compaction usage limits (#49097)
## Why

Usage-limit failures during manual or post-turn compaction did not notify turn lifecycle extensions, leaving them unable to react to these errors.

## What changed

Emit the turn error lifecycle notification for `UsageLimitExceeded` in both compaction paths. Preserve the completed answer after post-turn compaction fails, and avoid duplicating the error already emitted by manual compaction.

GitOrigin-RevId: f31155e5991d762a0779030921aedbd1f818cfbb
2026-09-28 23:00:28 +00:00
cassirer-openai 2ce64843be Update h2 from 0.4.16 to 0.4.19 in Cargo and Bazel lockfiles (#49096)
GitOrigin-RevId: d38aedc1363465faf4aa5d8c61d10f4d32c8e1bf
2026-09-28 22:55:43 +00:00
Eric Traut 19892aee0c Simplify startup promotions to platform-specific desktop app tips (#49093)
## What changed

- Replace plan-specific and Fast-mode promotions with the desktop app tip for the current platform, while preserving announcement priority and random-tip fallback.
- Share desktop app tips between the preferred slot and random tip pool, including Windows. Keep Linux app tips limited to graphical sessions outside WSL.
- Clarify installation and launch instructions for macOS, Windows, and Linux, and format launcher commands as code.
- Remove the Fast-mode status plumbing used by tooltip selection.

## Testing

Add snapshots for all three platform tips at a narrow terminal width. Update tests to cover plan-independent tip selection and platform availability.

GitOrigin-RevId: 34bbc95c47c83618f9ac1691a1b69ca4690b8665
2026-09-28 22:40:35 +00:00
Eric Traut 222e24b737 Render follow-up directive labels in the TUI and copied responses (#49089)
## Why

Follow-up directives contain display labels and prompt attributes. Show the labels without exposing directive syntax or prompt text in rendered responses and streaming previews.

## What changed

- Render `:codex-followup[label]{prompt="..."}` as its label, preserving inline Markdown styling and source offsets.
- Replace recognized follow-up directives with their labels when copying whole responses, while retaining the original source.
- Withhold unfinished directives in rich streaming previews and avoid cropping into prompt attributes when the preview window advances.
- Preserve literal code, escaped directives, and malformed source when rendering completed messages or copying responses.

## Testing

Add regression coverage for label formatting, nested brackets and backticks, literal and malformed directives, whole-response copying, and streaming holdback across long prompts and preview window boundaries.

GitOrigin-RevId: dce61d1164de0a576fe95fb2c67b177a1ed414e8
2026-09-28 22:20:29 +00:00
Tamir Duberstein 88e9a8329d Track app-server running turns incrementally (#49084)
## Why

Every thread state mutation scanned all tracked runtimes to recount running turns while holding the state lock. This count supports graceful restart draining introduced in https://github.com/openai/codex/pull/12517.

## What changed

Maintain `running_turn_count` in `ThreadWatchState`, adjusting it when a runtime's `running` flag changes or a running thread is removed. Publish the cached count while preserving notifications only when the count changes.

## Testing

Extend the running-turn watch test to cover duplicate starts, two simultaneous running threads, and removal of a running thread, with counts checked against the runtime map.

GitOrigin-RevId: e7d7ebb33b9ff4d24dc70d8f01ae981378fed5f8
2026-09-28 21:33:00 +00:00
jif 46d2585ea4 Skip remote Git discovery for Guardian diff paths (#49082)
## Why

An offline secondary executor can stall Guardian approval revalidation while diff display setup searches for Git roots, even when the review concerns another executor.

## What changed

Use each environment's working directory as the diff display root for Guardian sessions, regardless of `CwdRelativeTurnDiffs`, so this setup does not wait for remote Git discovery.

## Testing

Add a regression test that withdraws authorization during a pending approval and disconnects an unrelated secondary executor. Verify that Guardian retries with the updated authorization and denies the request.

GitOrigin-RevId: 3661759119935c68539e9eab8df2e862987d0d92
2026-09-28 21:18:17 +00:00
Eric Traut fe50d010e2 Update and centralize TUI subscription labels (#49079)
## What changed

Use a shared subscription label mapping for status and analytics views. Rename
`Pro Extra` to `Pro 200`, `Pro Standard` to `Pro 100`, and `Pro Max` to `Pro 500`,
while preserving the existing differences between status and analytics labels
for other plans.

## Testing

Update the status plan-label test expectations for the three Pro tiers.

GitOrigin-RevId: 47af1e7d56ef9f7701caff8af315f530087920b8
2026-09-28 20:59:25 +00:00
Tamir Duberstein 011f803f3c Avoid collecting unused Git metadata in skill analytics (#49076)
## Why

Skill invocation analytics only needs the repository's origin URL, but
`collect_git_info` also checks the repository and reads its commit and branch.

## What changed

Extract and export `get_git_origin_url` and use it directly in skill analytics
to skip the extra Git commands. Reuse the helper in `collect_git_info`,
preserving URL sanitization and command timeouts.

GitOrigin-RevId: f878936937d0ff8c6313bb8168448e0b25ba1a39
2026-09-28 20:45:16 +00:00
sayan-oai 3749d1eff7 Preserve pending environments when spawning subagents (#49075)
## Why

Spawning a subagent before an environment was ready dropped the starting environment from the child's selections. The child needs to retain that environment and receive its configuration or failure when preparation finishes.

## What changed

- Pass the spawning step's environment snapshot to children, preserving ready and starting environments and configuration ownership.
- Propagate the original owner's first configuration result through descendants, applying each session's validation and leaving independently configured children unchanged.
- Preserve pending configuration waits across executor retries. Later owner updates do not overwrite the child's inherited configuration.

## Testing

Add regression coverage for fresh and forked subagents, readiness through turn-settings updates, failure propagation to children and grandchildren, child configuration precedence, and executor retries. Add a request snapshot showing a child using `wait_for_environment` before execution tools become available.

GitOrigin-RevId: a2afed740391f88d195596cfe28e418332b60d43
2026-09-28 20:42:04 +00:00
Tamir Duberstein 22d1d9336f Propagate Cargo package versions to Bazel Rust targets (#49074)
## What changed

Expose resolved Cargo package versions in `rules_rs` workspace `DEP_DATA` and pass them through `codex_rust_crate` to build scripts, libraries, binaries, and tests. This replaces the hardcoded `0.0.0` build-script version and supplies explicit versions to the other Rust targets.

GitOrigin-RevId: a3555beec3c5ecfc38d69c352b43696986352c49
2026-09-28 20:34:59 +00:00
Eric Traut 15c08beee2 Surface realtime voice catalog failures in the TUI (#49073)
## Why

Failed `thread/realtime/listVoices` requests silently fell back to the built-in catalog, allowing voice selection and conversation startup to proceed without the server's voice catalog.

## What changed

- Propagate catalog errors and show an error instead of opening the voice picker or starting a realtime conversation.
- If the catalog lookup fails after saving a preference, report that the preference was saved but the effective voice could not be confirmed. Leave the in-memory voice settings unchanged.

## Testing

Extend remote voice tests and snapshots to cover catalog failures when opening the picker, saving a preference, and starting a conversation. Verify that the preference is persisted, in-memory settings stay unchanged, and failed startup clears realtime state without sending `thread/realtime/start`.

GitOrigin-RevId: ba40800d6f9002e02e2b33de8dc858188c3cddd7
2026-09-28 20:34:33 +00:00
Dmitriy Kovalenko 33a0f766a6 Reclaim unused SQLite log database pages in the background (#49069)
## Why

Deleting logs leaves free SQLite pages available for reuse without shrinking the database file. Reclaim excess free space while preserving a reserve for future writes.

## What changed

- Start a background incremental-vacuum worker with `StateRuntime`, enabling reclamation only for the logs database. Use a per-home file lock to select one worker and wait for it to finish during shutdown.
- Reclaim pages when at least 64 MiB and 25% of the database are free, preserving a reserve of at least 16 MiB or 10% of the database.
- Use short transactions with page and cooperative time budgets, defer work on contention, and reduce batch sizes with exponential backoff when interrupted passes make no progress.
- Record reclamation counts, durations, and reclaimed pages in telemetry.

## Testing

Add a regression test that interrupts a vacuum commit, verifies foreground writes can resume without data loss, then confirms a resumed pass shrinks the database and passes `PRAGMA integrity_check`.

GitOrigin-RevId: 8421f87b0aeef6540eda5690c84216906673c72e
2026-09-28 20:19:10 +00:00
zm-oai 5a5a4aa796 Keep configuration values out of Windows sandbox policy events (#49067)
## Why

Configuration parser errors can include entire configuration lines containing credentials. Persistent policy-rejection events must avoid recording those values.

## What changed

Replace free-form error text in Windows sandbox provisioning policy-rejection events with known stage labels and typed cloud, HTTP, I/O, and Win32 error codes. Use fixed fallback labels when the stage or cause is unrecognized.

## Testing

Add regression coverage using malformed requirements and cloud configuration fragments containing a synthetic secret. Verify that diagnostics exclude parser values while retaining safe error codes, and that unknown errors produce fixed fallback text.

GitOrigin-RevId: 4f2fa5f6f602c34451776ec31381a102213660b8
2026-09-28 19:56:33 +00:00
cassirer-openai a1f05faddb Update Guardian handoff snapshot for separate agent messages (#49065)
## What changed

Update the `guardian_handoff_delegation` snapshot to include three separate `agent_message` items interleaved with user transcript messages, with corresponding transcript numbering and message counts.

GitOrigin-RevId: cae688e00f96d9545eccd7891426cfb4948a6dbf
2026-09-28 19:48:54 +00:00
Dmitriy Kovalenko e07e58c842 Update Guardian messaging snapshots for native agent messages (#49060)
Refresh the Code Mode messaging snapshot to include a native `agent_message`
entry between transcript segments, with updated message and action numbering.
Adjust retained-instruction spacing in the encrypted parent reply snapshot and
refresh assertion-line metadata in both snapshots.

GitOrigin-RevId: 1ee003cfb9df89faabd2f35e9d656423f16e0501
2026-09-28 19:08:32 +00:00
Darius Karel df3e439c02 Fix Windows sandbox ACL repair for long runtime paths (#49058)
## Why

Runtime ACL repair needs to handle nested files and directories beyond the legacy Windows path limit.

## What changed

Use Rust's `OpenOptions` for ACL reads and handle-based `SetSecurityInfo` for updates to support extended-length paths. Request ACL-write access only when grants need updating, and share allocation cleanup across success and error paths.

## Testing

Add a regression test covering long directory and file paths alongside a short-path control. Verify repeated repairs grant read/execute access without granting write, delete, or ACL-management rights, and that already-correct grants remain no-ops.

GitOrigin-RevId: 325c17085fa4379eebe982d49175dd2151b0681e
2026-09-28 19:01:20 +00:00
jif 6288753b46 Add handoff-aware root context for Guardian reviews (#49057)
## What changed

Add the disabled-by-default `guardian_root_handoff_context` feature to select worker-specific root evidence for Guardian reviews. Use recorded `spawn_agent`, `send_message`, and `followup_task` calls targeting a worker or its ancestors to select the three preceding root messages per handoff, plus the three latest root messages so recent cancellations remain visible before another handoff.

Preserve verified tool answers and evidence without known ordering, and retain the existing shared message cap. Fall back to the existing root context when no usable handoff window remains or the latest authorization message is a heartbeat. Update the review context revision when the selection changes.

## Testing

Add a delegation scenario and Guardian request snapshot covering ancestor handoffs, separate worker branches, cancellation visibility, and fallback after compaction removes handoff calls. Extend heartbeat coverage to exercise the new feature and verify that the latest turn's trusted skills are retained.

GitOrigin-RevId: 87dc39158f78b2b7e9f4f2e4afc653257ea12025
2026-09-28 18:51:10 +00:00
Eric Traut 4f63088cce Update Pro plan display names in the TUI (#49043)
## What changed

Update plan labels in the analytics views and status display:

- `PlanType::Pro`: `Pro (More)` → `Pro Extra`
- `PlanType::ProLite`: `Pro` → `Pro Standard`
- `PlanType::ProMax`: `Pro (Max)` → `Pro Max`

## Testing

Update the status display-name test expectations for all three Pro tiers.

GitOrigin-RevId: 9bd9f1cd8a701019fd40047cd8131e6193f66cb9
2026-09-28 17:58:35 +00:00
Felipe Coury 3074be908a Copy selections within inline code as plain text (#49041)
## Why

Copying text selected entirely within inline code added Markdown backticks that were not part of the selected content.

## What changed

Return only the selected content as plain text when the selection is contained within one inline code span, including in a single table cell. Preserve Markdown formatting for selections that also include surrounding content, and continue filtering control characters from table copies.

## Testing

Add regression coverage for full and partial inline code selections, embedded backticks, Unicode, whitespace, wrapping and resizing, and table selections with mixed content or control characters.

GitOrigin-RevId: c63e13cb781f9fca28ae53500cb4f9ae08b72c96
2026-09-28 17:51:00 +00:00
felixxia-oai 368e5eae2f Preserve encrypted agent messages in Guardian reviews (#49038)
## Why

Guardian transcripts omitted encrypted agent messages, leaving reviews without evidence such as encrypted parent replies.

## What changed

- Carry encrypted `agent_message` items through synchronous reviews and asynchronous scoring, preserving their order, author, recipient, and ciphertext.
- Account for native messages in context budgets and omit them whole with an explicit notice when limits require it.
- Support mixed text and native messages during review admission while retaining user-content annotations.

## Testing

Add coverage for transcript ordering and budget eviction in both reviewer profiles, plus a mocked scenario verifying that an encrypted parent reply appears exactly once in each of two incremental Guardian reviews.

GitOrigin-RevId: abc2f1ce5accd83beb06f799ef9ed9d7fa2cd90a
2026-09-28 17:40:25 +00:00
Felipe Coury 64bf4e7e62 Show the Plan mode cycling hint in the fullscreen status line (#49037)
## Why

The fullscreen status line showed Plan mode without explaining how to leave it.

## What changed

Show `Plan mode (shift+tab to cycle)` when the composer is idle and accepts input, and the hint fits alongside the status text. Fall back to the mode label when space is limited, and hide the shortcut during tasks, popups, interactive footer use, or other non-composer modes.

## Testing

Add a rendering snapshot and regression assertions for wide and narrow layouts, running tasks, interactive search, empty status text, disabled input, and parent-owned threads.

GitOrigin-RevId: a1cf2762b33f5442ab0611a15205f2e36c84b075
2026-09-28 17:39:56 +00:00
felixxia-oai 41ed72c32b Add opt-in conversation history retrieval to Guardian reviews (#49036)
## Why

The transcript supplied to Guardian may omit earlier user instructions, restrictions, or revoked permissions. History retrieval lets the reviewer check relevant authorization before approving actions with side effects.

## What changed

- Add the disabled-by-default `guardian_conversation_history_tools` feature. With Apps enabled, expose `user_message.search_messages` and `user_message.read_messages` through the parent's live Apps connection and conversation identity.
- Recheck the parent's current app and tool policy on each call, rejecting disabled tools and calls requiring approval.
- Add retrieval instructions that distinguish user authorization from assistant context and account for later revocations and incomplete results. Allow overrides through `auto_review.experimental_conversation_history_prompt`.
- Limit history responses to an estimated 4,000 tokens by default, configurable through `auto_review.conversation_history_max_output_tokens`, while preserving stricter parent and reviewer limits.
- Allow explicit extension registries for isolated sessions and prevent those sessions from inheriting the implicit Apps connection.

## Testing

Add scenarios covering history tool exposure, parent connection and identity reuse, custom prompts, output truncation, stricter reviewer budgets, and live permission changes on a reused reviewer. Extend configuration coverage for blank prompt overrides.

GitOrigin-RevId: 055a69b113c8548bd58e7d5618ea026ba6d1ffb1
2026-09-28 17:29:52 +00:00
jif 46fdd5ef39 Avoid SQLite stalls from connection setup and stderr span logging (#49032)
## Why

Setting `auto_vacuum` on every connection can wait for a writer lock even when the mode is unchanged. Logging every span entry and exit can also block SQLx workers on undrained stderr while they hold a write transaction.

## What changed

- Set incremental vacuum only for empty databases or databases using full auto-vacuum, before enabling WAL. Preserve existing nonempty databases with auto-vacuum disabled.
- Emit span creation and closure events in app-server text and JSON stderr logs, preserving busy/idle timings and explicit events while omitting span entry and exit records.

## Testing

Add regression tests for opening and expanding writable pools while another connection holds a writer lock, and for transaction completion with undrained stderr in both log formats. Verify vacuum modes and retained log diagnostics.

GitOrigin-RevId: 40d4ef32c7efc49f4240b987277ba45551259335
2026-09-28 17:00:25 +00:00
Benjamin Carlsson d8fc718809 Clarify ChatGPT sign-in success copy (#49031)
Describe permissions and approvals explicitly in the Codex docs link text,
and clarify that the user's ChatGPT plan rate limits and training data
preferences apply. Remove the “Before you start” preamble to shorten the
success screen.

Update the rendering snapshot and hyperlink styling assertions for the
revised copy and layout.

GitOrigin-RevId: 5166ddade6a433191fa86c960899c4da5092b9f5
2026-09-28 16:52:39 +00:00
aionescu-oai f817e16905 Use the numeric ioctl value in the macOS sandbox policy (#49028)
Older macOS policy compilers do not define the `TIOCSTI` symbol. Generate the sandbox CLI's Seatbelt deny rule with the numeric value from `libc::TIOCSTI` so it remains compatible while blocking terminal input injection.

GitOrigin-RevId: de8113fbab92bb399f37b9a22762c5c649f25972
2026-09-28 16:45:54 +00:00
iceweasel-oai 4fd5745e84 Use a compatible PowerShell fallback for the Windows MXC sandbox (#49019)
## Why

Microsoft Store PowerShell cannot run under MXC. The existing fallback to an unpackaged PowerShell executable only applied to the elevated Windows sandbox.

## What changed

Extend local PowerShell fallback discovery to MXC in `unified_exec`, using the executor's Windows sandbox selection. Keep discovery local and automatic `-NoProfile` insertion specific to the elevated sandbox. Skip this preparation for non-Windows target paths.

## Testing

Extend command-preparation tests to cover MXC and add a Windows integration test that replaces a Store PowerShell path before launch, writes a file successfully, and verifies `windows_mxc` sandbox metadata.

GitOrigin-RevId: 6c581396525a8fec7e1fb538b3e63b0de2ddb926
2026-09-28 15:58:17 +00:00
jif 69f7140559 Isolate the memory startup metadata test from Git enrichment (#49000)
## Why

Best-effort workspace enrichment can time out independently of the detached
request metadata checked by the memory startup test.

## What changed

Keep the phase-one service-tier and detached-metadata test fixture outside Git
and assert that `workspaces` is absent. Update the header assertion message to
refer to turn metadata.

GitOrigin-RevId: 9541668fc62a28d1ff3131d7f71b351149b6e152
2026-09-28 14:46:32 +00:00
jif c0d26949be Avoid full metadata rewrites for thread timestamp updates (#48983)
## Why

Updates that only change `updated_at` should not rewrite unrelated thread metadata or its indexes.

## What changed

Use `touch_thread_updated_at` for timestamp-only patches when the SQLite row exists and the rollout path is unchanged. Preserve the full update path for missing rows, changed rollout paths, and patches containing other metadata, including staged changes.

## Testing

Add regression coverage for legacy and paginated histories that verifies missing-row reconstruction, timestamp-only writes using SQLite triggers, preservation of other metadata, and application and removal of staged metadata.

GitOrigin-RevId: d5bc70d57e591e3eb8e9521f0c31a7ef75f244d3
2026-09-28 13:43:55 +00:00
eknight-oai 06971ec9aa Prevent message-board notifications from reopening final answers (#48982)
## Why

Message-board notifications delivered as ordinary injected input could cause an agent to sample again after its final answer.

## What changed

Route notifications through the current turn's mailbox as `InterAgentCommunication`, checking atomically that the turn is running and still accepts mailbox delivery. Skip notifications when delivery is closed. Accepted notifications may remain in conversation history for a later turn without reopening the finalized answer or starting a new turn.

Report pending inter-agent communications as mailbox activity, while preserving priority for steering input.

## Testing

Add regression scenarios for notifications arriving before and after finalization, asserting no extra sampling and the expected notification presence in the next turn. Extend input-queue coverage to recognize already-pending mailbox activity.

GitOrigin-RevId: 41d786041b4eccc5ccf926f2f190473676a3ac2f
2026-09-28 13:35:22 +00:00
jif 1b1835f751 Isolate realtime auth fallback test from startup prewarm (#48973)
## Why

Startup prewarm can reconnect after its empty WebSocket connection closes,
consuming the scripted realtime session reply in the environment-key fallback
test with ChatGPT authentication.

## What changed

Use separate WebSocket servers for startup and realtime traffic, configuring
`experimental_realtime_ws_base_url` to point to the realtime server. Assert that
it receives exactly one handshake and that the handshake uses the environment
key for authorization.

GitOrigin-RevId: 0e8ba4bdd66ef8aa3c619e36454dded9dcf55444
2026-09-28 12:05:27 +00:00
Eric Traut 44fe510ce3 Expand native Mermaid flowchart syntax support (#48895)
## What changed

- Default `flowchart` and `graph` to top-down layout when no direction is specified.
- Support solid and dashed edges with directed, undirected, or bidirectional endpoints: `-->`, `---`, `<-->`, `-.->`, `-.-`, and `<-.->`.
- Accept pipe labels on these edges and spaced directed infix labels such as `A -- send --> B` and `A -. retry .-> B`.
- Expand `&` groups into all source-to-target edges, including in chains. For example, `A & B --> C & D` creates four edges. Enforce the 24-edge limit after expansion and cap each group at 24 node references.

## Testing

Add coverage for equivalent syntax, edge styles and endpoints, malformed input, and expansion limits. Extend rendering snapshots across all four directions and the TUI native-renderer test with the new syntax.

GitOrigin-RevId: 6e51653ebf6b8b7e7e1edec0c2e09a5d9c8dec74
2026-09-28 06:30:53 +00:00
Felipe Coury 1cc7e23612 Show a short, neutral TUI interruption notice (#48830)
## What changed

Render interrupted turns with secondary text styling and shorter wording,
removing the suggestion to tell the model what to do differently.

## Testing

Update interruption snapshots and assert that the notice uses secondary text
styling.

GitOrigin-RevId: 7cb042ed9e6781d107a93d5677fa193f082c764d
2026-09-28 01:10:27 +00:00
zm-oai e6f4af1d92 Wait briefly for the Windows sandbox provisioning service to start (#48829)
## Why

Allow the provisioning service time to start without holding up desktop readiness checks for the full provisioning timeout.

## What changed

- Poll service status while startup is pending, waiting up to five seconds within the caller's deadline. Treat absent, deletion-pending, or other non-running service states as unavailable.
- Preserve the original provisioning deadline for pipe availability and request processing, and reject requests whose deadline expires during server authentication.
- Recheck service status when the pipe disappears while waiting for an available instance.

GitOrigin-RevId: ea89175cb41749b9768ac5915083bbfd8ad32713
2026-09-28 00:59:19 +00:00
Benjamin Carlsson 81d5405882 Allow archiving threads before their first turn (#48828)
## Why

Fresh threads have no rollout until their first turn, so archiving them previously failed with a missing-rollout error.

## What changed

Persist loaded, non-ephemeral threads before looking them up for archival. This lets a newly started thread be archived without creating a user turn.

## Testing

Update the archive regression test to cover threads with no turns in both legacy and paginated history modes. Verify the archive notification, empty turn history, `NotLoaded` status, and archived rollout path.

GitOrigin-RevId: 507351c6238ad96f5e3ffbd2ed7f432058e3d52c
2026-09-28 00:58:56 +00:00
Benjamin Carlsson 6af89155d0 Show a hand pointer over transcript links in Ghostty and Kitty (#48827)
## What changed

- Show a hand pointer over actionable transcript links while Codex captures mouse input in Ghostty and Kitty, excluding sessions inside terminal multiplexers.
- Share link hit testing between hover and click activation, and refresh hover after rendering so scrolling and live output cannot leave a stale hand pointer.
- Suppress link hover during mouse presses and drags, overlays, and popups, and clear remembered mouse coordinates on focus loss, resize, and resume.
- Restore the terminal's pointer policy when releasing mouse capture, releasing Kitty's override and using a text pointer in Ghostty. Deduplicate pointer updates and preserve cleanup after write failures.

## Testing

Add tests for wrapped links containing wide characters, hover/click target agreement, scrolling, pointer transitions and restoration, write-failure retries, and hover invalidation.

GitOrigin-RevId: 1cf52e039a229e12260fa334879784c9bc1c8c87
2026-09-28 00:53:05 +00:00
Benjamin Carlsson 84cc4b3fb5 Keep voice RTP timestamps aligned to 20 ms packets (#48824)
## Why

Capture jitter and mute transitions can shift RTP timestamps off the 20 ms source grid, causing receivers that assemble fixed-duration frames to reject subsequent audio.

## What changed

Advance elapsed gaps in whole 20 ms packets and keep the track clock on that grid. Bias empty gap durations by 1 ns to avoid losing an RTP tick to floating-point truncation.

## Testing

Update jitter and mute tests to assert exact clock advancement, including a 580 ms gap, and verify that resumed RTP timestamps stay aligned to 960-sample packets.

GitOrigin-RevId: 1511c739b77ee5871f72723fd34cb67aa9a48c95
2026-09-28 00:43:04 +00:00
Matthew Zeng 456212ca21 Use explicit histogram buckets for tool and skill context metrics (#48819)
## What changed

- Give tool fragment sizes and namespace counts logarithmic boundaries through 32,768.
- Give enabled and kept skill counts integer boundaries from 0 through 512, removed description characters logarithmic boundaries through 131,072, and skill truncation flags boundaries at 0 and 1.
- Record these metrics with explicit boundaries, separating zero values and retaining overflow buckets above each range.

## Testing

Extend tool and skill metric tests to assert explicit boundaries. Add an export test covering zero, one, the upper boundary, and overflow, including bucket counts, ordering, and sample totals.

GitOrigin-RevId: 9fbf3acbe352d7c74f3ad11f0b690148c083a6ef
2026-09-28 00:05:54 +00:00
Eric Traut 659b35f131 Preserve punctuation and semicolons in Mermaid labels (#48814)
## Why

Splitting every statement at semicolons and rejecting label punctuation prevents rendering labels such as `A["Go []; &"]`, sequence messages containing `data[0] = {x: 1}`, and class members containing semicolons.

## What changed

- Split statements using diagram-specific rules, preserving semicolons inside flowchart labels, quoted tokens, and class member lines. Sequence quotes remain literal text.
- Respect quoted flowchart label delimiters and allow printable label punctuation, including literal ampersands and comparison operators.
- Reject unsupported entity escapes before statement splitting can truncate them, while retaining rejection of HTML markup and malformed labels.
- Document the supported syntax and require newlines between class members.

## Testing

Add parser assertions and update rendering snapshots for punctuation, quoted delimiters, and semicolons. Extend rejection coverage for entity escapes across diagram families, malformed quotes, and invalid class bodies.

GitOrigin-RevId: da94007a66c7c58444e6f0d6a1b409c8c7251941
2026-09-27 23:41:04 +00:00
vkg-oai 3f4668da20 Add history-aware prewarming for idle threads (#48812)
## What changed

- Add `CodexThread::prewarm_with_history()` to prepare a WebSocket response with existing conversation history and executed-tool metadata using `generate: false`. The next turn can reuse the prepared response when its prompt extends that history and request settings match.
- Keep startup prewarming and `prewarm()` on the existing empty-input path, and skip preparation when the cached WebSocket is ready.
- Label prewarm telemetry by input mode and WebSocket continuation metrics with `after_prewarm`.
- Rename `persistent_mode_enabled` to `persistent_execution_enabled` without changing its behavior.

## Testing

Extend WebSocket coverage to check history preservation during reconnect prewarming, reuse of the prepared response on the next turn, and omission of `previous_response_id` for a non-prefix prompt.

GitOrigin-RevId: c7731541b11b2e6668027a47f37f696213268c66
2026-09-27 23:21:25 +00:00
Felipe Coury 99f7758a57 Show short turn durations in TUI completion footers (#48807)
## Why

Completion footers hid known durations unless they exceeded 60 seconds, leaving short turns without elapsed-time information.

## What changed

Show all known durations for live and restored turns, rendering sub-second durations as `Worked for <1s`. Separate completion metadata with `•` instead of `·`.

## Testing

Update live completion, history replay, and separator tests to cover short durations, missing timestamps, and the revised footer format. Refresh affected TUI snapshots.

GitOrigin-RevId: 666e765db5426c5f9cc00d73f71cab649ad34947
2026-09-27 23:02:36 +00:00
Felipe Coury d9487a2930 Allow transcript wheel scrolling while a modal is open (#48805)
## Why

The “Implement this plan?” prompt blocked transcript scrolling, preventing users from reviewing earlier steps in a long plan while deciding how to proceed.

## What changed

Allow mouse-wheel scrolling over the visible transcript while a modal is active. Keep keyboard input with the modal and preserve restrictions on transcript selection, scrolling outside the transcript, and scrolling with completion popups open.

## Testing

Add input tests and a snapshot covering plan-prompt scrolling, keyboard navigation, dismissal and submission, pointer boundaries, and completion-popup behavior.

GitOrigin-RevId: ac5227c877ce34324a0d3830d5383495241ddbc3
2026-09-27 22:55:27 +00:00
Eric Traut abc8f0c9a1 Use the terminal palette for ordered Markdown list markers (#48800)
## What changed

Render ordered list markers in the TUI with the terminal's `LightBlue` color instead of `accent_color()`.

## Testing

Add a snapshot covering ordered list markers alongside links and inline code. Update rendering expectations and nested-list streaming tests to assert `LightBlue`, including the incremental rendering snapshot.

GitOrigin-RevId: dea0081737a5bbe8652c761582fb82b20964431a
2026-09-27 22:14:21 +00:00
Eric Traut 4c8cf3964d Fix SGR mouse reporting for Windows terminal capture (#48799)
## Why

Some Windows terminals send legacy mouse reports as key records. Requesting SGR reports lets ConPTY translate them into mouse records.

## What changed

Write and flush the SGR encoding request separately from `EnablePointerCapture`, so it also reaches terminals when capture uses the Windows console API. Explicitly reset SGR encoding during Windows mouse cleanup, even if restoring the console mode fails.

## Testing

Add regression tests for cleanup after SGR setup fails and an isolated Windows console test that checks mouse input activation, SGR encoding, and restoration of the original console mode and default encoding.

GitOrigin-RevId: c1a48d641cda4e770dbbe9fdf805a27e036d35c3
2026-09-27 22:13:56 +00:00
Won Park d7748e1185 Add opt-in structured errors for Guardian circuit-breaker interruptions (#48796)
## Why

Guardian denial-limit interruptions lack a structured error identifying the cause. Make this opt-in because older clients may not recognize the new error in shared history.

## What changed

- Add `auto_review.circuit_break_action = "strict"` to attach `TooManyDenials` to the interrupted turn. The default leaves the error unset.
- Expose `turn.error.codexErrorInfo = "tooManyDenials"` in app-server notifications and saved history, and update protocol schemas and generated types.
- Preserve the warning, denial limit, and interrupted status without emitting a separate error notification.

## Testing

Add an integration test covering omitted, `default`, and `strict` settings, checking warnings, live turn errors, the absence of separate error notifications, and persisted turn errors after restart.

GitOrigin-RevId: cb5d379e64728d4d7b9daf834c13756e4a70db31
2026-09-27 22:05:19 +00:00
victor-openai ea64727556 Add single-server MCP status discovery with thread connection reuse (#48783)
## Why

Inspecting one MCP server should not require full-inventory discovery or a separate connection when a thread already has one.

## What changed

- Add optional `serverName` to `mcpServerStatus/list` and update generated schemas and bindings.
- With `threadId`, apply any pending runtime refresh and reuse the thread's current connection and tool catalog, waiting only for the selected server during discovery.
- Without `threadId`, create a discovery connection for only the selected server. Unknown names return an empty page; omitting `serverName` preserves full-inventory discovery.

## Testing

Add a regression test covering both status detail modes, checking that tool metadata is preserved and that status reads do not repeat `initialize` or `tools/list` requests.

GitOrigin-RevId: 1b361b67a993ab45cae493e88c146f50cfaf753a
2026-09-27 21:07:54 +00:00
felixxia-oai 21eb35513d Preserve independent Guardian history across parent compaction (#48779)
## Why

Guardian reviews need to retain original evidence across parent compaction when checkpoint reuse is disabled, including after resume and rollback.

## What changed

- Make disabling `guardian_reuse_parent_compaction` select a bounded, independent review transcript while preserving thread-owned authorization.
- Keep synchronous reviews and asynchronous scoring independent of parent checkpoints, and allow reviewer sessions to continue using transcript deltas across parent compaction.
- Persist transcript entries with rollback provenance while remaining compatible with older checkpoint readers and metadata-free checkpoints.
- Exclude compaction output from the transcript and synthetic summaries from rollback turn boundaries. Use acceptance ordering to remove rolled-back evidence even when persistence order differs.

## Testing

Add regression coverage for reviewer continuity, evidence retention across compaction and resume, rollback after local and remote compaction, and checkpoint serialization compatibility.

GitOrigin-RevId: fea0852cc5537372854f4a34bacb6bfda6d13e88
2026-09-27 20:15:23 +00:00
Eric Traut 89bf86d0bd Remove the current badge from TUI task rows (#48776)
Let task titles use the space previously reserved for the `current` badge
in the agents overview. Update the overview assertion and rendering
snapshots to match.

GitOrigin-RevId: 6a007d4f8b1a3a77459895725e2db8ef4a4d584d
2026-09-27 19:48:44 +00:00
Eric Traut 596f8c5c3c Match pinned transcript headers to the original prompt style (#48775)
## What changed

Add the `› ` prefix to pinned prompt headers, using bold red for spoken prompts and bold dim styling for other prompts. Reserve one column when truncating the header.

## Testing

Add a rendering test comparing pinned headers with the original prompt rows for both regular and spoken prompts. Update snapshots for the prefix and display-width truncation.

GitOrigin-RevId: 89c2d9267374ef8f6504058c12c078025f302fef
2026-09-27 19:47:40 +00:00
Eric Traut fdbce2080c Fix Unix socket connections through long symlink paths (#48772)
## Why

An advertised control socket path can exceed the Unix socket path limit even when its symlink target is short enough to connect to.

## What changed

On Unix, resolve the socket path and retry the connection when the initial attempt returns `InvalidInput`.

## Testing

Add a regression test that creates control sockets under two long home paths, checks that their symlink targets are distinct, and verifies that clients can connect through both advertised paths.

GitOrigin-RevId: 2541f0a9b02d85035fa89fe26bbcd36d5cd0cc1e
2026-09-27 19:14:24 +00:00
victor-openai 32f5784851 Preserve MCP app resource URIs without defaulting display mode (#48764)
## Why

Defaulting missing or unsupported display preferences to `inline` prevents clients from applying resource display defaults.

## What changed

Populate `mcpAppUi` only when a tool descriptor has a resource URI and an explicit `inline` or `fullscreen` preference. Preserve `mcpAppResourceUri` independently in tool-call events, including when `mcpAppUi` is unset, and document the behavior.

## Testing

Update integration coverage for explicit display modes, missing and unsupported preferences, and legacy resource URIs, checking tool-call events and resumed history.

GitOrigin-RevId: 4876cced068d8e464adeb265abd053d8abe667ce
2026-09-27 18:20:25 +00:00