Commit Graph

2636 Commits

Author SHA1 Message Date
Ian MacLeod
07f18d5ff7 Support selectable answers for asynchronous TUI questions (#42894)
## Why

Asynchronous questions can include suggested answers, but the TUI previously displayed only a freeform input. Show those choices and require them to be fully visible before submission.

## What changed

- Render numbered, wrapped choices with a default selection, list navigation, and digit shortcuts. Submit the selected label as the answer.
- Block submission of clipped choices and prompt the user to expand the terminal. Limit option processing to the first 32 entries and discard labels over 512 bytes.
- Preserve freeform input when no usable choices remain, and add contextual submit, skip, and question navigation hints.
- Ignore repeated submit keys so holding a key cannot answer another question.

## Testing

Add state, snapshot, and chat widget tests covering wrapped and clipped choices, constrained layouts, option limits, long answer preservation, oversized answer rejection, key repeats, and conflicting keybindings.

GitOrigin-RevId: 5d3ebadf61da62a9680ba819e6dfcf8302c4e9da
2026-09-05 00:36:20 +00:00
Ian MacLeod
218e8df926 Integrate asynchronous questions into the TUI (#42891)
## What changed

- Display questions from live agent messages with a collapsed question count and an expandable answer editor.
- Support navigating, answering, queueing, and skipping questions while preserving the main composer draft. Expose question navigation and skip actions in the keymap picker.
- Route answers through existing input delivery and consume them only after an accepted send or queue operation. Keep questions editable while disconnected, with delivery and skipping disabled.

## Testing

Add tests for answer delivery, queued answers, retained drafts, disconnected editing, Vim undo, buffered input, constrained layouts, and question shortcut descriptions.

GitOrigin-RevId: 084b54dceb8c0100aefbf9f0b7897bf8d26eac47
2026-09-05 00:15:42 +00:00
Ian MacLeod
6ae8dcf6e1 Add TUI building blocks for inline async question editing (#42889)
## What changed

- Introduce an async-question editor component with per-question drafts, navigation, replay deduplication, and submit or queue handling using the shared composer.
- Add bounded `AnsweredQuestion` framing that truncates question text at a UTF-8 boundary and flattens line breaks before prepending it to an answer.
- Add `prompt_stack_back` and `skip_question` keybinding actions and the `tui.question_esc_back` setting. Normalize `Ctrl+]` and `Ctrl+5` for key matching and conflict detection, and let default question shortcuts yield to explicit bindings.
- Flush buffered typing in both the main composer and the covering view so background input cannot keep the draw loop waiting.

The async-question component is not yet connected to the TUI event flow.

## Testing

Add regression coverage for bounded Unicode question framing, question-shortcut conflicts, and paste-buffer flushing in background and covering editors.

GitOrigin-RevId: 4098043cf588ddafc05c27505645495edd690cb9
2026-09-04 23:56:25 +00:00
rhan-oai
a97cf1b72e List GPT-6-Astra in the model picker (#42879)
## What changed

Set GPT-6-Astra's bundled model visibility to `list` so it appears first in the interactive model picker, and update the picker snapshot for the new entry and numbering.

GitOrigin-RevId: 1bbbb7cb932b53d121a2d3246343c06e120da2f7
2026-09-04 22:47:01 +00:00
faizan-oai
3921a30d6b Persist Daybreak preferences in thread metadata (#42854)
## Why

Clients need a per-thread Daybreak toggle that survives restarts and can be
restored on resume without changing the access program of an active or future
turn.

## What changed

- Add experimental `daybreakEnabled` support to `thread/metadata/update` and
  expose the saved value on thread responses.
- Store the preference in SQLite, including for threads without a first turn,
  and preserve it through reads, resumes, reconciliation, and restarts.
- Copy the preference when forking a thread while keeping subsequent updates
  independent.
- Keep `daybreakEnabled` separate from the per-turn `cyberAccessProgram` field;
  app-server does not derive one from the other.

## Testing

- Cover persistence across restarts, cold reads, reconciliation, and forks.
- Verify metadata updates do not alter the access program of active or later
  turns.

GitOrigin-RevId: bcf987a9fcd7b0ac8a88b1c8f0df06b33ed8ad6e
2026-09-04 21:17:25 +00:00
Felipe Coury
7a8092a447 Preserve Markdown formatting when copying TUI responses (#42847)
## What changed

- Add rendered HTML alongside the original Markdown when copying a whole response through the native clipboard, so rich-text destinations preserve headings, lists, tables, code, and other formatting.
- Keep code-block, blockquote, transcript, terminal, and WSL clipboard copies as plain text.
- Escape raw HTML, omit remote image sources, and render unsupported link destinations as visible text when producing clipboard HTML.

## Testing

- Add coverage for rich formatting, local and unsafe links, inert images, fenced tables, copy selection formats, and clipboard fallbacks.

GitOrigin-RevId: c6f5edd88b65f9e9b1ddc5618442868cf47ee560
2026-09-04 20:38:08 +00:00
Ian MacLeod
147137c1f4 Add Astra sparkle effects to the TUI composer (#42842)
## What changed

- Render sparse, fading stars across the composer when using an Astra model in a true-color terminal.
- Preserve composer content, cursor state, effort effects, and terminal colors, and pause the animation while popups are open.
- Add the default-on `tui.whimsy` setting so decorative effects can be disabled independently. Sparkles also respect `tui.animations`.

## Testing

- Cover model and setting eligibility, terminal color handling, protected composer cells, popup behavior, effort effects, and layout stability.

GitOrigin-RevId: fe0471ebef0bca21c44e1d8f731d46959eba0165
2026-09-04 20:18:13 +00:00
iceweasel-oai
773f0b081d Preserve executor paths in Guardian approval reviews (#42838)
## Why

Guardian approval actions can contain paths from a remote executor whose path convention differs from the host, such as Windows paths reviewed on a POSIX host. Converting those paths to host-native absolute paths prevents the action from being reviewed.

## What changed

- Render command working directories using the executor's reported path convention, and preserve URI-backed paths for attribution.
- Carry foreign command and patch paths through Guardian events and app-server schemas as legacy path strings.
- Bound remote plugin attribution within the overall review deadline and reject Guardian action payloads that exceed the review byte limit.

## Testing

- Cover Windows and POSIX executor path rendering, foreign patch paths, protocol round trips, oversized payload rejection, and remote Guardian review context.

GitOrigin-RevId: 38be0fcdac897139519e74e077eb5cb4f8f8017e
2026-09-04 19:56:31 +00:00
Eric Traut
80ab0ffafe Add data-use disclosures to the user report dialog (#42798)
## What changed

- Show audience-specific data-use disclosure copy and links before report submission.
- Keep the note editor and submit/cancel controls visible in short panes while allowing the disclosure to scroll with `PageUp` and `PageDown`.
- Clarify the employee completion message with its report ID and link.

## Testing

- Add snapshot coverage for both audiences, narrow widths, short panes, and four-row panes.
- Cover submit and cancel behavior in the report note view.

GitOrigin-RevId: c025bcfbbd39e462685b211ef9392664e7de4f71
2026-09-04 16:39:46 +00:00
Eric Traut
47b0f7d540 Extract the note input view into its own module (#42792)
## What changed

Move the optional note input and its focused tests out of the broader submission
module. Update the bottom-pane export and snapshot metadata to match the new
module layout without changing submission behavior.

GitOrigin-RevId: 383ad052b47571f8a46e1aa6182261c370008be0
2026-09-04 16:08:14 +00:00
Eric Traut
a07158c784 Keep TUI prompt history tied to local settings (#42791)
## Why

Prompt history is client-owned state, but app-server thread lifecycle responses derived its metadata from the active server configuration. When server and local settings differ, the TUI can advertise metadata for the wrong history log.

## What changed

- Pass `LocalSettings` through thread start, resume, and fork response handling.
- Build message-history metadata from the local Codex home and history preferences while continuing to use the thread configuration for server-owned session fields.

## Testing

- Cover local history metadata across embedded and remote start, resume, and fork flows with deliberately different server settings.
- Verify single-entry and batched history lookups return entries from the local prompt history.

GitOrigin-RevId: 8b47230a4e9f2d342b8d79fd575d474c9062b05e
2026-09-04 15:58:02 +00:00
Felipe Coury
a1294e57f1 Improve automatic thread naming in the TUI (#42749)
## Why

Automatic title generation used a provisional thread name and only applied the
generated result while its thread remained active. Switching threads could
therefore leave the originating thread without its generated name.

## What changed

- Track title-generation requests by thread so results are persisted for the
  originating thread, while preserving any name set before generation finishes.
- Show a `renaming...` spinner instead of a provisional name, including across
  thread switches and failure paths.
- Add `thread-name` items to the status line and terminal title, and include the
  generated thread name in both default layouts.

## Testing

- Cover automatic naming, manual-name precedence, thread switching, failed
  requests, deduplication, and status-surface rendering and animation.

GitOrigin-RevId: a03ae4849bedec9f62f256fadad72c1685ce46e0
2026-09-04 12:20:57 +00:00
jif
9d253c885c Make the TUI symlink startup test Bazel-compatible (#42741)
## Why

The macOS startup symlink test applies its own Seatbelt policy, which cannot
run inside Bazel's sandbox.

## What changed

- Tag the TUI Bazel tests with `no-sandbox` so the startup test can install
  its policy.
- Verify that the mocked write tool reports a successful exit before checking
  the file written through the symlink.

GitOrigin-RevId: c12eb00f995985fccc053765399fbb0eb7ce70d9
2026-09-04 11:43:37 +00:00
jif
d13aeb77ea Allow trusted symlinks beneath CODEX_HOME on macOS (#42716)
## What changed

- Add the macOS-only `allow_symlinked_codex_home` user setting. When enabled in the execution host's `$CODEX_HOME/config.toml`, writable roots at or beneath that home may traverse symlinks.
- Keep the exception disabled by default and prevent project config, command-line overrides, and ignored user config from enabling it. Other writable roots remain subject to symlink checks.
- Propagate the resolved setting through local, interactive, and exec-server sandbox paths, including `CODEX_HOME` aliases.
- Explain the opt-out in symlink rejection errors, including that it trusts targets outside `CODEX_HOME` and targets that change between commands.

## Testing

- Add macOS coverage for shell commands, patches, filesystem helpers, process execution, and interactive startup with enabled, disabled, aliased, and out-of-scope homes.

GitOrigin-RevId: 99fcdf611200c9e1b7713cf06f7fdea5bfa7f089
2026-09-04 10:12:03 +00:00
Benjamin Carlsson
8e6a44b428 Fix the worktrees experimental feature test fixture (#42682)
## What changed

Construct the worktrees entry in `experimental_features_popup_snapshot` with
its string feature key and mark it writable, matching the current
`ExperimentalFeatureItem` fields.

GitOrigin-RevId: c12cd3d472504777e77d21a13a276e1d2381e85f
2026-09-04 06:14:15 +00:00
Eric Traut
048a936a23 Persist server-advertised experimental features from the TUI (#42674)
## What changed

- Save writable `/experimental` selections through `config/batchWrite`, including features that are not known to the local client.
- Refresh configured values after writes and surface timeouts, failures, and higher-priority overrides without changing the active task's settings.
- Serialize saves and discovery, let accepted writes finish after the popup closes, and retain uncertain selections for explicit retry.

## Testing

- Cover new server feature keys, server defaults, overrides, write and readback failures, timeouts, selected config profiles, and popup retry behavior.

GitOrigin-RevId: acee4e10cbb8c2fce9211e8fadd3cd67fa0eb1a5
2026-09-04 04:55:40 +00:00
Eric Traut
b995d06050 Preserve TUI sessions while starting replacement threads (#42671)
## Why

Starting a replacement thread can fail while reading configuration or calling
`thread/start`. The active thread and any composed input should remain available
when that happens. Remote app servers also need new threads to use their own
effective defaults instead of stale client-side model settings.

## What changed

- Read effective server configuration before starting a replacement thread,
  while preserving explicit model and reasoning-effort launch settings.
- Keep the current thread, configuration, subscriptions, and composer input
  intact until `thread/start` succeeds.
- Fall back to local defaults when an older server does not support
  `config/read`.

## Testing

Added coverage for server and managed defaults, explicit launch overrides,
remote working directories, older servers, and failures during configuration
reads or thread startup.

GitOrigin-RevId: 507a918ea2bf79c9f0adbb189bc611ecf57b757a
2026-09-04 04:45:44 +00:00
Eric Traut
ff2f01b0c2 Tailor TUI cyber refusal notices to Daybreak eligibility (#42667)
## What changed

- Prefetch ChatGPT account eligibility in the background and cache it across TUI widget replacements.
- Show an application link when Daybreak is available but not enabled, an Astra-specific explanation for unsupported models, and neutral copy when access is already present or eligibility cannot be determined.
- Refresh eligibility after account changes and reconnects without changing the selected model or delaying refusal handling.

## Testing

- Cover eligibility responses, account changes, model-specific notices, fallback behavior, and rendered notice snapshots.

GitOrigin-RevId: 7ae8613a946cb46b8f0b46bf47e5e15ae258ed86
2026-09-04 03:30:21 +00:00
Adam Perry @ OpenAI
a7ab2d66d7 Use a generic fallback model name in status tests (#42657)
GitOrigin-RevId: d6566e2b5f427aeb198bfd326886c0977b545590
2026-09-04 02:24:54 +00:00
Benjamin Carlsson
eb5a00b068 Add managed worktrees to codex exec (#42652)
## What changed

- Add the experimental `worktrees` feature and a shared `--worktree` flag for new and forked `codex exec` sessions.
- Create each enabled session in a managed Git worktree, use that checkout as the session working directory, and bind the checkout to the new thread.
- Share the configured worktree pool with Desktop while leaving automatic cleanup disabled for CLI allocations.
- Reject unsupported commands, remote execution, ignored user configuration, ephemeral sessions, and use without the feature enabled before allocating a worktree.

## Testing

- Cover flag placement and inheritance, supported and rejected command combinations, worktree allocation and thread ownership, configuration gating, and compatibility with existing worktree-backed sessions.

GitOrigin-RevId: 011ff4639b09e8992c50d7b823df23e71798670e
2026-09-04 01:56:38 +00:00
Ian MacLeod
f46671b14a Render assistant file citations as local links (#42650)
## What changed

- Convert `codex-file-citation` directives in assistant Markdown into local-file links while preserving paths with Markdown-significant characters, Unicode, Windows separators, and location suffixes.
- Apply citation rendering consistently to streaming output, finalized messages and plans, and resume-picker transcript previews.
- Keep directives literal in code, HTML, existing links, reference definitions, escaped text, and generic Markdown rendering.
- Bound repeated parsing work for malformed directive candidates without limiting valid citations.

## Testing

- Add coverage for citation parsing and rendering across finalized, streaming, and resume-preview output, including malformed input and path edge cases.

GitOrigin-RevId: 5a0bfb3fc7ac21b7e8846fd170a349fb2d2d5e85
2026-09-04 01:46:55 +00:00
Felipe Coury
956aa3f637 Restore the inline TUI after full-screen overlays (#42641)
## Why

Leaving an alternate-screen overlay in inline mode could retain stale overlay
cells and leave conversation history scrolled out of view.

## What changed

- Invalidate the restored inline viewport after leaving the alternate screen so
  the next draw repaints it against the main screen.
- Reflow transcript history once when a full-height inline viewport returns to
  the shorter chat layout, including transitions not tracked by the agents
  overview.

## Testing

Added regression coverage for repainting the restored composer and rebuilding
history exactly once after a full-screen overlay closes.

GitOrigin-RevId: c6d63299fd95731603d8b1d7f04afcd4b92c1681
2026-09-04 00:39:56 +00:00
Ian MacLeod
0305dde920 Harden TUI parsing of assistant markup (#42640)
## What changed

- Add a shared parser for assistant directives that handles quoted and unquoted attributes, embedded braces, escaped quotes, and malformed input consistently.
- Use the parser for Git action receipts and code comments, including Git actions that follow a rendered code comment on the same line.
- Parse `file://` links with `PathUri` so Windows drive and UNC paths render correctly regardless of the TUI host while preserving line and column anchors.

## Testing

- Add unit coverage for directive grammar and snapshot coverage for code comments, Git actions, and foreign Windows file links.

GitOrigin-RevId: 8252b3254b92ec6943096026e74c19160c4e24cc
2026-09-04 00:31:51 +00:00
Eric Traut
68e9c4a31a Warn when saved model defaults are overridden (#42639)
## Why

A model-default config write can succeed even when a higher-priority configuration layer overrides the saved value, leaving the TUI's success message misleading.

## What changed

- Show a warning when saved model, reasoning-effort, or service-tier defaults are overridden.
- Preserve the active conversation's explicit selection while reporting the saved default's effective status.

## Testing

- Cover successful, overridden, and rejected writes against the app server's target config profile.

GitOrigin-RevId: 6720d66a58629447b71cd9363c9e08c1c5b9edc1
2026-09-04 00:23:45 +00:00
Celia Chen
1f7b99922a Add GPT-6-Astra to Amazon Bedrock catalogs (#42619)
## What changed

- Add `openai.gpt-6-astra` to the Amazon Bedrock model catalog.
- Include its global and US cross-region variants in the Bedrock Runtime catalog.
- Preserve the bundled model metadata while applying Bedrock-specific capabilities and identifiers.

## Testing

- Cover catalog ordering, metadata, context-window overrides, and runtime routing variants.
- Add TUI snapshots for the Bedrock model and reasoning pickers.

GitOrigin-RevId: 25895174f00b85a738da5bb94ade82feaacb474c
2026-09-03 21:21:09 +00:00
Ian MacLeod
32c303c197 Condense TUI startup warnings (#42609)
## What changed

- Coalesce configuration, skill, sandbox, and MCP startup diagnostics into a single summary below the session header, including MCP and sign-in counts.
- Keep the complete warning text in the transcript and update the summary's transcript shortcut when key bindings change.
- Continue rendering warnings that arrive after work begins as inline history entries.
- Hide the MCP startup status row before a turn while preserving the configured interrupt shortcut.

## Testing

- Add coverage for warning ordering and deduplication, transcript details, MCP sign-in counts, resumed sessions, runtime warnings, reflow, backtracking, and interruption without a visible status row.

GitOrigin-RevId: 009657cf04f1d3a52270cf096eebf9db7513c040
2026-09-03 20:25:59 +00:00
rhan-oai
ed391d4dd2 Add GPT-6-Astra to the bundled model catalog (#42607)
## What changed

- Add the hidden `gpt-6-astra` model definition, including its reasoning levels,
  tool capabilities, context limits, agent instructions, and review policies.
- Reorder existing model priorities around the new catalog entry and provide the
  browser-use policy to the bundled auto-review model.
- Keep TUI snapshots pinned to `gpt-5.6-sol` and make Guardian coverage read the
  policy from the model selected by each test case.
- Allow the expanded `models.json` through the repository blob-size check.

GitOrigin-RevId: 039b224b91ca35c8d894cf6d23568bc6dc18ceeb
2026-09-03 20:05:58 +00:00
victor-openai
8f31b64c7f Report MCP tool discovery errors in server status (#42598)
## Why

An empty tool map does not distinguish a successfully returned empty catalog from a server whose startup or tool discovery failed.

## What changed

- Add nullable `toolsError` to each `mcpServerStatus/list` entry when no catalog is available because startup or tool discovery failed.
- Keep `toolsError` null for returned catalogs, including cached and empty catalogs, and continue returning healthy servers when another server fails.
- Update the protocol schemas and generated TypeScript type.

## Testing

- Extend the app-server status integration test with a broken MCP server and verify its error without losing the healthy server's inventory.

GitOrigin-RevId: 30b4ca4d9a45cec6998f5f626d3fddbee90a525d
2026-09-03 18:36:58 +00:00
Benjamin Carlsson
1d6727c0b5 Recover Vim escape input in legacy terminals (#42584)
## Why

Legacy terminals encode `Alt` plus a character the same way as `Esc` followed
by that character. In Vim insert or replace mode, typing a command immediately
after `Esc` could therefore leave the composer in the wrong mode.

## What changed

Recover ambiguous input as separate `Esc` and character events when Vim mode
can consume the escape. Preserve active `Alt` bindings, key chords, image
paste, agent navigation, enhanced-key terminals, and AltGr input.

## Testing

Add coverage for recovered Vim commands and for each shortcut and terminal
case that must retain its existing behavior.

GitOrigin-RevId: 3d8464d805f95f677cce5c46ae00338e611d776a
2026-09-03 17:28:48 +00:00
iceweasel-oai
7a7c188682 Preserve target-native paths in command approvals (#42577)
## What changed

- Pass the selected executor's `PathUri` through user command approval requests instead of converting the working directory to a host-native path.
- Make native-path permission helpers explicitly local and require executor-aware permission transforms to receive a `FileSystemSandboxPolicyContext`.
- Cover approved remote commands to verify that the approval request reports the selected remote working directory and execution resumes after approval.

GitOrigin-RevId: 0aa3042f2d7594af6c7d0abf31d7f99cf67d5556
2026-09-03 16:21:10 +00:00
Can Sar
728cb12fe5 Expose thread originators through the app-server API (#42458)
## What changed

- Add the creation-time `originator` to app-server thread responses and `thread/started` notifications.
- Persist originators in thread metadata and preserve the first recorded value across list, read, resume, rollout, and SQLite paths.
- Add an `originators` allowlist to `thread/list` for hosted backends. The local app-server accepts omitted or empty values but rejects nonempty filters.

## Testing

- Cover originator persistence across server restarts and list, read, and resume requests.
- Verify local `thread/list` handling for nonempty, omitted, null, and empty originator filters.
- Heap-allocate large TUI dispatcher futures in affected tests to keep them within the Windows test-thread stack.

GitOrigin-RevId: 73ad6e61b8fdd2d93a22d1f971723a19ec7be3fc
2026-09-03 06:02:25 +00:00
Eric Traut
8ff74cc9b1 Show live task details in the agent command center (#42455)
## What changed

- Add bounded detail previews for the selected task, including pending approval or user-input requests, live reasoning headings, and the latest agent message.
- Prefer the most urgent child task with useful detail while keeping the task list compact.
- Populate historical last messages from existing thread reads and update live details from already-delivered events without attaching to additional threads.
- Clear stale previews after reverts, event-stream gaps, reconnects, and thread lifecycle changes.

## Testing

- Add coverage and snapshots for attention requests, live activity, historical messages, stale refreshes, and attachment changes.

GitOrigin-RevId: 5de4b8aa3bc5bf9653a40c44b827f7aa85c8cf89
2026-09-03 05:33:57 +00:00
Eric Traut
c9fecd3fa0 Discover permission profiles from the app server (#42453)
## Why

The permissions menu needs to reflect the profiles and configuration requirements available in the active app-server scope, including remote workspaces.

## What changed

- Load permission profiles and configuration requirements asynchronously when opening the permissions menu, using the active thread working directory.
- Render loading, retry, empty-catalog, and unsupported-server states, and fall back to the legacy permissions menu when explicit profiles are not configured.
- Disable profiles rejected by server requirements or unavailable in the catalog. Remote custom profiles remain visible but cannot yet be selected.
- Bound pagination and request time, reject malformed catalogs, and ignore responses made stale by account, thread, or modal changes.

## Testing

- Cover local, session-only, remote, legacy, empty, unsupported, pagination, malformed-response, and timeout discovery paths.
- Add TUI tests for loading, failures, retries, empty results, remote catalogs, stale responses, and working-directory changes.

GitOrigin-RevId: 3e2ab53a4eae1179587d064f9a4c605765ea7880
2026-09-03 05:24:31 +00:00
Eric Traut
8b8ee28a9b Acknowledge pending TUI steers by submission ID (#42451)
## Why

Completion receipts for identical user messages could acknowledge the wrong
pending steer. When the receipt arrived while another thread was displayed,
the stale pending state could later be restored and resubmitted.

## What changed

- Assign each TUI submission a client message ID and pass it through turn start
  and steer requests.
- Preserve pending steer IDs across thread input snapshots and match completion
  receipts by ID, while retaining content-based matching for older app servers
  that do not echo IDs.
- Acknowledge matching receipts for inactive threads before their notifications
  can be discarded, including threads stored in the agents overview.

## Testing

Added coverage for identical steer receipts and for switching within and
between tasks before interrupting an active turn.

GitOrigin-RevId: 28bd80a735ff86cd7bf836f24b448e7499f0a902
2026-09-03 05:15:20 +00:00
Eric Traut
498d40b29f Box the TUI resume picker future (#42432)
GitOrigin-RevId: 1b53bc2d7a4015330fb39e29e9092b37153d9fa3
2026-09-03 03:25:26 +00:00
Eric Traut
62f553bfd0 Use the shared composer in the agent command center (#42428)
## What changed

- Replace the command center's single-line new-task input with the shared chat composer, including multiline editing, paste handling, Vim mode, configured keybindings, cursor behavior, and input validation.
- Keep task drafts and editor state across dashboard refreshes and reconnects while separating composer focus from list, search, and rename actions.
- Preserve whitespace in dispatched task prompts, block submission while offline, and restore unsent prompts after dispatch failures when the composer is still available.

## Testing

- Add coverage for focus routing, draft retention, multiline pastes, custom keybindings, Vim mode, offline editing, failed-dispatch recovery, and responsive rendering.

GitOrigin-RevId: a609ae95d497cbae0ebcac4cdcc50fe49d74832a
2026-09-03 03:16:24 +00:00
Eric Traut
cac96cd7b1 Discover TUI experimental features from the server (#42425)
## What changed

- Load the `/experimental` catalog from the running server for the active thread, with loading, empty, and failure states in the popup.
- Show beta features in server order and preserve server-reported names, descriptions, and configured values. Mark features as read-only when the local config writer cannot safely update them.
- Persist only changed, writable feature flags. Bound discovery with page-size and page-count limits, repeated-cursor detection, deduplication, cancellation, and a timeout.

## Testing

- Cover paginated discovery, malformed or unresponsive servers, popup cancellation, read-only controls, selective writes, and the new popup states.

GitOrigin-RevId: 1f49eb961c8ab220a466e15f032c1dc61ed86d38
2026-09-03 02:49:36 +00:00
Eric Traut
1d741742c5 Add session resume to the agent command center (#42419)
## What changed

- Add a configurable `agents.resume` action, bound to `Ctrl+O` by default, that opens the session resume picker from the agent command center.
- Preserve command-center state when the picker is cancelled, and preserve per-thread composer and queued-input state when switching sessions.
- Keep resume failures within the command-center flow and wrap footer shortcuts on narrow terminals.

## Testing

- Add coverage for picker cancellation, active-session selection, resume failures, per-thread input restoration, custom keybindings, and narrow footer layout.

GitOrigin-RevId: 59159f838a0c642200cd164e3af45b0971d29bf8
2026-09-03 02:18:43 +00:00
acrognale-oai
b27a6321fa Expose managed application network requirements (#42417)
## What changed

- Add `application.network` managed requirements with exact-domain allow/deny
  rules, default-enabled behavior, domain normalization, and normal managed TOML
  precedence.
- Return the policy separately from agent network requirements through the
  experimental `configRequirements/read` API. The endpoint reports the policy
  but does not enforce it.
- Export the new protocol types and schemas, and document the TOML format.

## Testing

- Cover parsing, validation, normalization, layered precedence, and cloud
  requirement composition.
- Verify app-server responses, defaults, separation from agent policy, and
  rejection of invalid domains.

GitOrigin-RevId: 563eeed296d9748430b819797204a44a8db92f3b
2026-09-03 02:09:10 +00:00
Eric Traut
fdf23b4097 Allow reviewing and continuing misalignment-paused chats (#42410)
## Why

Misalignment policy failures pause the current chat. When the server provides findings and a continuation request, users should be able to inspect them and explicitly decide whether to proceed.

## What changed

- Add a `Review findings` flow that shows the detailed explanation and quoted continuation request in an overlay.
- Require explicit acknowledgement before starting a continuation turn, while preserving the active approval and sandbox settings.
- Keep ordinary input blocked and reject stale, replaced, invalid, or duplicate continuation attempts.
- Label the overlay shortcut as `q close` to match its behavior.

## Testing

- Add TUI tests covering findings review, explicit confirmation, successful and failed continuation, stale findings, duplicate events, and invalid continuation data.

GitOrigin-RevId: 36a738adf272f95db92eaee5712fb00061d0fa52
2026-09-03 01:51:14 +00:00
Eric Traut
93053c7f5d Harden embedded composer input handling (#42408)
## What changed

- Keep `!`, `/`, and `?` prefixes literal in plain-text composers instead of activating command modes or shortcuts.
- Preserve buffered characters when changing Vim mode, cancelling a draft, or pressing Enter during a paste burst.
- Show over-limit errors in embedded composer footers, retain the rejected draft, and schedule redraws when the message expires.
- Clear stale validation errors when replacing a draft or switching form fields.

## Testing

- Add coverage for literal prefixes, buffered typing, single-character paste lines, retained over-limit drafts, and clearing validation errors between fields.

GitOrigin-RevId: ed9d5b2c087abdfefd92d93033ea1c20211d56d7
2026-09-03 01:46:37 +00:00
Eric Traut
b7f710273e Support the app-server daemon on Windows (#42405)
## Why

The managed app-server daemon and automatic TUI attachment were limited to
Unix, so Windows users could not share a background server across Codex
sessions.

## What changed

- Enable daemon lifecycle commands, `codex agents` startup, and AF_UNIX daemon
  discovery on Windows.
- Require Windows daemons to start non-elevated and verify the discovered
  socket directory and peer before connecting.
- Preflight detached process support, preserve path-based environment settings,
  and keep daemon processes out of the launching project's working directory.
- Fall back to an embedded server when an implicitly discovered daemon cannot
  connect, while preserving errors for explicit remote endpoints and bypassing
  daemon reuse when `CODEX_EXEC_SERVER_URL` is set.

## Testing

Add coverage for Windows launch restrictions and socket validation, implicit
connection fallback, executor selection, daemon discovery, and the agents
dashboard startup result.

GitOrigin-RevId: e7fd63cf8690bcca8b5155266416f31f2f792aa2
2026-09-03 01:26:35 +00:00
Eric Traut
d4dc882998 Discover TUI collaboration modes from the app server (#42401)
## What changed

- Fetch `collaborationMode/list` during TUI startup and reconnect, and use the
  returned catalog for visible collaboration-mode selection.
- Keep collaboration-mode discovery optional with a two-second timeout so an
  unavailable, invalid, or unsupported response does not block bootstrap.
- Preserve discovered modes when the model catalog refreshes, clear restored
  developer-instruction overrides when selecting a server mode, and retain a
  `/plan` draft when plan mode is unavailable.

## Testing

- Cover optional discovery failures and catalog refresh on reconnect.
- Cover server mode selection, model refreshes, restored settings, and
  unavailable plan mode.

GitOrigin-RevId: a6e35c14aab2e38526606164091ac64c500151bb
2026-09-03 00:45:48 +00:00
Eric Traut
54a4077c8b Preserve restored input after resolved misalignment errors (#42399)
## Why

Replaying a thread after a later turn has continued can treat an earlier
misalignment policy violation as still active, clearing the restored draft and
queued follow-up input.

## What changed

- Track the latest turn independently of the bounded replay buffer.
- Omit misalignment errors from older turns during snapshot and stored-turn
  replay while preserving an error on the latest turn.
- Keep interrupted tool calls from the older turn visible in history.

## Testing

Added buffered replay coverage for restored drafts and queued messages, buffer
eviction, current-turn violations, and interrupted tool rendering.

GitOrigin-RevId: d6c223d9c5a1905fe1b48dc5f9514a7ccbf61d92
2026-09-03 00:36:29 +00:00
Eric Traut
e6a944ad75 Extract focused TUI logic into submodules (#42397)
## What changed

- Move `AgentsOverviewView` rendering and cursor placement into
  `agents_overview_render.rs`.
- Extract paste-burst Enter handling from the main chat composer into the
  reconnect module while preserving the existing submission behavior.

GitOrigin-RevId: 641daf9ad6cba79d805a9ae100f63ef81470757d
2026-09-03 00:27:16 +00:00
Anton Panasenko
2b554fd3f9 Expose loaded thread environments in app-server responses (#42386)
## What changed

- Add the experimental `Thread.environments` field with each selected environment's ID, working directory, and runtime workspace roots.
- Populate the field from live thread state in start, resume, read, list, and unarchive responses. Use `null` for unloaded threads and an empty list when a loaded thread has no environment selection.
- Document that the field reports selection rather than connection status and does not affect executor selection or resume behavior.

## Testing

- Cover selection updates, unloaded and resumed threads, loaded pathless unarchives, and clients that subscribe after environment connection notifications.

GitOrigin-RevId: a6daa06aff7089d7c5a1e4c7d03109b41f12fa3c
2026-09-02 23:41:14 +00:00
pmccrary-oai
cff76fa96f Add experimental context management activation (#42385)
## What changed

- Add the under-development `features.context_management.experimental_mode` configuration and schema.
- For eligible ChatGPT Plus, Pro, and Pro Lite sessions using the Codex backend, enable token-budget context, history notes, and the `new_context` tool when experimental context management is configured.
- Keep the feature disabled for custom providers, provider credentials, non-Codex endpoints, and temporary structured threads.

## Testing

- Cover subscription eligibility, backend restrictions, configuration resolution, token-budget guidance, and temporary-thread overrides.

GitOrigin-RevId: 19402af19c4d69e09a7cdb3687ee7d233f6a562a
2026-09-02 23:37:39 +00:00
Eric Traut
0588fc941c Require confirmation for safety-buffered retries (#42380)
## What changed

- Show a confirmation before stopping a safety-buffered attempt and retrying
  with the server-selected faster model.
- Explain that the retry starts a new thread, preserves actions already taken,
  and may use a less capable model; allow the user to keep waiting instead.
- Dismiss the buffering or confirmation view when the response starts or the
  turn is no longer eligible for retry.
- Refresh the buffering copy and wrap confirmation text correctly in narrow
  terminals.

## Testing

- Cover retry confirmation, cancellation, turn completion, response startup,
  stale updates, and narrow-terminal rendering.

GitOrigin-RevId: 013bc47174811dd104b421774577c2808c732bfa
2026-09-02 22:49:48 +00:00
Owen Lin
69cebb5d15 Route rollout reads through the canonical JSON decoder (#42378)
## Why

Directly deserializing the flattened `RolloutLine` envelope can reject nested
decimal values, preventing affected paginated sessions from resuming.

## What changed

- Add canonical string, byte, and reverse-scanner helpers that decode rollout
  records through `serde_json::Value` before decoding the flattened item.
- Route rollout readers across session discovery, history, migration, search,
  thread storage, and transcript previews through those helpers.
- Remove `Deserialize` from `RolloutLine` so new readers cannot bypass the
  canonical persistence decoder.

## Testing

Add coverage that resumes a paginated rollout after a token-count record with
a decimal rate-limit value and verifies that ordinal sequencing continues.

GitOrigin-RevId: 49abac1e0751c073daa5a93a840d8a483fd2d013
2026-09-02 22:45:19 +00:00
dhruvgupta-oai
5037919777 Add Luna Reserve usage fallback to the TUI (#42372)
## Why

When ordinary included usage is exhausted, eligible users need a way to keep working with the backend-provided Luna Reserve quota and return to their previous model once ordinary usage recovers.

## What changed

- Automatically switch eligible TUI tasks to Luna Reserve after an authoritative account usage read, preserving the prior model and reasoning effort per task.
- Restrict model selection while on Reserve to its supported reasoning levels, keep queued turns on the accepted model, and restore the saved model after a fresh read confirms recovery.
- Surface Reserve usage in the composer and `/status`, and expose `normalModelSlug` in app-server rate-limit snapshots so clients can use the associated model's display metadata without changing the request model.
- Poll account limits more frequently near exhaustion and retain compatibility with app servers that only accept the legacy null request parameters.

## Testing

- Added coverage for Reserve entry, queued-turn handling, task reconstruction, recovery authorization, account changes, model selection, usage rendering, and banner dismissal.

GitOrigin-RevId: 46a435e9531051f8cec3f6a46c4b9f7cfa479747
2026-09-02 21:50:51 +00:00