Commit Graph
11143 Commits
Author SHA1 Message Date
andrewgu-oai cf6754e682 Remove the ultrafast service tier from gpt-5.6-sol (#47130)
## What changed

Remove `ultrafast` from the bundled `gpt-5.6-sol` model's `service_tiers`, leaving `priority` (Fast) as its only advertised service tier. Update scenario snapshots for the affected multi-agent tool definitions.

GitOrigin-RevId: 9a235d8f7ea8a72e71152708d2d602194256d420
2026-09-21 23:37:53 +00:00
Adam Perry @ OpenAI 69759baefd Preserve foreign working directories in extension tool environments (#47129)
## Why

Extension calls omitted environments whose working directories could not be converted to host-native paths, preventing extensions from receiving those environments.

## What changed

Store `ToolEnvironment.cwd` as `PathUri` and pass all turn environments to extension tools without requiring host-native path conversion. Keep image generation's existing path requirements by selecting the first environment with a convertible working directory when reading referenced images or saving generated images.

GitOrigin-RevId: b4320c6e07d27ef59885cd0013e5d1c535f69659
2026-09-21 23:27:42 +00:00
Won Park 26cb4d73e2 Add extra policy configuration for Guardian reviews (#47125)
## What changed

- Add `auto_review.extra_policy` and the managed `guardian_extra_policy` requirement to supply policy text alongside the resolved tenant policy. Nonblank managed values take precedence; blank values are ignored.
- Render the additional text through `{{ extra_policy }}` in Guardian reviewer templates and append it to the tenant policy for Guardian v2 classification before truncation.
- Preserve placeholder-like text inside supplied policies literally.

## Testing

Add coverage for configuration precedence, blank values, template substitution, and classifier prompts, plus a scenario verifying that managed tenant and extra policies reach the Guardian reviewer together.

GitOrigin-RevId: 180d8d716c63fe96a92ec5bfbd22db4ddccd4f1f
2026-09-21 23:06:36 +00:00
Andrew Wilkes 171dd0d39c Increase OpenAI file blob upload timeout from 60 seconds to 5 minutes (#47122)
GitOrigin-RevId: 11069394b3cfe24af4d5efb709ee4f65b88c90de
2026-09-21 23:00:40 +00:00
Krish Chainani 4a8cfe6bb7 Pass thread IDs to attachment uploads (#47121)
## Why

Attachment stores need the receiving thread ID to support thread-based placement.

## What changed

Add `thread_id` to `UploadRequest` and pass the session's thread ID through image preparation for messages and tool outputs. Include the ID in debug output while continuing to redact attachment bytes.

## Testing

Extend the image rollout test to assert that a new image uploaded after resume carries the resumed session's thread ID. Update the debug-output test for the new field.

GitOrigin-RevId: f81e3bd761dca704064287177b8ecd7175662f07
2026-09-21 22:58:49 +00:00
rhan-oai 5aa4939be4 Support model-catalog overrides for Code Mode tool messages (#47118)
## What changed

- Add `tools.code_mode` catalog messages for `exec`, `wait`, deferred-tool guidance, and shared MCP TypeScript definitions.
- Render `{{ default_exec_yield_time_ms }}` and `{{ image_helper }}` in `exec` descriptions while preserving runtime tool declarations and the freeform grammar.
- Resolve `wait` descriptions and parameter schemas independently, falling back to bundled parameters for invalid or unsupported schemas.
- Use the active model's Code Mode messages, including after mid-turn model changes. Missing overrides retain bundled defaults; empty text overrides suppress the corresponding text.

## Testing

Add coverage for literal template substitution, runtime section preservation, independent `wait` overrides and fallback behavior, mid-turn model changes, and a yielded cell completing through `wait` with catalog messages.

GitOrigin-RevId: e542a0cd47a7138a414871192cee47790ed1214e
2026-09-21 22:49:17 +00:00
Jesse Du 3fd5160cd6 Honor the configured product SKU in remote plugin requests (#47116)
## Why

Remote plugin requests always sent `OAI-Product-Sku: codex`, ignoring the existing `apps_mcp_product_sku` setting.

## What changed

Pass `apps_mcp_product_sku` through plugin configuration and use it for authenticated remote plugin requests, including discovery, search, installation, and sharing. Keep `codex` as the default and include the SKU when comparing remote service configurations.

## Testing

Extend app-server plugin listing and core agent-turn tests to check default and configured SKU headers. Update the CLI worktree test to wait for the user prompt's model request, skipping background title generation requests.

GitOrigin-RevId: 508c9ef9aa3e41b87c92383c3088eb1eb9227fd8
2026-09-21 22:30:43 +00:00
chiam-oai 772abc9425 Preserve and expose thread item lifecycle timestamps (#47114)
## What changed

- Persist producer-recorded item start and completion times in thread history, preserving existing non-null values on updates.
- Return nullable `startedAtMs` and `completedAtMs` Unix millisecond timestamps from `thread/items/list`, and update the generated schemas and TypeScript and Python types.
- Leave timestamps unknown for existing rows and older writers.

## Testing

Add coverage for exact timestamp persistence, protocol round trips with present and missing timestamps, paginated item responses, and compatibility with older database writers.

GitOrigin-RevId: 894853481085782ff54db1704799e41446d15e51
2026-09-21 22:23:26 +00:00
Jeremy Rose 23ae65bb06 Persist thread creator identity in rollouts and SQLite (#47113)
## What changed

- Capture optional `creator_user_id` and `creator_account_id` from authentication when creating a thread, including forks.
- Carry these fields through thread storage, rollout metadata, and a SQLite migration. Leave them absent when unavailable or when reading older threads.
- Preserve recorded creator values across resume and metadata updates. On revert, recover missing rollout values from SQLite before writing replacement metadata.

## Testing

Add coverage for ChatGPT and API-key sessions, resume under another account, forks using current authentication, metadata extraction and upserts, and repeated reverts after creator fields are removed from a rollout.

GitOrigin-RevId: 9839fa42f9392f12226002e2c27d05d5656f5695
2026-09-21 21:22:01 +00:00
Felipe Coury bf91058b81 Lowercase the retry hint for conversations open in another app (#47112)
Change `R to Retry` to `r to retry` in the TUI notice and update the
corresponding rendering snapshots.

GitOrigin-RevId: f7971ba0f76ac446a5fea53b44390f65aa965be4
2026-09-21 21:10:30 +00:00
iceweasel-oai 023d81b057 Preserve required Windows runtime variables for filesystem helpers (#47108)
## Why

On Windows, MXC needs `SystemDrive` to resolve platform directories and
`LOCALAPPDATA` to create the sandboxed helper process. The helper environment
filter previously dropped both variables.

## What changed

Allow `SystemDrive` and `LOCALAPPDATA` alongside `PATH` in the Windows helper
environment, using case-insensitive name matching.

## Testing

Extend the Windows environment-filtering test to verify that mixed-case runtime
variable names are preserved while `PATH_INJECTION` and `OPENAI_API_KEY` remain
excluded.

GitOrigin-RevId: bab242dd59da59ac6e7f428436e1c139aadadfdd
2026-09-21 20:42:25 +00:00
Eddie Chen 6a601c00da Preserve originating turn metadata for yielded skill calls (#47106)
## Why

Code Mode callbacks can retain skill tools after another turn becomes active. Looking up the active turn when a delayed skill invocation completes can lose access to the originating turn's metrics and metadata.

## What changed

- Capture and retain the originating `SkillTurnMetrics` when constructing skill analytics.
- Expose turn analytics metadata through the turn extension store and carry it into skill telemetry.
- Add optional turn metadata to `TrackEventsContext` and pass it from app, skill, and plugin usage call sites.

## Testing

Add a regression test that yields a Code Mode cell, starts another turn, and releases both skill reads through a shared barrier. Assert that each `skill_invocation` event retains its originating `turn_id`.

GitOrigin-RevId: aa629dd5f84563d558aa6a86bfbdfc356f1b98e4
2026-09-21 20:34:46 +00:00
Celia Chen 142360dac8 Honor configured proxies for realtime WebSocket connections (#47101)
## Why

Realtime WebSockets connected directly, bypassing the configured proxy policy for Voice's WebRTC sideband.

## What changed

Pass the configured `HttpClientFactory` into `RealtimeWebsocketClient` and connect through the shared `WebSocketConnector`. Add support for supplying an existing Rustls configuration to preserve custom CA handling and Windows platform trust.

## Testing

Add an integration test that enables `respect_system_proxy`, starts a WebRTC conversation, and verifies that the sideband establishes its session through an HTTP `CONNECT` proxy and closes successfully.

GitOrigin-RevId: d974c9275d7fe29f388d56a9d5d8ce0c483eb8d0
2026-09-21 20:05:21 +00:00
Eric Traut 8e7f50cba9 Preserve assistant answers in bounded TUI task responses (#47100)
## Why

The 999-byte response budget and blanket string truncation could discard assistant answers alongside supporting history. Thread lists could also lose entries when shortened to fit the budget.

## What changed

- Raise the response budget to 8,000 bytes and remove the separate 2,000-character cap on assistant messages in `read_thread` and `wait_threads`.
- Compact oversized read responses around each turn's latest assistant message, and retain every wait target and returned list entry with pagination cursors intact.
- Shorten only content fields when further reduction is needed, preserving valid JSON and protocol values such as IDs, cursors, phases, and statuses. Mark compacted responses and shortened content with `truncated`.
- Request archived thread pages at the requested limit without retrying with smaller pages to meet the response budget.

## Testing

Add regression coverage for oversized wait responses with Unicode and escaped text, list entry and cursor preservation, and an oversized read whose assistant answer survives into the next model request. Extend read and wait tests to verify assistant messages longer than 2,000 characters are retained when they fit.

GitOrigin-RevId: 459fa522d02fbe4cd877b9afe8e66c9358b7bbce
2026-09-21 19:55:40 +00:00
Felipe Coury e8cd975a55 Keep TUI hints immediately above the composer (#47096)
## Why

Activity indicators and queued input previews could separate usage notices and
reading controls from the composer.

## What changed

- Reserve the shared hint row below activity and previews in the owned transcript
  layout, and use its rendered position for hints and reading controls.
- Clip spacing and hints before activity and previews when vertical space is tight.
- Fit usage notice details within half the row, allowing the shortest complete
  warning to use more space on narrow terminals.

## Testing

Expand regression tests and snapshots for running turns, queued inputs, multiline
drafts, short terminals, follow-control clicks, and hidden actionable banners.
Cover five-hour and weekly usage notice width thresholds.

GitOrigin-RevId: e73b3614839ce35c5b0a009901514627a77d4190
2026-09-21 19:40:21 +00:00
andrewgu-oai 9c77996cd1 Remove the rust-release-prepare workflow (#47095)
Delete the workflow that refreshed `codex-rs/models-manager/models.json`
and opened update pull requests every four hours or on manual dispatch.

GitOrigin-RevId: 0179d8af57b17fd69e9b7e94b7f7ed7b0c6dcc24
2026-09-21 19:38:11 +00:00
Yuzhu Shen afe4249cfe Restrict Unix local MCP servers to stdio descriptors (#47094)
## Why

Local MCP servers communicate over stdio, so unrelated parent file descriptors should not propagate into the server or its descendants.

## What changed

Apply `DescriptorPolicy::StdioOnly` when launching local stdio MCP servers on Unix, preserving their explicit transport stdio.

## Testing

Add Unix integration tests that check inheritable pipe, socket, and file descriptors are absent from servers and descendants across absolute, relative, and shell-fallback launches. Verify MCP communication, arguments, environment, working directory, parent descriptor ownership, and exec failure reporting remain intact.

GitOrigin-RevId: 37409a5673dbaafa851fd1f78e3a2443eda5f7c6
2026-09-21 19:37:46 +00:00
Ahmed Ibrahim b4b30dd5eb Centralize JSON-RPC response serialization through payloads (#47089)
## What changed

Serialize `ClientResponse` JSON-RPC results through the untagged
`ClientResponsePayload` enum, and serialize payloads directly instead of matching
on each variant. Preserve existing result shapes and request IDs.

## Testing

Add regression tests covering v1 and v2 payloads with integer and string request
IDs, legacy interrupt responses, and serialization errors from non-UTF-8 paths
on Unix across typed, borrowed, and owned response conversions.

GitOrigin-RevId: d46403b02f910a0d3e41a48a5bc6faa2581873e1
2026-09-21 18:59:23 +00:00
Ahmed Ibrahim 09bb3d6942 Disable unused default dependency features (#47088)
## What changed

- Disable default features for `sentry`.
- Disable default features for `syntect`, explicitly enable `parsing`, `plist-load`, and `regex-onig`, and switch `two-face` to `syntect-onig` in `codex-rs/tui`.
- Remove the resulting unused dependencies from the Cargo and Bazel lockfiles, including Actix, Sentry integrations, `ureq`, and `yaml-rust`.

GitOrigin-RevId: b3ca6610fdc60ab99909660f56099fbb4093b9c5
2026-09-21 18:58:55 +00:00
Felipe Coury c37b7307db Format analytics credit usage with consistent decimal precision (#47086)
## Why

Chat analytics displayed raw credit strings, exposing values such as `0E-10` for plan-covered tasks and unnecessary trailing decimal zeros.

## What changed

Format ordinary credit amounts with two decimal places and thousands separators. Round directly from decimal digits to avoid floating-point rounding errors, so `1.005` becomes `1.01`. Normalize zero to `0.00`, while preserving the original strings for nonzero sub-cent amounts and values outside the safe conversion range.

## Testing

Add assertions for decimal and scientific notation, signed zero, rounding boundaries, tiny adjustments, and large values. Update the chat analytics snapshot to cover a plan-covered task showing `0.00` credits.

GitOrigin-RevId: f946cb408c2c37291447f90de02ebbb557fbc662
2026-09-21 18:38:18 +00:00
andrewgu-oai deb0a08f24 Update model catalog descriptions and GPT-5.6-Sol priority (#47085)
## What changed

- Describe GPT-5.6-Sol as a reliable agentic workhorse for everyday tasks and change its catalog `priority` from `6` to `4`.
- Describe GPT-5.5 as a proven previous-generation model for coding and general work.
- Refresh model picker, migration prompt, and agent tool snapshots to reflect the catalog updates.

GitOrigin-RevId: b39f51c22862b8cef585ed76f3973c9f4b670c27
2026-09-21 18:36:13 +00:00
Ahmed Ibrahim 3627bb91b2 Avoid building a host SQLite driver for SQLx macros (#47084)
## Why

Row derives and migration embedding do not need query macros or a host SQLite driver.

## What changed

- Remove the `macros` feature from `sqlx` and depend directly on `sqlx-macros` with only `derive` and `migrate` enabled.
- Update state and thread-store derives and migration embedding to use `sqlx_macros`.
- Enable `sqlx-sqlite`'s `offline` feature directly to preserve query-description support in the target driver.
- Pin `sqlx`, `sqlx-macros`, and `sqlx-sqlite` to `=0.9.0` to keep their versions aligned.

GitOrigin-RevId: 8a8ef691ff2862a7dad978a578c5206b52dfc0b6
2026-09-21 18:30:31 +00:00
Ahmed Ibrahim 429afbcaa9 Extract per-thread enrichment into a dedicated async helper (#47083)
Move status resolution, live settings, and subagent input eligibility into
`enrich_loaded_thread`. Keep `enrich_loaded_threads` responsible for fetching
watched statuses and enriching threads concurrently with `join_all`, preserving
existing behavior.

GitOrigin-RevId: 54f7b61b7cc6dcdfb4a63c1906080858b18df378
2026-09-21 18:27:29 +00:00
Eric Traut 2fe4a2b4d8 Show the voice toggle in the TUI shortcut overlay (#47082)
## What changed

Add a Voice entry using the configured `toggle_voice` binding (`F8` by default). Show it only when voice commands are enabled and no side conversation is active.

## Testing

Update footer and shortcut overlay snapshots to include the Voice entry.

GitOrigin-RevId: ba92f5af1ce1a06d9700d31dcc90e5acb1613803
2026-09-21 18:19:34 +00:00
peilin-openai ac98537678 Track cumulative MCP attribution across requests and thread history (#47081)
## What changed

- Record each MCP source and its first turn, including connector and plugin identifiers when available. Cover direct and Code Mode calls, including returned errors and results that are not printed.
- Persist cumulative attribution checkpoints and restore them across compaction, resume, and forks, including forks limited to recent turns.
- Attach fresh attribution to Responses API `client_metadata` under `mcp_attribution`, outside model-visible content. Restrict transmission to allowed OpenAI HTTPS destinations for both HTTP and WebSocket requests.
- Report `attribution_error` for legacy history without checkpoints, malformed or conflicting attribution, and serialized attribution exceeding 16 KiB.

## Testing

Add coverage for source deduplication, checkpoint persistence and restoration, recent-turn forks, direct and Code Mode calls, destination filtering, and the serialized size limit.

GitOrigin-RevId: fd285e152ca9e24bfa000debb20013709d67a86e
2026-09-21 18:19:07 +00:00
Nick Steele 7cec3e110c Mask daemon socket paths exposed through ancestor bind mounts (#47079)
## Why

The Linux sandbox rejected bind mounts of ancestors of the app-server socket directory, even when the exposed socket paths could be masked. This prevented sandbox startup with otherwise usable temporary-directory mount layouts.

## What changed

- Collect the socket directory and its exposed ancestor-mount aliases, then mask each path after filesystem binds, including read-only subpaths and the synthetic-mount registry.
- Continue rejecting direct directory or socket aliases and nested mounts that cannot preserve socket isolation.
- Reject non-UTF-8 mask destinations to avoid masking a different path through lossy conversion.

## Testing

Extend mount-analysis tests for ancestor aliases, private temporary directories, and WSLg masks. Extend socket-isolation coverage to verify that ancestor and registry aliases hide daemon sockets while unrelated sockets remain reachable. Add a regression test for non-UTF-8 mask paths.

GitOrigin-RevId: 49a9a764fbe1fddacd99c3a78099fbffff53b944
2026-09-21 18:04:14 +00:00
sayan-oai 62ea6d41e8 Serialize environment updates and cancel removed pending attachments (#47077)
## Why

Concurrent credential refreshes could restore a removed environment by overwriting the selection list with stale state. Unpolled snapshot futures could also keep pending configuration alive after an environment was removed.

## What changed

- Protect environment selections with a mutex and update them in place to serialize selection changes, configuration refreshes, and connection listener setup.
- Capture only selection metadata and resolution futures in snapshots so they do not retain pending configuration senders.

## Testing

Add regression tests for removal during credential refresh and cancellation while an unpolled snapshot is held. Strengthen the pending attachment integration test to check that `wait_for_environment` returns the expected environment ID and `ready` status.

GitOrigin-RevId: c6f933e8d3031b05335ddcfed00ab400aa5bad2a
2026-09-21 17:53:03 +00:00
jif e51aacad60 Include attributed previews in agent message board notifications (#47075)
## Why

Message board notifications exposed only post and thread IDs, requiring a read to see any post content.

## What changed

Deliver notifications as `agent_message` items with author and recipient attribution. Include a `CHANNEL_POST` payload with the sender, channel, message and thread IDs, and up to 150 characters of post text. Direct agents to `read_post` when the preview is truncated, and retain recognition of legacy user-role notices.

## Testing

Update the model-context scenario to assert the notification's author, recipient, and preview payload, and update the idle-agent scenario to check for the new notification format.

GitOrigin-RevId: e0e2794be82e38bba47f41fb4fc8128eb5e47619
2026-09-21 17:29:13 +00:00
Anthony Tafoya f3037cafd3 Refresh host-supplied cloud skills at turn startup (#47074)
## What changed

- Replace the built-in orchestrator skill provider with a host-supplied cloud provider, using `cloud` authority and `c` root aliases in skill tools and prompts.
- Add `cloud.skills.enabled`, defaulting to true but requiring a supplied provider. Keep `orchestrator.skills` accepted as a legacy no-op setting, and remove the app server's automatic orchestrator provider registration.
- Discover cloud skills once per turn during cancellable startup. Serve catalog snapshots to prompts and tools without triggering discovery or retries.
- Scope cached catalogs and resources to authentication state. Preserve them on refresh failures within the same scope, invalidate them when that scope changes, and reject late discovery or read results from replaced cache generations.
- Reuse executor discovery catalogs only when successful discovery inputs and bundled-skill settings match.

## Testing

Add coverage for per-turn refresh, skill removal, same-account failures and reconnects, authentication changes, and stale in-flight results. Update configuration and tool tests for cloud authority, provider gating, and resource reads without an executor.

GitOrigin-RevId: c57e38ec7dcc880c0d4c8a2995adfd3e28301079
2026-09-21 17:28:14 +00:00
jif 20cdcb0156 Wait for thread idle in Guardian context budget tests (#47073)
## Why

`TurnComplete` precedes active-turn cleanup, so injecting follow-up history immediately afterward can race with cleanup.

## What changed

Register the `ThreadIdle` lifecycle contributor in `review_preserves_user_instructions_until_request_budgeting` and wait for the thread to become idle after the initial and follow-up turns.

GitOrigin-RevId: 1ae6c80593a71d331c5c6ddf85bbe10822a68afe
2026-09-21 17:25:25 +00:00
Eric Traut f07aaf920b Highlight selected newlines in the transcript view (#47068)
## Why

Transcript selections could include a newline without showing it in the highlight, making `code` and `code\n` look identical.

## What changed

Highlight one trailing cell for selected hard line breaks when space permits, including newline separators between transcript entries. Track logical line endings so soft wraps and synthetic rows do not receive newline highlights.

## Testing

Add selection snapshots for hard breaks within and between entries, plus layout coverage for empty lines, wrapping, trailing whitespace, and synthetic rows. Update the app selection test to assert the leading newline highlight.

GitOrigin-RevId: d6f332c472598a3f79557b7ebb41730c6acc7820
2026-09-21 16:42:35 +00:00
Eric Traut a4c8fc7a6b Deduplicate deprecation notices in the TUI transcript (#47065)
## Why

Global deprecation notices can be delivered again by hidden threads, creating duplicate transcript entries.

## What changed

Skip incoming deprecation notices whose summary and details match a notice already in retained history. Preserve notices with different summaries or details, and allow notices to appear again after clearing history or rebuilding the transcript during a thread switch.

## Testing

Add a regression test and transcript snapshot covering repeated live and replayed notifications, an open transcript overlay, distinct notice content, and delivery after clearing history or switching threads.

GitOrigin-RevId: 9c0512f588dfb54f7934380119211b57b0df0ee4
2026-09-21 16:36:01 +00:00
jif 51d221a9b7 Stop redundant message-board reads when limits reach one (#47064)
## Why

When result metadata exceeds the output budget, message-board tools keep retrying identical reads after all limits reach one.

## What changed

Stop shrinking reads once every page and character limit reaches one, returning the existing metadata-budget error if the result still does not fit. Use the largest effective limit to keep retrying while either the page size or preview length can still shrink.

## Testing

Add regression assertions for all five read tools with an impossible output budget, checking the error and exact read counts. Cover unequal page and preview limits and limits that are not powers of two.

GitOrigin-RevId: f00ddbcf0372c8f9318fa178259868caae55e68b
2026-09-21 16:17:31 +00:00
jif fe6455a438 Add a partial index for agent message board root posts (#47063)
Create `posts_roots_created` on `(board, channel, timestamp, seq)` for
posts where `id = root` in the local SQLite schema.

GitOrigin-RevId: 4c40e0d853deaa3ab6b6303525870e3b7bfc3b14
2026-09-21 16:16:40 +00:00
jif d583e73c4d Fetch local message board thread summaries in one query (#47055)
## Why

Listing threads issued two additional SQL queries per root to fetch its reply count and latest reply.

## What changed

Fetch roots, reply counts, and latest replies in a single query. Materialize the selected page before looking up reply summaries, preserving creation and activity ordering, pagination, and preview limits.

## Testing

Strengthen pagination assertions to check complete thread summaries for threads without replies, including Unicode preview truncation, reply counts, and last activity timestamps.

GitOrigin-RevId: cbbed36418a349a18daf0771f4ed27aa47de0bc1
2026-09-21 15:47:52 +00:00
jif 0e69d3bd9b Batch message-board subscriber reads into one SQLite result (#47050)
## Why

Posting to the local agent message board fetched each subscriber row across SQLite's worker thread while holding a write transaction.

## What changed

Use `json_group_array(agent)` to fetch subscribers as a single JSON array, then deserialize it before collecting notification recipients.

## Testing

Extend the local board test to verify that posting to a channel with no subscribers succeeds without sending notifications.

GitOrigin-RevId: ad294e19c78ee501f1de2084f7c02fa96f53418d
2026-09-21 15:27:08 +00:00
jif f484f7228d Share SQLite pools across local agent message-board handles (#47049)
## Why

Opening each local message-board handle created a separate SQLite pool for the same database.

## What changed

- Cache one shared pool per canonical database path within the process, using weak references so the last handle can release it.
- Serialize pool initialization with deletion and corruption recovery. Close and evict the cached pool before replacing a corrupt database, and block new handles until deletion tombstones are saved.

## Testing

Enable library unit tests and add coverage for concurrent handles sharing a pool, releasing it after the last handle drops, and creating a new pool on reopen.

GitOrigin-RevId: 4d4a5c9ea9f063733df85a2ac120d51099736520
2026-09-21 15:25:58 +00:00
jif 40eeb6e8a8 Recover corrupt message-board storage during thread deletion (#47042)
## Why

A corrupt agent message-board database can block thread deletion even when the feature is disabled.

## What changed

When corruption prevents opening the database for board deletion, back it up and recreate it before recording deletion tombstones. Recovery resets all boards, retaining their previous storage in the backup. Other database open failures continue to return an error without deleting the thread or replacing storage.

## Testing

Add an app-server regression test with the feature disabled that verifies ordinary open failures preserve storage and the thread, while corruption recovery preserves the backup, deletes the requested thread, retains another thread, and records the board tombstone in the recreated database.

GitOrigin-RevId: 85f7d6303ae5c359782018cad4a78461d86c43db
2026-09-21 14:31:50 +00:00
felixxia-oai 3483294596 Preserve delivered messages through post-tool hook failures (#47039)
## Why

Guardian can lose a confirmed User Messaging message from its parent context when a `PostToolUse` hook blocks the result or is cancelled. The message has already been sent and remains relevant to interpreting the user's authorization.

## What changed

Capture confirmed message text after input-rewriting hooks in shared per-call state before awaiting post-tool processing. Attach that evidence to the response metadata even when dispatch returns a blocked or aborted result, while keeping post-tool hooks cancellable. Calls cancelled before delivery confirmation contribute no message evidence.

## Testing

Extend Guardian subagent authorization coverage to verify retained messages after post-tool hook blocking and cancellation, and their absence when cancellation precedes delivery confirmation.

GitOrigin-RevId: 9abb7959980eada20d0fb5c0b3a4a8669e4cd0a3
2026-09-21 14:14:21 +00:00
Charlie Marsh 87bc50f9d4 Cache OS discovery for user agents and telemetry (#47038)
## Why

OS discovery can launch subprocesses on Linux. Repeating it for requests, analytics events, and metrics provider creation adds unnecessary work for stable metadata.

## What changed

Cache `os_info::get()` with a separate `LazyLock` in user-agent generation, analytics runtime metadata, and metrics OS resource attributes. Continue reading the user-agent originator and suffix on each call so updates remain effective.

## Testing

Add an isolated Linux regression test that races initial user-agent lookups and repeats calls, verifies `lsb_release` and `getconf` each run once, and checks that subsequent originator and suffix updates appear in the user agent.

GitOrigin-RevId: 337e45ff88b863d2a4aa387a8e7d2e291c045906
2026-09-21 14:04:41 +00:00
Charlie Marsh dd6eff3954 Share stored JSON payloads across code mode cells with Arc (#47036)
## Why

Creating a cell deep-copies every stored JSON value, including values the cell never loads. Storing a value also duplicates its payload between the cell's local state and pending writes.

## What changed

Use `Arc<JsonValue>` throughout the session store, cell runtime, and completion writes to share immutable payloads. Keep a separate map snapshot for each cell so later commits cannot change its view of stored values.

GitOrigin-RevId: 4535f0f2ed0c8f8cbfb8d24cf1cb44cbc74472b5
2026-09-21 13:57:22 +00:00
Charlie Marsh 3ead673946 Defer extension tool history materialization until first access (#47035)
## Why

Extension tool calls eagerly copied and converted conversation history even when the tool never read it.

## What changed

Retain a shared invocation-time snapshot and defer conversion to raw response items until `ConversationHistory::items()` is called. Cache the result across clones with `LazyLock`, and keep debug formatting from triggering materialization. Release unrelated history metadata when capturing the shared items.

## Testing

Extend the extension executor test to verify that history first read after a later turn still reflects the invocation-time snapshot, in both legacy and paginated history modes. Update the history API test to check that shared items preserve their envelopes.

GitOrigin-RevId: c737b765b7e4889735dc78e12d685d36e854570b
2026-09-21 13:56:17 +00:00
felixxia-oai f585f13a12 Preserve ordered assistant context in Guardian reviews (#47030)
## Why

Guardian's retained root context appended assistant messages after user evidence and omitted questions sent through User Messaging. This could leave subagent authorization reviews with missing or misplaced conversational context.

## What changed

- Record assistant messages and function calls in the same order sequence as accepted user inputs, then merge retained review context by recorded position while prioritizing user evidence within the message budget.
- Capture bounded User Messaging text after input hooks when a send succeeds, and match it to the original call for assistant context.
- Label assistant context without a recorded position explicitly and clear parent assistant and tool positions when forking agent history.
- Clarify that recorded order does not establish delivery order or pair ordinary replies with questions; assistant messages remain untrusted context.

## Testing

Add coverage for hook-rewritten messages, failed or unconfirmed sends, queued replies with delayed tool results, ordering across resume, and removal of inherited assistant positions from forked history.

GitOrigin-RevId: ac717cf0f5efe4b05c18f2d8370dd48453ac4e35
2026-09-21 13:30:55 +00:00
jif 73129716c2 Delete persisted message boards with their root threads (#47029)
## Why

Permanent thread deletion needs to remove persisted agent message board data even when the message board feature has been disabled.

## What changed

- Add a cleanup hook for single and batch thread deletion, invoked after reference and writer checks but before rollout removal so cleanup failures remain retryable.
- Remove the deleted roots' channels, posts, and subscriptions regardless of the current feature setting.
- Record board tombstones and check them within write transactions to prevent delayed writes from recreating deleted data.

## Testing

Add an app-server regression test that creates a board, archives its root thread, restarts with the feature disabled, and verifies that permanent deletion removes the persisted channels, posts, and subscriptions.

GitOrigin-RevId: 4ea71559a8df0814dffda23a056a9bbaf6e0a0cb
2026-09-21 13:28:02 +00:00
jif 8a62cc4dc1 Align message-board tools with the multi-agent namespace (#47028)
## Why

Message-board tools hardcoded the `collaboration` namespace and used a different namespace description from the multi-agent tools. This ignored custom namespace configuration and caused conflicts under strict tool collision checking.

## What changed

- Use `multi_agent_v2.tool_namespace` and the shared multi-agent namespace description for message-board tools, resolving the namespace at runtime startup.
- Support unnamespaced tool specifications when no namespace is supplied.
- Remove hardcoded `collaboration` prefixes from message-board notifications.

## Testing

Add app-server integration coverage for the default `collaboration` namespace and a configured `agents` namespace with strict collision checking enabled. Verify that both tool families are advertised together and that `get_channels` executes through the installed extension.

GitOrigin-RevId: fef7be51ea2a84bbdb6d3491606db442ed4e6ea3
2026-09-21 13:27:39 +00:00
jif 23a6b705ba Add diagnostics for rollout compression metadata failures (#47026)
## What changed

- Tag metadata scan failures with bounded reasons for invalid history modes, responses before metadata, missing metadata, or I/O errors.
- Emit at most five metadata warnings per compression run with the rollout ID, error category, file size, and modification age, excluding paths and error messages. Include the total metadata failure count in the completion log.
- Preserve underlying metadata errors while redacting their details from `MetadataReadError` debug output.

GitOrigin-RevId: 13f8ec265405b8f8bb23a02ee37c1aabdce806eb
2026-09-21 13:18:50 +00:00
jif 6149914a0e Wire agent message boards into persistent multi-agent runtimes (#47017)
## What changed

- Register the existing message-board tools with the app server through a lifecycle extension, gated on `agent_message_board`, multi-agent v2, and non-ephemeral sessions. The new feature flag is disabled by default.
- Bind tools to each agent's identity and share the SQLite-backed board across the agent tree and runtime resumes.
- Use the runtime clock for posts and deliver ID-only notifications to running agents, with tools to retrieve post contents. Skip inactive recipients without starting them or queuing notices.
- Emit a warning and leave board tools unavailable if initialization fails.

## Testing

Add runtime scenarios and a context snapshot covering feature gating without creating storage, posting and searching, active-only notifications, sharing with child agents, persistence across resume, and clock failure without channel creation.

GitOrigin-RevId: a81bd85cd372b0d122ba375ed1a1bfd3ba3a3b7c
2026-09-21 12:35:36 +00:00
jif 7d99ee82d7 Add agent inspection without restoring unloaded runtimes (#47010)
## Why

Agent inspection needs to distinguish registered but unloaded agents from missing identities and backend failures without restoring a runtime.

## What changed

- Add inspection returning `AgentInfo` with metadata, status, and configuration for loaded agents, or metadata for unloaded agents.
- Use inspection for configuration snapshots and to capture an agent's state before interruption.
- Add `AgentInfo` accessors and share V2 error mapping between interruption and messaging tools, preserving the distinction between invalid requests and a dropped thread manager.

## Testing

Extend the V2 reload test helper to assert that inspecting a registered, unloaded agent returns `AgentInfo::Unloaded` and leaves its runtime unloaded.

GitOrigin-RevId: fa897264ff3ff3ec6cc76259d8482be55dec0c0a
2026-09-21 11:50:27 +00:00
felixxia-oai ebc05da3bd Decouple tool restrictions from session identity with ToolPolicy (#46999)
## Why

Tool allowlists alone cannot express the reviewer's sandbox and shell restrictions, which previously depended on session identity. Threads need to supply these restrictions explicitly at startup.

## What changed

- Replace `AllowedTools` with `ToolPolicy`, combining an optional allowlist with managed-sandbox requirements, unified-exec requirements, and control over additional-permission arguments.
- Capture the policy once at startup and apply it during tool registration and construction, including hosted tool filtering. Later extension-state changes cannot relax it.
- Supply the reviewer policy explicitly while retaining the fallback for reviewer sessions without a supplied policy. Explicit policies take precedence over session identity; ordinary defaults preserve existing tool setup.

## Testing

Update tool-planning tests to use explicit policies and add startup coverage for additional-permission schemas, ordinary defaults, reviewer fallbacks, explicit-policy precedence, and policy capture despite later extension-state changes.

GitOrigin-RevId: 71e561d76ea24d961f5b29c7c619bdb1356c216a
2026-09-21 10:40:40 +00:00
jif 3938a27c1d Route agent delivery through captured send requests (#46994)
## What changed

Replace `LocalAgentControl::deliver_message` with `send(SendRequest)`, accepting both user input and agent messages with captured resume configuration and turn options. Resolve target references relative to the caller's registered identity and return recipient metadata and a submission ID in `DeliveryReceipt`.

Migrate the V2 messaging tools to the new entry point and use receipt metadata for activity events. Preserve recipient reload behavior, non-waking queue-only messages, and rejection of follow-up tasks targeting the root agent.

## Testing

Update the cold-resume and sibling-reload tests to exercise `SendRequest` while checking instruction inheritance.

GitOrigin-RevId: 8fd330b8a9c3510483110ed05c4c9d3d616db237
2026-09-21 10:11:53 +00:00