Compare commits

...
Author SHA1 Message Date
waozi e948929204 Record that Gitea is primary and builds run on Delta 2026-11-17 21:25:46 -03:00
waozi bb4f279951 Record the GitHub rename to waozixyz/xcode 2026-11-17 18:44:19 -03:00
waozi f2fad5bdc4 Record the exact Sol model IDs for the xcode rename 2026-11-17 18:41:22 -03:00
waozi 1c11446a78 Add the new-model skill with real-turn and remote-install scripts
Adopting GPT-6.2-Sol took about 1.5 hours, mostly avoidable: builds
restarted after a raw cargo run without ZIRAN reran the Ziran build
scripts, two logins turned out to be at their usage limit only after the
build, Omega's 8 s DNS lookups slowed every turn, and Omega and Delta
were installed by hand.

skills/new-model lists the steps in the order that avoids those waits.
scripts/model-turns.py runs a plain answer, a shell call and a patch edit
at each effort and accepts a turn only on its real effect.
scripts/install-xcoder-remote.sh installs the locally installed build on
Omega or Delta (through Omega), renaming each file into place.
2026-11-17 17:27:22 -03:00
waozi 095c9cfa21 Bundle GPT-6.2-Sol first in the model table
The provider now lists gpt-6.2-sol at the top of every account's /models
catalog. When that request fails (it has 5 s, DNS included), Xcoder falls
back to its bundled table, which only knew GPT-6.1-Sol: sessions without a
configured model started on 6.1, and 6.2 ran on fallback metadata
("Model metadata for `gpt-6.2-sol` not found").

Add the provider's own gpt-6.2-sol entry to the bundled table with
priority 0, so it is the default with or without the live catalog. A test
checks that a failed catalog fetch defaults to the newest bundled Sol.
2026-11-17 17:09:17 -03:00
waoziandClaude Opus 5.5 d3bc203a10 Drop Windows support, speed up builds and port diff and git to Ziran
Windows support is removed: the Windows sandbox crates, PowerShell and
cmd shell support, Windows-only code paths, config keys, app-server
requests, TUI prompts, the standalone Windows updater and the Windows CI
and installer scripts.

The TUI header, /status, the exec banner, analytics and turn metadata
show the tracked Codex version (at least 0.169.0) instead of 0.0.0.

Builds:
- Ziran build scripts no longer watch the missing ziran.local.toml;
  Cargo reran them on every build, recompiling most of the workspace.
- The build wrapper no longer caps builds at 2 GiB RAM in its own scope;
  memory comes from the surrounding build queue.
- make builds a `local` profile (no LTO, 16 codegen units, incremental);
  published releases keep `release` (XCODER_CARGO_PROFILE=release in CI).
- codex-protocol depends on a small codex-network-policy crate instead
  of the network proxy, the slowest crate in the build.
- Unused dependencies are removed.
A rebuild after a change in codex-config now takes about 90 s, and the
full local suite builds and passes in under 3 minutes.

Diffs come from the Ziran diff package (codex-utils-text-diff) instead
of similar and diffy, and the git baseline repository and remote URL
sanitizing use the Ziran git package instead of gix and gix-url. All
four remain only as test oracles: similar and diffy on generated edits
and damaged patches, gix-url on 200,000 generated remotes, and the git
CLI checks written objects with fsck --strict.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:51:13 -03:00
waoziandClaude Opus 5.5 113ff6b8bc Recognize the apply_patch heredoc form in Ziran
extract_apply_patch_from_bash now runs xcoder_apply_patch_heredoc in
native/apply_patch.zi instead of a tree-sitter query. It accepts the
same two whole-script forms (apply_patch/applypatch <<DELIM ... DELIM,
optionally after `cd <one bare word, "string" or 'string'> &&`) and
returns the same body and cd path. Heredoc bodies end only at a line
that is exactly the delimiter (leading tabs stripped for <<-), as in
Bash: tree-sitter's scanner also ended them at lines that merely start
with the delimiter (EOFX), cutting such patches short. An unterminated
heredoc does not match, as before.

The query stays as the test oracle: on 20,000 generated realistic
scripts Ziran returns the same trimmed body and cd path wherever
tree-sitter's own tree has no errors; new unit tests pin the Bash rules
for look-alike, indented and unterminated delimiters. tree-sitter and
tree-sitter-bash are now dev-dependencies of codex-apply-patch.

Local tests: apply-patch (75 unit, 28 integration), core apply_patch
(29).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 07:34:57 -03:00
waoziandClaude Opus 5.5 26039c321d Find dangerous shell commands with a Ziran scanner
parse_shell_lc_literal_commands, which dangerous-command detection uses
to look at every command in a script, now runs xcoder_literal_commands
in native/shell.zi instead of walking a tree-sitter-bash tree. It
descends into lists, pipelines, subshells, { } groups, if/while/until/
for/select/case and function bodies, $(...), backticks, <(...) and
>(...), double quotes and unquoted heredoc bodies; it drops redirection
targets and leading assignments and keeps only literal words, as the
tree walk did. Words are collected on a stack so commands nested in an
argument never interleave with it, and commands come out in post-order,
which reversed is the tree walk's order. Scripts whose compound commands
or operators do not fit together fail, as Bash refuses to run them.

The tree walk stays as the test oracle. The invariant is about safety:
whenever tree-sitter's commands make a script dangerous, Ziran's must
too, unless Bash itself rejects the script or reads that text as a
heredoc body (checked with bash -n). It holds on 40,000 generated
scripts (32,943 with identical command lists) and on 1,005 real agent
commands, where Ziran additionally flags two scripts whose rm commands
tree-sitter failed to parse.

Local tests: shell-command (195 + corpus), core danger (16) and
safety (15) tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 07:20:07 -03:00
waoziandClaude Opus 5.5 161359a813 Recognize plain shell commands in Ziran
parse_shell_script_into_commands, which exec policy, command
canonicalization, plugin attribution and parse_command use to prove a
script is only plain commands joined by &&, ||, ;, | and newlines, now
runs native/shell.zi instead of walking a tree-sitter-bash parse.

The recognizer is deliberately conservative and is checked against the
tree-sitter walk, kept as the test oracle: it must never accept a script
tree-sitter rejects or return different words. The parity tests found
and pinned tree-sitter's rules for command names (a single bare word,
not a number, not dashes alone, no `=`, not a reserved word even when
followed by punctuation) and for word parts starting with `=`. On
50,000 generated scripts there are no parity problems (3,630 accepted
by both; 1,327 adversarial ones rejected only by Ziran); on 1,005 real
agent commands (local corpus, not committed) the two agree exactly.

tree-sitter-bash still serves the literal-command extraction for
dangerous-command detection, shell snapshots and apply_patch heredocs.

Local tests: shell-command (193 + corpus run), core exec_policy (104)
and command_canonicalization (4).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 07:02:05 -03:00
waoziandClaude Opus 5.5 705f52a5a6 Rebuild apply_patch progress only when a patch line completes
Core turned the streaming patch parser's full snapshot into a progress
event for every delta the model sent: every hunk was cloned and every
update diff reformatted, though most deltas are a few characters and
change nothing. Streaming a long patch was quadratic. The parser now
has feed(), which reports whether a delta completed a line, and
hunks(), which borrows the current snapshot; core skips deltas that
complete no line, so the events it emits are unchanged. push_delta
keeps its API, and the parser splits deltas on newlines instead of
pushing one character at a time.

Local tests: apply-patch (73 unit, 28 integration, including a new
test that feed matches push_delta character by character) and core's
29 apply_patch tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 01:00:15 -03:00
waoziandClaude Opus 5.5 eba5fda3e4 Use a plain shell in the running-executable installer test
The test copied /usr/bin/sleep and /usr/bin/true under other names.
On systems whose coreutils is a multi-call build (uutils, as on
Ubuntu), those copies refuse to run under another file name, so the
test failed before it reached the inode check. It now copies /bin/sh,
whose process stays the running executable while its child sleeps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 00:34:27 -03:00
waoziandClaude Opus 5.5 51cd837786 Parse rules files in Ziran and drop the Starlark interpreter
Exec-policy .rules files were evaluated by a full Starlark interpreter,
but they only ever use a declarative subset. native/execpolicy.zi now
parses that subset into a node tree: top-level calls and NAME = value
assignments over strings (quoted, raw and triple-quoted, with every
Starlark escape), lists, tuples, integers, True/False/None, names and
`+`, with comments, continuations and semicolons. A small Rust
evaluator resolves names and `+` and binds arguments to prefix_rule,
network_rule and host_executable as Starlark did (positional or
keyword, None as omitted, errors for unknown, missing, duplicate or
mistyped parameters); the existing validation is unchanged.

Functions, loops, conditions, load and f-strings are rejected with
their line. Errors keep the `path:line:column: starlark error:` shape
core parses for the location. The starlark crates and about 60
dependencies they pulled in are removed, along with two security
advisory exceptions only they needed.

Local tests: all execpolicy tests plus six new rules-language tests,
and core's 104 exec_policy tests (run with a 16 MiB test stack; one
agent-spawn test overflows the default stack in this debug build).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 23:28:46 -03:00
waoziandClaude Opus 5.5 801a9e1f01 Apply apply_patch updates in Ziran
derive_new_contents_from_chunks now hands the file and its chunks to
xcoder_apply_chunks in native/apply_patch.zi, which splits the file
into line offsets (keeping LF, CRLF and CR endings, the first one
preferred), finds every chunk with the Ziran matcher, collects and
stably sorts the replacements, and writes the new contents once into a
buffer sized up front. Lines are no longer copied into strings several
times. Error messages are formatted in Rust exactly as before.

The Rust pipeline (SourceFile + compute_replacements) remains as the
fallback for text above 2 GiB and as the oracle: results and error
messages match on 3,000 generated patches with mixed endings, context
lines, end-of-file and failing hunks. A 20-hunk update of a 50,000-line
file takes 3.2 ms instead of 7.7 ms (make benchmark-apply-patch).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 23:04:05 -03:00
waoziandClaude Opus 5.5 a82616a888 Match apply_patch hunks with a Ziran matcher
seek_sequence now runs in native/apply_patch.zi behind the same Rust
signature. It borrows the file's and the pattern's lines through
pointer and length tables, compares bytes with memcmp, trims Unicode
White_Space from both ends without rescanning lines, and decodes only
non-ASCII scalars. The four passes (exact, trim_end, trim, trim with
typographic punctuation normalised) and their order are unchanged.

The Rust matcher stays as the fallback for lines above 2 GiB and as
the oracle for parity tests over 4,000 generated cases, edge cases and
a 20,000-line file. On a 50,000-line file (make benchmark-apply-patch):
punctuation-tolerant and failing searches are 4-5x faster (3.9 ms vs
20.5 ms, 3.1 ms vs 16.1 ms); exact and trimmed matches cost 0.4-0.7 ms
more, mostly building the line tables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 22:59:01 -03:00
waoziandClaude Opus 5.5 7af3d41cee Build the packaged binaries before the native tests
`make test` ran `make native-test all`, so the native cell test looked
for build/bin/codex-code-mode-host before `all` had packaged it. Local
runs passed only because an earlier build had left the binary there;
CI failed on every push. Build `all` first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 22:22:51 -03:00
waoziandClaude Opus 5.5 4351f9f80e Retry busy cell executables and detach the version check
Parallel cells could fail with "Text file busy" when another thread
forked while a freshly written cell executable still had a writer
descriptor; spawning now retries ETXTBSY briefly. The upstream Codex
version check runs on a detached thread with its own runtime, so a
stalled network cannot hold up process exit, and the offline CLI tests
and memory benchmark disable it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 22:03:27 -03:00
waoziandClaude Opus 5.5 e5109dea3f Release Xcoder 0.1.0
Report the newest upstream Codex release to the service, separately
from Xcoder's own version. The reported version is the larger of the
built-in 0.169.0 and the latest openai/codex release, which the CLI
checks on GitHub in the background at most every 20 hours and caches in
CODEX_HOME/xcoder-upstream-version.json (XCODER_UPSTREAM_VERSION_CHECK=0
turns the check off). `xcoder --version` now shows Xcoder's own number,
0.1.0.

Fix two regressions found by the local suite:
- Shell commands that ran before the session's shell snapshot existed
  used the login profile's PATH, so a profile's apply_patch could win
  over Xcoder's. The Codex-owned PATH entries are now replayed after
  login startup without a snapshot too.
- Tool cells failed with "unexpected end of file" when they exited,
  because the callback channels a cell never used closed. A clean close
  between requests now retires that channel.

The installer no longer keeps copies of the binaries it replaces. The
validation fixture covers every native test, and the dead --oss
plumbing is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 18:30:53 -03:00
waoziandClaude Opus 5.5 e1ab91cdf9 Release idle memory, prune unused parts and report the upstream version
Idle sessions give their memory back: after XCODER_IDLE_RELEASE_SECONDS
(default 120, 0 disables) a watcher written in Ziran (native/idle.zi)
trims the allocator, pages private memory out to swap and unmaps clean
program pages. Measured with 600 tool calls: 415 MB resident drops to
23 MB, and the next keypress takes 79 ms. The TUI's replay copy of a
finished command keeps only the first and last parts of output above
16 KiB. make benchmark-memory and the scripts/memory allocation tracer
measure this.

Remove what Xcoder never uses under Harmony: the cloud, tcp-tunnel,
responses-api-proxy, exec-server and debug app-server subcommands with
their crates, the Ollama and LM Studio providers with the TUI's
local-provider picker, and the AWS SDK behind Bedrock sign-in. --oss
now stops at startup with an explanation.

Model requests identify as the tracked upstream release (0.169.0) in
their User-Agent and version header, as catalog requests already did.
A fresh ChatGPT-account session refused gpt-6.1-sol while requests
still said 0.0.0. The rule lives in codex_protocol::client_version.

Also carried over from the shared working tree: native Ziran fuzzy
matching and Mermaid adapters, Linux packaging and its workflow, and
Landlock/seccomp cell sandboxing in place of bwrap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 14:32:42 -03:00
waozi 79119a9392 Report tracked upstream version for the model catalog
Xcoder keeps upstream's 0.0.0 development workspace version, and the
Codex models endpoint hides newer models such as gpt-6.1-sol from 0.0.0
clients. Catalog requests and cache entries now report the tracked
upstream release, 0.169.0, so the full model list is returned and stale
0.0.0 cache entries are refreshed.
2026-11-13 19:01:20 -03:00
waozi ba9d4a9e84 Replace Codex tool runtime with native Ziran and install Xcoder 2026-11-11 10:02:48 -03:00
trpcic-openai 4dd5f1e70b Limit MCP product attribution to configured REPL-backed calls (#60697)
## Why

MCP request metadata could forward a client-supplied `product_sku` to unrelated servers and connectors.

## What changed

Remove `product_sku` from turn metadata before forwarding it. For Node REPL-backed servers and the browser connector, populate it from the turn's `apps_mcp_product_sku` configuration, mapping unrecognized values to `other` and omitting empty or missing values.

## Testing

Add regression coverage for configured REPL and browser attribution, unrelated servers and connectors, unrecognized or absent configuration, and spoofed client metadata.

GitOrigin-RevId: bc24062526048ea1c1621099e609053cf167602f
2026-11-11 01:47:52 +00:00
tarunoai ac54a05173 Add a Signer Service backend for macOS notarization (#60695)
## What changed

Allow `APPLE_NOTARIZATION_BACKEND=signer-service` to sign Apple notarization JWTs through `grpcurl`, using GitHub OIDC authentication. Validate the returned signing key and algorithm, and redact transport and signing failure details.

Keep Azure Key Vault as the default backend and skip its configuration requirements when Signer Service is selected.

## Testing

Add coverage for JWT refresh with fresh OIDC tokens and for the binary wrapper running without Azure configuration. All six notarization tests pass.

GitOrigin-RevId: e38ea90e94639d87c11ab075c999d85b61b37c17
2026-11-11 00:58:44 +00:00
Joe Savona 87b7bdbf2e Fit composer footer hints to available terminal space (#60683)
## Why

Narrow composer footers can clip hints or crowd out mode indicators and actions.

## What changed

Use a shared layout for navigation, actions, mode indicators, context, and warnings. Shorten or drop whole labels in priority order instead of clipping them. Add a second row when input modes and queue or active side-conversation actions fit separately but not together, keeping navigation and modes above actions.

## Testing

Add coverage for fullscreen and scrollback layouts, narrow Plan mode hints, active side-conversation actions, oversized goal indicators, and warning hit areas.

GitOrigin-RevId: 849a53d45ef1b36b40c52282e329b48ec7d7d12e
2026-11-10 23:36:04 +00:00
Joe Savona 65dbdb5f03 Wrap built-in TUI status lines within the footer row budget (#60682)
## Why

Long built-in status lines were truncated to a single row even when the footer had room for more content.

## What changed

- Wrap status text to the available width and row budget, preserving styles and hyperlink targets across rows.
- Show an unlinked ellipsis when content exceeds the available space.
- Refresh wrapped content when the status text, agent label, or width changes.
- Keep reasoning-effort transitions on one row and restore wrapping after the final animation frame.

## Testing

Add coverage for wrapping and hyperlink boundaries across footer layouts, content and agent-label updates, resizing, and wrapping restoration after an effort transition. Update transcript and startup snapshots for multiline status text.

GitOrigin-RevId: 30e0795c473efd62fc4d0dca4deb6029b625a9e8
2026-11-10 23:35:28 +00:00
Joe Savona 192e2ef3ce Prioritize draft space when allocating composer footer rows (#60681)
## Why

Status content and footer hints need to fit within the composer's height budget while preserving room for editing and active search controls.

## What changed

- Share row allocation between composer measurement and rendering. Cap status and hints at two rows in inline scrollback, and scale the fullscreen cap from two to four rows with the available budget.
- Reserve space for active footer controls, give suggestions and image previews priority over additional status rows, and avoid reserving an empty hints row when status is enabled.
- Keep textarea row counts and scroll offsets as `usize`, saturating only the terminal height so very tall drafts remain scrollable with a visible caret.

## Testing

Add layout and snapshot coverage for constrained height budgets, status and hints, image previews, slash suggestions, and transcript search cursors. Add a regression test for rendering a draft beyond the `u16` row limit.

GitOrigin-RevId: 20fb0384ffc976dfd12e648004763feff0597dda
2026-11-10 23:34:54 +00:00
Joe Savona 8a7a723dcd Keep TUI status content separate from composer hints (#60680)
## Why

Composer hints could replace configured status content, and mode indicators and warnings reduced the width available to status extensions.

## What changed

- Give enabled status content a dedicated area below the composer in both inline and fullscreen layouts, preserving it during transient hint states.
- Keep shortcuts, queue hints, mode indicators, and warnings in the hint row.
- Measure extension status content at the full available width, allowing up to four rows while yielding space to the composer when height is limited.
- Suppress composer hints behind centered dialogs.

## Testing

Update layout assertions and snapshots for status persistence, extension resizing and clipping, warning placement, and reasoning-effort transitions.

GitOrigin-RevId: f11c2e4fb53c35b69c2fbdbe80cef31bb28faca4
2026-11-10 23:33:26 +00:00
Felipe Coury ad3d3521ed Avoid redundant reads and screen clears when switching side chats (#60675)
## Why

A live parent thread continues receiving lifecycle notifications while its side chat has focus, so returning to it does not need another liveness read.

## What changed

- Skip the parent liveness read when returning from a side chat while the parent is still attached and online. Keep the read when reattachment is needed.
- Stop scheduling a deferred screen clear when handling a transcript reset that preserves the screen.

## Testing

Add regression coverage for parent `thread/read` requests with and without reattachment, and assert that side-chat navigation leaves no deferred screen clear.

GitOrigin-RevId: a07f161ec86b0ae51250c5a0156402d328c42bdf
2026-11-10 22:32:59 +00:00
cassirer-openai d4b19eca27 Preserve agent message deliveries in rollout traces (#60673)
## Why

An accepted agent message may never appear in a later inference request or compaction snapshot. Rollout traces need to retain the delivery and its interaction edge even when the receiving agent makes no further request.

## What changed

Capture agent message payloads in `HistoryItemAccepted` events and create conversation items when those receipts are replayed. Reuse each item's ID when it later appears in a request or checkpoint, updating its body to the model-visible representation. Repeated receipts preserve that representation without duplicating the item.

## Testing

Extend the spawn-edge regression test to cover delivery before any child inference, stable item IDs across a later request, and preservation of trimmed content after a repeated receipt.

GitOrigin-RevId: c193d691e8240645800ce004c11f21e3f1c82915
2026-11-10 22:22:35 +00:00
tarunoai 568c592f9c Add sign-only mode and tighten macOS signing verification (#60671)
## What changed

- Add a `sign-only` operation to sign macOS CLI packages without notarization.
- Validate the configured signing certificate before signing both standard and provisioned packages.
- Require the configured team ID for every executable during verification and extend leaf certificate fingerprint checks to standard packages.

## Testing

Add coverage for signing a standard package without notarization and rejecting unexpected signing certificates in both standard and provisioned packages.

GitOrigin-RevId: 0794c7666abfe981b59b47311e3a9108223b8f57
2026-11-10 22:00:40 +00:00
felixxia-oai fad8b3d5bc Initialize Guardian evidence cursors from thread history state (#60670)
## What changed

Expose history initialization and the effective history mode to thread-ready contributors. Add `EvidenceCursor::at_thread_ready` with paginated-history validation:

- Start new or cleared threads at position zero without requiring an existing rollout.
- Start resumed, forked, or supplied-history threads at the durable tail to avoid backfilling existing evidence.
- Skip the initial `SessionMeta` header when capturing evidence from position zero.

## Testing

Extend evidence tests to cover initialization before a rollout exists, capture of the first original record, rejection of resume without a rollout, and exclusion of existing records on resume.

GitOrigin-RevId: 32aa8e2afb71eb4e882b5f1fb107ac8616b33c8e
2026-11-10 22:00:08 +00:00
dhavalkapil-oai 39f422522e Skip submodule worktree scans when checking repository changes (#60669)
## Why

Submodule worktree scans can execute clean filters selected by task-writable Git configuration.

## What changed

Pass `--ignore-submodules=dirty` to `git status` in `get_has_changes_in_repo` to skip uncommitted submodule contents while retaining gitlink changes.

## Testing

Add a regression test that configures a submodule clean filter and verifies the repository change check does not execute it. The test also confirms that `git status` without the option executes the filter.

GitOrigin-RevId: 5330402f0354c3bf9613358575f8bedc9f312886
2026-11-10 21:58:49 +00:00
Channing Conger 733a1cca06 Add a content helper for forwarding MCP blocks in Code Mode (#60665)
## Why

Code Mode needs a way to forward mixed MCP tool results while preserving their content types and order.

## What changed

Add `content(block)` and `content(iterable)` so callers can forward tool output with `content(result.content)`. Text, image, and audio blocks become their corresponding output items; resource links and embedded resources are serialized as text. Invalid blocks and encrypted text are rejected, and iterators are closed when a block is rejected.

Share MCP block conversion and image detail types with the protocol layer, while preserving existing `image()` and `audio()` input handling.

## Testing

Add coverage for mixed content ordering, iterator behavior and cleanup, invalid blocks, image metadata, short audio clips, and output suppression after exit. Add an integration scenario verifying that MCP text and image blocks reach the model in order.

GitOrigin-RevId: 83832ec6c530dd35ea1e3373680627997c6e13c1
2026-11-10 21:28:22 +00:00
viyatb-oai f7aad26f1d Defer exec-server sandbox preparation to the execution host (#60663)
## Why

Remote commands can use workspace paths from a different operating system. Preparing them on the client should preserve those paths and command arguments for the execution host.

## What changed

- Build exec-server requests directly, carrying the native command and sandbox context without applying the client's sandbox transform.
- Resolve workspace permissions and runtime read access in `SandboxManager` on the execution host, including helper binaries and validated managed-network CA bundles.
- Add explicit backend selection and required platform sandbox selection, rejecting launches when the required sandbox is unavailable.

## Testing

Extend request tests to cover foreign workspace paths, Unicode arguments, and empty arguments. Extend the remote process test on Unix to verify that restricted reads allow the sandbox helper and validated CA bundle while denying an untrusted certificate file.

GitOrigin-RevId: 5fc02ac4208912ecefb80a212742389afc14ac05
2026-11-10 21:26:11 +00:00
smurching-oai 45d1f24d79 Support gateway device-code sign-in in headless TUI sessions (#60662)
## Why

Gateway sign-in needs a way to complete authentication over SSH or when no local browser is available.

## What changed

- Prefer device authentication for gateways that support it in SSH sessions, headless Linux environments, or when no browser handler is available.
- Check the selected session's provider and complete required gateway sign-in before requesting models, including when resuming a thread.
- Display the verification URL, one-time code, and cancellation instructions. Handle sign-in results, cancellation, and connection failures while the prompt is open.
- Skip device login for older servers that do not support it while preserving errors from current servers.

## Testing

Add protocol tests for early sign-in completion, connection loss, provider selection, resumed threads, and legacy-server compatibility, plus snapshots of the device prompt and gateway sign-in loading text.

GitOrigin-RevId: 4f3675ab2fc7fccafbad17796c72a7736ebb86b5
2026-11-10 21:09:59 +00:00
sayan-oai c9bbed2dae Support environment updates in app-server settings APIs (#60655)
## What changed

Add experimental `environments` fields to `turn/settings/update` and `thread/settings/update`. Turn updates apply to later steps of the running turn; thread updates apply to future turns. Omission or `null` preserves the selection, while `[]` clears it. Providing `cwd` in a thread update without an environment list selects the defaults for that directory.

Include the ordered environment selection in `thread/settings/updated`. Wait for Core to accept thread settings updates before returning success, and return rejections as request errors.

## Testing

Add integration coverage for attaching, replacing, preserving, and clearing environments; rejected updates; and the distinction between later steps and future turns.

GitOrigin-RevId: bfebeda57c676be94427aeb0c567c0b94fd9c387
2026-11-10 20:35:28 +00:00
Benjamin Carlsson 82e6bacb9c Enable model and reasoning effort selection for Cloud conversations (#60651)
## Why

Cloud conversations previously used the model returned on activation without exposing model discovery or supporting model changes from the TUI.

## What changed

- Fetch the account-scoped Cloud catalog on demand through `/v2/models`, independently of the submission and attachment queue.
- Let users stage a supported model and reasoning effort for the next new turn in the current conversation. Send these settings with the user message and show acceptance after successful admission.
- Show a loading picker when the catalog is empty, preserve compatibility with Cloud servers that lack discovery, and discard stale catalog results and selections when the account changes.

## Testing

Add coverage for catalog request parameters and queue bypass, deferred discovery and compatibility, model and effort serialization, admission outcomes, account invalidation, and opening the picker after discovery.

GitOrigin-RevId: 2cd0e7fe5f760d4da9258eefe9f0dcbcd23f9b07
2026-11-10 19:52:49 +00:00
zm-oai a92eae0891 Restore PowerShell's working directory in the MXC sandbox (#60647)
## Why

When a workspace has an unreadable ancestor, PowerShell can start with `$PWD` unset and its filesystem drive at the root, breaking relative paths.

## What changed

Prefix PowerShell commands in the MXC sandbox with a guarded workaround that restores the location from the process working directory when `$PWD` is unset. Preserve locations already initialized by startup or a profile.

## Testing

Extend the MXC PowerShell integration test to cover an unreadable ancestor, checking that `$PWD` matches the process working directory, relative file access works, and the parent and sibling file remain inaccessible.

GitOrigin-RevId: 4fb067db52a7f3c6e819169016fe6bd104a277a1
2026-11-10 19:40:10 +00:00
Won Park a2b7c4a655 Use trusted Guardian templates for managed policies (#60646)
## Why

User-configured model catalogs can supply Guardian prompt templates that omit policy slots or add conflicting instructions. Managed rules need a trusted template to reach the reviewer.

## What changed

- Use the bundled Guardian policy template when managed policy or additional rules are present, while preserving explicit host-provided templates.
- Remove `auto_review.extra_policy` and `auto_review.experimental_policy_template` from configuration and the schema. Warn when they are used, directing additional rules to `guardian_extra_policy` in managed `requirements.toml`.

## Testing

Add regression coverage for managed rules with user-supplied catalog templates, explicit host templates, and migration warnings for the removed settings.

GitOrigin-RevId: 7f00bfaa85051272ed70ceb2fcb64ffc297b8755
2026-11-10 19:30:21 +00:00
Andrew Ambrosino 2c2d99f0e3 Update the safety consent test for the current dialog (#60645)
Pass `can_save: true` when opening the consent dialog and assert that the
popup displays “Include logs and session history?”.

GitOrigin-RevId: d6035a9a1b3e5114a6e92a6fd31547f02c4980fc
2026-11-10 19:26:46 +00:00
rhan-oai 30b42cb802 Keep interrupts responsive during host service-tier updates (#60644)
## Why

Waiting for host acceptance of a service-tier update in the submission loop can block interrupts while the host receipt is pending.

## What changed

Move the host acceptance wait out of the submission loop while keeping explicit thread settings replies pending until acceptance completes. Report handoff failures to the caller while preserving the locally committed settings, and allow a subsequent explicit request for the same tier to retry a failed handoff.

## Testing

Add a WebSocket regression test covering interrupts with pending host receipts, failure reporting, same-tier retries, and continued thread operation after startup caller cancellation.

GitOrigin-RevId: 1b27d156eba3ebb47e717a987f41f4f595635be8
2026-11-10 19:13:55 +00:00
Dmitriy Kovalenko 3f797555cd Refresh Apps tools outside the MCP runtime gate (#60639)
## Why

Holding the session MCP gate during `tools/list` blocks other runtime access. Releasing it requires preventing stale refresh results from publishing after configuration or authentication changes.

## What changed

- Capture the Apps client under the session gate, then release the gate before fetching tools.
- Validate runtime and authentication state before publishing the shared cache and client catalog; retry a superseded refresh once.
- Wait for in-flight Apps refreshes before capturing model tools, preparing Apps calls, or shutting down the runtime.

## Testing

Add regression coverage for stale refreshes after runtime invalidation or logout, publication validation after call preparation drains, and a model step that waits for refreshed Apps tools while MCP status queries remain available.

GitOrigin-RevId: 42d4be8c4a9218933f8e3d07fc7f32f2da9cbd9d
2026-11-10 18:33:49 +00:00
cazhang-oai 057d9140a8 Honor read-only MCP tool hints in automatic approval (#60638)
## Why

MCP tools marked with `readOnlyHint: true` could still require approval in automatic mode when `destructiveHint` was also true.

## What changed

Give `readOnlyHint` precedence over `destructiveHint` and `openWorldHint` when deciding whether annotations require approval. Explicit prompt mode and strict automatic review continue to require their respective approval checks.

## Testing

Update unit tests for conflicting annotations, prompt mode, and strict automatic review. Extend app integration coverage to verify that read-only calls proceed while writes prompt in both automatic and writes approval modes.

GitOrigin-RevId: 11a930b857886bf41d09fd54c3a38607ae3d1b4e
2026-11-10 18:33:19 +00:00
Felipe Coury 4a784f63e8 Show pending key chords in a shared floating shortcut guide (#60637)
## What changed

- Replace footer chord hints with a floating guide that shows available completions after a 350 ms delay, including custom prefixes.
- Share guide rendering across conversations, transcript overlays, the session picker, startup drafts, hook review, and daemon recovery. Preserve workspace-specific pane labels and filter startup drafts to supported actions.
- Adapt the guide to short inline viewports, retain `Esc` cancellation, and redraw when pending chords clear. Consume clicks on the guide so they do not activate controls beneath it.

## Testing

Extend tests and snapshots for delayed reveal, timeout, custom prefixes, compact and inline layouts, startup-safe completions, and picker redraws after chord completion or cancellation.

GitOrigin-RevId: afa2fe3ae1b5fbea4cd871c17d35206e749c842c
2026-11-10 18:32:00 +00:00
Benjamin Carlsson df82e2fe0a Support archiving and restoring cloud threads (#60635)
## What changed

- Add cloud archive and unarchive requests and support listing archived threads.
- Detach successfully archived threads and emit archive notifications. Report loaded cloud threads from live attachments rather than cached resume metadata, including after archive failures.
- Scope resume picker archive state and transcript previews by backend and thread so archiving a cloud session preserves a local session with the same ID.
- Limit cloud task archive cleanup to the selected thread, preserving child agents and their active session state, and update the confirmation text accordingly.

## Testing

Add regression coverage for archive acknowledgments, archived-thread discovery and restoration, attachment state after archive failures, same-ID sessions across backends, and preservation of attached child agents.

GitOrigin-RevId: bd155be85ee911375d4d326b18f9b5abe8e82b3d
2026-11-10 18:19:11 +00:00
malsamiri-oai 627b579219 Preserve script quotes in Windows sandbox cmd invocations (#60624)
## Why

CRT argument escaping adds literal backslashes before quotes in `cmd.exe /c` scripts, breaking quoted paths and executable names.

## What changed

Serialize single-script `cmd /c` invocations with `/s /c` and an outer quote pair, preserving the script's quotes. Share this handling across Windows sandbox process creation, ConPTY, and MXC execution requests.

## Testing

Add a regression test for `certutil -hashfile` with a quoted path containing spaces, and update the command-line test for a quoted PowerShell executable.

GitOrigin-RevId: 32b4b7b55f6af4dba206813eac150310f37ae1d4
2026-11-10 16:58:06 +00:00
Eric Traut 2df465732a Use app-server MCP configuration and startup events in the TUI (#60622)
## Why

Locally configured MCP servers may differ from those reported by the app server. Waiting for unreported servers can leave startup progress busy after the observed servers have finished.

## What changed

- Track startup progress from received server status updates, settling when no observed starts remain pending. Handle standalone outcomes after attachment or lag, deduplicate repeated diagnostics, and reactivate progress on new starts.
- Read effective MCP configuration through `config/read` to prevent task tools from shadowing the `codex_tui` namespace, including when configuration changes after startup.
- Use the same configuration reader to disable MCP servers for temporary structured threads.
- Remove client-side MCP requirement checks for the task-tools server and MCP requirements from debug configuration output, leaving enforcement to the app server.

## Testing

Update regression coverage for unreported local servers, startup rounds after lag, diagnostic handling, namespace conflicts, and server-enforced managed requirements.

GitOrigin-RevId: 370767b90ee55f8b0b1403872ef437d53257586b
2026-11-10 16:44:23 +00:00
Keyan Zhang c37fd5665f Allow sampling in-progress turns with thread/sample (#60620)
## Why

`thread/sample` previously required the source's latest turn to finish before it could be sampled.

## What changed

Add `allowInProgressTurn`, defaulting to `false`, to sample a snapshot of the latest turn while the source continues running. The requested turn must still be the latest, but source history changes during sampling no longer invalidate the result when this option is enabled.

For an in-progress snapshot, include a context note explaining that the source was not stopped and pending tool calls may appear as `aborted` in the copy. Suppress the copy's default interruption message.

## Testing

Add coverage for sampling running turns in legacy and paginated history modes, including pending tool calls and mid-turn compaction. Verify that the source continues independently and that finished-turn samples retain their existing context.

GitOrigin-RevId: 771b979bf677e4ff0686476bfaf21aff92f7e7ac
2026-11-10 16:31:52 +00:00
Alex Kira 0d37c062de Support incremental tool declarations on GCP (#60617)
## What changed

Allow GCP Responses requests to use `incremental_tools_legacy`. When enabled, tool declarations are sent through `additional_tools` inputs instead of the top-level `tools` array.

## Testing

Extend Vertex request coverage to check incremental tool declarations, including namespaces, tool search, and `exec_command`. Add GCP cases to the scenario that verifies tool catalog updates are appended without rewriting history, with incremental tools enabled and disabled.

GitOrigin-RevId: 8f4c02f8d62575e24e695d6fae0472a09625409f
2026-11-10 16:13:17 +00:00
Jay Wang 039d0f27d5 Clarify safety recourse messaging and add a reporting option (#60613)
## What changed

- Show a refusal status while preparing alternative suggestions and remove the pending notice above the composer.
- Clarify that choosing a rewrite starts a new chat with earlier context, and update overview suggestions to explicitly say users can ask Codex.
- Add an option to report safety-check concerns through the consent flow when reporting is enabled.

## Testing

Update safety recourse snapshots and extend coverage for reporting consent, returning to the picker, and Daybreak notices when enabled or unavailable for the selected model.

GitOrigin-RevId: 99f565ebec7064ec55d388e73acede2dfe639474
2026-11-10 15:54:09 +00:00
Felipe Coury 37103d7f01 Keep the TUI responsive while opening saved side chats (#60599)
## Why

Opening a saved side chat waits for thread resume and history loading. Keep the chooser usable during that work and switch conversations only if the user still wants to open the chat.

## What changed

- Prepare saved chats in the background and show opening, waiting, and retry states in the sidebar. Allow cancellation and keep only the latest queued destination, with at most two preparations in flight.
- Ignore stale completions after navigation, archiving, disconnects, or backend changes, and release unclaimed subscriptions on their original connection.
- Preserve live events, settings, read receipts, and pending approvals received during loading. Anchor paginated history to the resumed snapshot to avoid overlap with live events.
- Carry held-key suppression across conversation switches.

## Testing

Add regression tests for retry and supersession, cancellation, stale completions, subscription cleanup, live updates during attachment, and held keys, plus snapshots for waiting and retry rows.

GitOrigin-RevId: 2c7d94482078f16895049ce79b242d3eb0d92f40
2026-11-10 14:28:13 +00:00
vishnu-oai b32ada5320 Add published OAuth metadata discovery to the RMCP client (#60578)
## What changed

Expose `discover_authorization_metadata` using RMCP and the existing OAuth HTTP adapter with a caller-supplied HTTP client. Return published authorization-server metadata, including discovery through protected-resource metadata, while excluding synthesized legacy endpoints. Return `None` when authorization metadata is unavailable and propagate discovery errors.

## Testing

Add tests for published versus synthesized endpoints, discovery failures and issuer mismatches, and discovery through a separate authorization server without sending credentials.

GitOrigin-RevId: b273067bb3b33d11301ae0e2017b28cd8e25b548
2026-11-10 11:45:44 +00:00
Brent Traut 77fde36ae1 Allow searching persisted attached threads (#60574)
## Why

Title and content searches exclude attached threads, preventing clients from finding their saved conversations alongside ordinary threads.

## What changed

- Add `includeAttachedThreads` to `thread/list` and `thread/search`. For `thread/list`, require a non-empty `searchTerm` and preserve the usual provider and source filters.
- Expose `attachedToThreadId` on thread responses to identify the owning parent independently of fork and subagent lineage.
- Support inclusive searches through SQLite and filesystem fallback, repairing missing database entries with saved thread names during title searches.

## Testing

Add regression coverage for opt-in title and content searches, attached-parent metadata after restart, default search filters, filesystem searches without SQLite, and discovery and repair of unindexed title matches.

GitOrigin-RevId: ac12ec3c730ad7f1722bdf8e21600d17f12017f0
2026-11-10 11:17:06 +00:00
Anton Panasenko c82708f858 Add an OpenSSH ProxyCommand mode to codex tcp-tunnel (#60568)
## Why

The existing loopback listener mode does not provide the stdin/stdout transport needed by OpenSSH's `ProxyCommand`.

## What changed

- Relay one SSH session over HTTP/3 CONNECT with `--environment-id ENV --port PORT`, defaulting to the public Portals gateway and port 22. Also accept an explicit `--proxy-url` with `--target ENV:PORT`.
- Require ChatGPT OAuth login, enforce cloud configuration and application network policy, and restrict OAuth credentials to the built-in gateway origin. Leave SSH authentication and host-key verification to OpenSSH.
- Preserve binary stdio, propagate input half-close, exit on gateway EOF, and report rejected CONNECT requests by HTTP status without exposing arbitrary peer error text.
- Require ERS-issued v2 tunnel JWTs for Portals listener mode unless OAuth mode is selected, and reject older ERS tunnel JWTs during credential updates.
- Disable UDP segmentation offload for SSH tunnels on Linux to avoid stalled bulk transfers on affected paths. Document an OpenSSH configuration example.

## Testing

Add coverage for argument validation, gateway routing, credential boundaries, JWT startup and renewal checks, binary relay and half-close behavior, gateway EOF and rejection, and cloud policy enforcement before gateway connection.

GitOrigin-RevId: 0d9afbddef01748efcc1c4b88f7e19923deff7e1
2026-11-10 09:54:57 +00:00
chess 6dfaca4dad Avoid periodic wakeups in idle Windows file watchers (#60560)
## Why

The Windows `notify` backend wakes every 100 ms even when idle.

## What changed

- Patch `notify` 8.2.0 in Bazel to wait indefinitely for events or control requests.
- Wake the watcher when configuration requests are queued and share ownership of the wakeup semaphore with `Arc<OwnedHandle>`.

## Testing

Add a Windows regression test that verifies file changes are reported after unregistering one directory and registering another on the same watcher.

GitOrigin-RevId: b53b3c8bc514008554fdeffaef3f7bf8305a4803
2026-11-10 08:52:35 +00:00
Eric Traut f988a5f0da Preserve inherited previews for paginated thread forks (#60559)
## Why

Reference-backed forks can lack a local opening user message, causing them to disappear from thread listings or lose their inherited preview when a new turn is written. Compaction can also remove the opening message from the model context used to prepare a fork.

## What changed

- Persist inherited previews and preserve them when recording new turns and merging thread-list metadata.
- Include reference-backed forks with inherited history in thread listings before their first local message.
- Recover opening previews from transcript history within the requested fork boundary when compaction omits them from model context.
- Use the shared `user_message_preview` helper when deriving previews from rollout items.

## Testing

Extend thread-fork integration tests to check previews in listings before and after a new turn, after reopening, and when forking at a boundary after compaction.

GitOrigin-RevId: 5962cf71ea7104f07c9013cc77259b105e4c60d7
2026-11-10 08:52:02 +00:00
Eric Traut ae5c75dbfc Discard opening prompts when side chat creation fails (#60558)
## Why

A failed side chat's opening prompt and image attachments could be restored into the parent chat's draft when dismissing the failure.

## What changed

Clear the pending opening message when sidebar chat creation fails, and stop restoring the opening message when side conversation creation returns an error.

## Testing

Update the sidebar chooser test to verify that dismissing a failed creation preserves the parent draft and a subsequent prompt without restoring the failed prompt or its image attachment.

GitOrigin-RevId: 1423786b2209e9441e0bc1504ffcf51e74ba7cde
2026-11-10 08:50:53 +00:00
Eric Traut a7a9d82f15 Collapse completed turn activity beneath transcript prompts (#60557)
## What changed

- Fold earlier commentary, reasoning, and tool activity beneath an expandable prompt control in the full-screen transcript, keeping partial and final answers visible.
- Label the control with completion timing when available, or a previous-message count otherwise. Keep tool groups independently expandable within the turn.
- Preserve assistant message phases during live completion and replay, and retain untimed completion markers to identify completed turns.

## Testing

Add transcript coverage for nested expansion, keyboard and mouse controls, narrow viewports, search anchor preservation, detailed mode, and legacy messages without phase or timing metadata.

GitOrigin-RevId: b17d9d7c870990178d76d12a13d463ff9c32b96c
2026-11-10 08:36:09 +00:00
Eric Traut bcbb7f5a9c Group consecutive tool calls in the full-screen conversation (#60556)
## What changed

- Combine adjacent tool calls into one expandable summary, including calls that move from live output into history. Label successful command groups with summaries such as `Explored files` and `Ran 2 commands`.
- Include web searches in tool groups, hide duplicate provisional search entries, and show a single completed search directly. Preserve its reading position when it completes.
- Refresh summaries as history changes while preserving pinned content during selection and reading.

## Testing

Add regression coverage for web search completion, grouped search expansion, loading older history during selection, and command completion with an expanded summary.

GitOrigin-RevId: 98f4e0c49cbf8014c25874cf47d1c0c92ee6b30d
2026-11-10 08:35:36 +00:00
Eric Traut 7539b0a856 Extend output-free transcript summaries to more tools (#60555)
## What changed

- Add summary labels for MCP and dynamic tools, computer activity, terminal interactions, file edits, images, plan updates, agent calls, and historical tool fallbacks.
- Keep tool output out of summaries and give summaries disclosure identities even when their cells have no activity IDs.
- Bring focused disclosure headers into view and show `expand` or `collapse` in the footer, including for search-expanded entries.

## Testing

Add assertions for tool labels, a transcript snapshot verifying that image-generation output stays hidden, and coverage for expanded and collapsed footer hints.

GitOrigin-RevId: 076b8d74c17f26b10aa8221c65b8b38dbb5ad5ea
2026-11-10 08:34:50 +00:00
Eric Traut fdb8be1485 Add optional tool call summaries to the full-screen transcript (#60554)
## What changed

- Add `tui.collapse_turn_details`, disabled by default, and a “Collapse turn details” toggle in the full-screen settings panel.
- Summarize command executions with output-free labels, grouping multiple calls behind an expandable row. Keep full details available through transcript search and detailed view.
- Restore interruption notices at their turn boundaries when resuming and loading older history, including turns split across pages.

## Testing

Add coverage for live summary updates, expansion controls, search access to hidden output, settings visibility, and interruption ordering across history pages.

GitOrigin-RevId: 68987fb0239e39414dac383098acac190fc4f516
2026-11-10 08:34:17 +00:00
smurching-oai 36e074a2fb Add local diagnostic ZIP saves to the TUI (#60542)
## What changed

- Let users press `Ctrl+S` in the report note editor to save a diagnostic ZIP locally without sending it to OpenAI, including when uploads are disabled. Keep `Enter` for sending reports when uploads are enabled.
- Apply the attachment consent choice to both destinations, clarify the disclosures, and show the saved archive path on completion.
- Require a local app server for ZIP saves, report unsupported servers with an upgrade hint, and stop before collecting a note when no report destination is available.

## Testing

Add coverage for ZIP creation with and without log consent, no upload requests on save success or failure, destination availability, keyboard actions, and saved-path receipts. Update report UI snapshots.

GitOrigin-RevId: cbc0142988840e5e3f6475f31678915bf25d56a2
2026-11-10 07:06:53 +00:00
Charlie Marsh c875667eb8 Reuse installed Git objects when upgrading marketplaces (#60528)
## What changed

Use eligible installed marketplaces as Git clone references to avoid fetching objects already available locally. Limit fetch negotiation to the recorded installation commit so local branch revisions are not advertised, and use `--dissociate` to keep the upgraded checkout self-contained.

Enable reuse only with Git 2.20 or newer and a recognized release version. Fall back to a fresh clone if reference cloning fails, and retain existing ref and sparse-checkout behavior.

## Testing

Add coverage for installation-commit negotiation, exclusion of local branch revisions, self-contained object stores, fallback with older or unknown Git versions and shallow references, and Git release parsing.

GitOrigin-RevId: 8d0f6a4bed7e7e2a3136e3912ba2f92150be9354
2026-11-10 05:20:44 +00:00
jamy-OAI b6d93b4cba Disable Daybreak when the selected model lacks access (#60526)
## Why

Switching to a model whose access metadata excludes Daybreak can leave Daybreak enabled and block subsequent turns.

## What changed

Automatically turn Daybreak off when a model switch or catalog refresh confirms that it is unavailable for the selected model. Persist the disabled preference for the thread and new threads, and warn that prior cybersecurity context may still cause refusals. Switching back to a compatible model leaves Daybreak off until the user re-enables it with `/daybreak`.

Require explicit access metadata before disabling Daybreak, and recheck the selected model before applying a queued change.

## Testing

Extend session lifecycle coverage for pending model discovery, supported and unknown models, persisted disabling, and subsequent turns using the standard access program. Add a snapshot of the model-switch warning.

GitOrigin-RevId: 6c294939d854c7176ed9a346e8ea806ffcf6f715
2026-11-10 05:09:30 +00:00
dpatel-oai 86a5522ded Preserve first-party catalog display order in app-server model lists (#60525)
## What changed

Return first-party provider models in catalog order while retaining priority-based default selection and existing filtering. Apply this ordering only to provider-origin catalogs for the OpenAI provider using Codex backend routes or `model_catalog_url`. Bundled, configured, and third-party catalogs retain priority ordering.

## Testing

Add coverage showing that catalog display order can differ from priority order while the recommended model remains the default. Update custom-provider coverage to verify priority ordering with a reversed catalog response.

GitOrigin-RevId: 9c2361e070ba424c092a282ca7f1cf9952d270b3
2026-11-10 05:08:19 +00:00
ioanbudea-OAI ab541fb990 Encapsulate thread metadata construction (#60524)
## What changed

Move `ThreadMetadataBuilder` into its own module, make its fields private, and replace direct field assignments with fluent `with_*` methods. Initialize `updated_at` and `recency_at` from the creation time and default the approval mode to `OnRequest`.

Update `apply_rollout_items` to accept a boxed `ThreadMetadata` seed, keeping callers' async frames small while preserving existing database fields except for the seed rollout path. Add `build_thread_metadata` to use the state runtime's configured provider, and use `thread_id_from_rollout_path` directly for the doctor's filename fallback.

GitOrigin-RevId: a27e4c6b22832e902922dbdd60d7f5c11b4a1a83
2026-11-10 04:56:49 +00:00
viyatb-oai b514f638aa Add policy-checked TCP upstream tunneling for SOCKS (#60523)
## Why

Allowing a hostname must not bypass deny or review rules on its resolved IP addresses. Forwarding DNS resolution to an upstream proxy also requires checking whether those address restrictions can still be enforced.

## What changed

- Add `TcpUpstreamProxy` and `set_tcp_upstream_proxy` to require a configured HTTP `CONNECT` next hop for opaque SOCKS TCP traffic. Wait for a successful response before forwarding payloads and preserve bytes read past the response headers.
- Enforce resolved IP deny and review rules at direct connection time, carry destination-scoped authorization through HTTP, SOCKS, and MITM forwarding, and report blocked resolutions as policy denials.
- Recognize equivalent numeric IP spellings for restrictive rules. Permit remote TCP DNS only when local binding is allowed and no deny or review pattern can restrict IP addresses; reject upstream proxy loops.
- Restrict Linux proxy bridges to managed proxy environment keys and supplied loopback ports. Bound concurrent bridge workers and release them after connection failures while allowing queued responses to drain.
- Add test-only Linux DNS name mapping and SOCKS relay helpers with stable synthetic addresses and validation before opening upstream connections.

## Testing

Add regression coverage for CONNECT refusal and buffered tunnel data, resolved-address policy denials, approval handling across policy refreshes, equivalent IP literals, DNS mapping stability, rejected relay requests, and bridge cleanup after resets.

GitOrigin-RevId: bdd6e16de3373d0eb39995f689dad0230680b99e
2026-11-10 04:43:24 +00:00
Charlie Marsh d15bf1deb7 Fragment large Responses WebSocket messages into bounded frames (#60522)
## What changed

Send Responses text messages larger than 1 MiB as a single WebSocket message split into frames of at most 1 MiB, awaiting each frame send to apply backpressure. Keep smaller text messages and non-text messages on the existing send path.

Update the `tokio-tungstenite` and `tungstenite` fork revisions and associated Cargo and Bazel lockfiles.

## Testing

Add a unit test covering the 1 MiB boundary, continuation opcodes, the final-frame flag, and preservation of payload bytes when a multibyte UTF-8 character crosses a frame boundary.

GitOrigin-RevId: 372ee31b77e185b963d3bdca11847e50e9018421
2026-11-10 04:31:32 +00:00
Eric Traut 39b42aaacd Handle unfinished tool calls in restored history (#60519)
## Why

Forked and recovered sessions can restore a tool call before its output has been recorded. Missing outputs for these calls should be treated as interrupted work rather than an error.

## What changed

Track the restored history's sequence cutoff so custom tool and local shell calls in that history can receive synthetic `aborted` outputs without reporting a missing-output error. Keep the existing checks for newly recorded calls and clamp the cutoff when history is replaced.

## Testing

Extend the active-turn fork test with a pending `apply_patch` call and verify that the fork's model input includes its `aborted` output.

GitOrigin-RevId: d989fa0991db72f0f8fa8a6d5de403fb307c40c7
2026-11-10 04:11:29 +00:00
viyatb-oai d2efdf1986 Route sandbox CLI launches through the shared sandbox manager (#60517)
## What changed

- Use `SandboxManager` to prepare `codex sandbox` commands, including permission profiles, workspace roots, and managed network proxy settings.
- Return a `WrappedSandboxCommand` that can produce an execution request or a configured process command, preserving native executable paths and Linux helper `argv[0]`. Require the session launcher for native Windows token sandboxes.
- Move macOS inherited-terminal policy handling into the shared manager, retaining Unix socket grants and the terminal input injection denial.
- Prepare managed network context alongside proxy environment variables and pass it through sandbox transformation.

## Testing

- Extend sandbox network proxy tests to macOS, covering blocked direct loopback access and explicitly allowed requests.
- Add coverage for Linux helper executable paths and dispatch names, including non-UTF-8 paths.

GitOrigin-RevId: 8b7396d21b2f34122699388f16047329a3f5e5c6
2026-11-10 04:01:23 +00:00
Charlie Marsh 551fc719d6 Record an MCP refresh reason for session permission grants (#60513)
Add `McpRefreshReason::SessionPermissionsGranted` and pass it when marking the
MCP runtime dirty after a session-scoped permission grant. This supplies the
required reason argument and identifies the refresh cause in CLI diagnostics.

GitOrigin-RevId: 2ff8f6b9e1a40d68e1f799d0414c2d45e2576a1a
2026-11-10 03:40:10 +00:00
ccui-oai 0811df3976 Treat inference hook denials as terminal errors (#60511)
## Why

An explicit denial from a workspace inference hook should stop the request, including retries and compaction model fallback.

## What changed

Recognize `inference_hook_denied` provider errors and preserve the provider's message, with a fallback when none is supplied. Expose the distinct `inferenceHookDenied` error through the app-server protocol and generated schemas and SDK types. Treat the denial as non-retryable during turns, compaction, and guardian review.

## Testing

Add coverage for terminal denials over HTTP, SSE, and WebSocket, error serialization and persistence in `thread/read`, and compaction failures that preserve token usage and history without retrying or falling back to another model.

GitOrigin-RevId: 2ebd480f01e52f4e6bd3db8a0f92d5814d18ccb1
2026-11-10 03:21:26 +00:00
zbarsky-openai 1099fe0694 Use hermetic LLVM for Windows MSVC Bazel builds (#60507)
## Why

Windows MSVC builds relied on installed C++ toolchains, and V8 snapshot generation required native Windows execution. Cross-compiling V8 also needs a Windows snapshot generator to preserve Windows unwind metadata.

## What changed

- Use the registered hermetic LLVM toolchain and declared Microsoft SDK for Windows MSVC builds, with static CRT linkage and the toolchain's declared `lld-link` for Rust.
- Run Windows V8 snapshot generators natively or through `rules_wine` on Linux, preserving target CPU, OS, and sandbox settings. Keep separate archive and binding pairs for the workspace's ISO stdio ABI and the distributed MSVC stdio ABI.
- Update build dependencies and bindgen, scope V8's Chromium libc++ settings to its own targets, and adapt native voice dependencies for clang-cl and Windows ARM64.
- Build SQLite directly with Bazel and give `openssl-sys` an explicit build using Bazel's OpenSSL.
- Remove build-worker source-directory dependencies from Bazel resource lookup, schema output discovery, and snapshot paths; embed assets in debug builds as well.

GitOrigin-RevId: fd224d9d28d73a67baf90f6d73c6079d60f20351
2026-11-10 03:02:25 +00:00
Joe Savona 3cd64c8d7c Preserve MCP trace context when tracing is disabled (#60506)
## Why

MCP requests need to retain inbound W3C trace context even when no OpenTelemetry tracing layer is installed.

## What changed

- Carry validated request trace context through app-server MCP tasks, connection startup, and resource listing tasks, while preferring active span context.
- Forward fallback `traceparent` and `tracestate` headers for MCP HTTP requests, including discovery and initialization.
- Use HTTP trace headers as a fallback for exec-server RPC calls when active span context is unavailable.

## Testing

Add an app-server integration test that disables trace exporting and verifies that `mcpServer/resource/read` forwards the inbound `traceparent` and `tracestate` to the MCP server.

GitOrigin-RevId: c886a55ce0a3992f1b2e04614efec80a20cb4b49
2026-11-10 03:01:14 +00:00
Charlie Marsh aa39ded153 Trace MCP refresh causes and plugin metadata changes (#60505)
## What changed

- Track and log `McpRefreshReason` values for runtime refreshes, including invalidations received during thread startup and forced refreshes. Restore claimed reasons when a refresh is cancelled before publication, while preserving concurrent invalidations.
- Correlate installed-plugin metadata invalidations with downstream MCP refreshes using a shared change ID. Log changed field names by plugin ID, additions, removals, and reordering without logging field values.
- Record whether background installed-plugin bundle updates were requested by startup, plugin listing, or installation.

## Testing

Add coverage for metadata change attribution across membership changes and reordering, and for retaining refresh causes across cancellation and concurrent invalidation.

GitOrigin-RevId: 3d4485ccfcc1d8788eb9909a060ac200c467af13
2026-11-10 02:45:30 +00:00
ioanbudea-OAI 0e6f153732 Derive sandbox telemetry labels directly from permission profiles (#60500)
## What changed

Compute the `sandbox_policy` label for `codex.conversation_starts` from the effective `PermissionProfile` without constructing a legacy `SandboxPolicy`. Preserve the historical labels and native-path compatibility fallbacks, including `workspace-write` for writable profiles that cannot be represented by a legacy policy.

Share the full-disk write compatibility check with session startup and the write-intent check with legacy policy conversion.

## Testing

Extend telemetry tests to assert sandbox labels in both logs and traces across disabled, external, read-only, workspace-write, and full-disk profiles, including unrenderable writable URIs and read restrictions. Add protocol assertions for legacy write-intent detection.

GitOrigin-RevId: 00f11d763c366453e7bb0899546a4ebbdb93c4d5
2026-11-10 02:31:50 +00:00
ioanbudea-OAI 1c9b058d26 Unify Guardian context preparation across reviewers (#60498)
## Why

Asynchronous Guardian collection applied entry caps and compressed heartbeat messages before request preparation, while synchronous collection preserved originals. Preserve the captured evidence so request-time profiles and budgeting determine what is delivered.

## What changed

- Replace `prepare_sync_context` with a shared `prepare_context` entry point for synchronous and asynchronous presentations.
- Defer text caps, native-message omission, and heartbeat compression to preparation, preserving heartbeat reference numbering across transcript deltas.
- Support elastic transcript preparation for both reviewer profiles.
- Borrow collected asynchronous context instead of cloning the full transcript, and filter previous reviews against reviewer history during preparation.

## Testing

Add coverage for collection preserving originals, fixed preparation truncating text and omitting oversized native entries, and elastic preparation deferring entry caps for both profiles. Update heartbeat tests to cover full and delta preparation without mutating collected evidence.

GitOrigin-RevId: 4d4e448acf5dc8880a05c3c9a9754378135f61eb
2026-11-10 02:18:39 +00:00
Sean Huang 064b2d9bca Preserve typed gRPC code-mode session admission errors (#60496)
## Why

Session-opening failures were returned as strings, preventing callers from inspecting the terminal gRPC admission status directly.

## What changed

- Add `GrpcCodeModeSessionProvider::open_session` returning `GrpcSessionOpenError`, distinguishing admission status codes, admission timeouts, and other setup failures.
- Keep string errors for the existing `CodeModeSessionProvider` trait API.
- Re-export `ProcessOwnedGrpcCodeModeSessionProvider` from `codex-core`.

## Testing

Extend admission tests to assert terminal status codes, cover exhausted `ResourceExhausted` retries, and verify that `DeadlineExceeded` is not retried.

GitOrigin-RevId: 9d7f2e733e12b8bb7def368fa5fc5a09ea2a374e
2026-11-10 02:09:01 +00:00
aramaraju-oai e0370f0b06 Add local-only Claude Code skill migration (#60492)
## What changed

- Recognize `claude-code-local-skills` as a migration source that excludes the home skills directory's `synced` folder from detection and import.
- Exclude the home skills directory's `.trash` folder from Claude Code skill detection and import in all modes.
- Keep importing `synced` skills in the default mode while excluding `.trash` directories within that tree.

## Testing

Extend the skill import regression test to cover local-only imports, default imports of synced skills, and exclusion of both top-level and nested trash directories.

GitOrigin-RevId: 2c036319d022820659a60179bf58c37621f6ba14
2026-11-10 01:51:29 +00:00
iceweasel-oai 4dcd8df891 Honor feature overrides when starting the app-server daemon (#60489)
## Why

`codex app-server daemon start` ignored CLI feature overrides, while `restart` already parsed and applied them.

## What changed

Parse and validate feature overrides for `start` using the same handling as `restart`, including `--enable`, `--disable`, and `-c features.<name>=<bool>`. Pass the overrides through to daemon startup so they are saved when launching a stopped daemon. Starting an already running daemon preserves its process and saved overrides.

## Testing

Add coverage for applying overrides on a fresh start and preserving them on a subsequent `start`. Extend validation coverage to ensure both `start` and `restart` reject non-toggle feature keys without changing settings or the running process.

GitOrigin-RevId: 9edbfdfc723146674051a9f0713e528b552eeb00
2026-11-10 01:31:19 +00:00
jameswt-oai 6aa88f9946 Remove the Xcode 26.4 MCP elicitation compatibility workaround (#60488)
## What changed

Route MCP elicitations through the standard handling paths for Xcode 26.4 clients. Remove the client-specific auto-deny flag and the synthetic acceptance of session elicitation requests without dispatching them to the client.

Simplify `request_mcp_server_elicitation` to return the optional response directly, and remove telemetry guards that depended on whether the workaround bypassed dispatch.

GitOrigin-RevId: ab540dcd67f8fa6d16c69bc7629f436e4b5aa73a
2026-11-10 01:30:43 +00:00
Alex Kira 08ae615122 Enable untrusted context tool outputs by default (#60487)
## What changed

Mark `untrusted_as_tool_output` as stable and enable it by default. Untrusted additional context, such as browser information and goal objectives, now reaches the model as `function_call_output` items in the `agent` namespace instead of user messages. Setting `features.untrusted_as_tool_output = false` preserves the message format.

## Testing

Update core, app-server, TUI, and Python SDK test expectations for the default output format. Cover context persistence, deduplication, goal continuation, and explicit opt-out behavior.

GitOrigin-RevId: 30828351e2ed584928f6055b6dcf276d8288c0fb
2026-11-10 01:30:08 +00:00
smurching-oai d8c42ecf8f Add device authorization to app-server gateway OAuth (#60486)
## What changed

- Advertise `supportsDeviceAuth` in `account/gatewayOAuth/read` and accept `deviceAuth: true` in `account/gatewayOAuth/login`.
- Return a device prompt with `verificationUrl`, `userCode`, and `loginId` before approval, then notify the initiating connection of success or failure with the matching `loginId`.
- Reuse or refresh saved credentials when possible, returning `prompt: null` without another device authorization. Update protocol schemas, generated bindings, and documentation.

## Testing

Add an integration test covering the device prompt, correlated completion notification, capability reporting, and token refresh without another device grant.

GitOrigin-RevId: 6ecc38c9baadcfda3272654ed71e4aaa431421bf
2026-11-10 01:28:45 +00:00
Charlie Marsh 1885417cd4 Handle context length errors consistently across response transports (#60482)
## Why

HTTP 400 responses with `context_length_exceeded` need to reach context-window recovery so manual compaction can retry with less history. Streaming context-window failures should end the stream immediately.

## What changed

- Map `context_length_exceeded` through the shared terminal provider error parser for HTTP 400 responses and events without an HTTP status.
- Return SSE context-window failures immediately.
- Preserve retryable handling for WebSocket errors carrying HTTP 503, even when their code is `context_length_exceeded`.

## Testing

Add coverage for WebSocket status handling and immediate SSE termination with retry headers. Update the manual compaction test to verify recovery from an HTTP 400 context-window error by dropping one history item and retrying.

GitOrigin-RevId: 56d8c831c2fad2ca1318318a3b4258fcc516d689
2026-11-10 00:55:34 +00:00
Charlie Marsh d9446b4b01 Treat invalid access program stream errors as terminal (#60481)
## Why

An `invalid_access_program` or `unsupported_access_program` streaming error should end the stream immediately, even if a later `response.completed` event arrives or the error includes a retry header.

## What changed

Map both error codes to `ApiError::InvalidRequest` and stop processing the response stream on invalid requests. Preserve a nonblank provider message, falling back to an explanation that the requested access program cannot be used with the model.

## Testing

Extend the terminal-error test to cover both codes in `error` and `response.failed` events, verifying that retry headers are ignored and the stream ends before a later completion event.

GitOrigin-RevId: 5431a2babec64eae5cdf6c138b98e91e84778e79
2026-11-10 00:55:01 +00:00
Charlie Marsh 4b345a8de9 Treat workspace access denials as terminal errors (#60480)
## Why

A `403` with `codex_workspace_access_denied` indicates that the account cannot use Codex in the selected workspace. Retrying or falling back to HTTP does not resolve that denial.

## What changed

Map `codex_workspace_access_denied` and `invalid_workspace_selected` responses to a shared workspace access denial error, and rename the error variant to reflect its broader scope. Keep workspace denials excluded from compaction model fallback.

## Testing

Extend API error mapping tests to cover the new code on `403` and preserve ordinary handling for `503`. Add WebSocket coverage verifying that an explicit workspace access denial does not trigger HTTP fallback.

GitOrigin-RevId: e601a22a0fa783a4ce5401a98ff9c8d3d9d1b074
2026-11-10 00:54:30 +00:00
Charlie Marsh 65f2709052 Treat content policy violations as terminal errors (#60479)
## What changed

Recognize `content_policy_violation` in HTTP 400 responses and streamed errors as a dedicated, non-retryable error. Preserve the provider's message and available HTTP status, use a fallback message when needed, and report `CodexErrorInfo::InvalidPrompt` to clients.

End the response stream immediately on this error and stop compaction from falling back to the current model after a content policy rejection. Add redacted diagnostic output and a dedicated sampler failure reason.

## Testing

Extend coverage for HTTP and wrapped WebSocket errors, missing or blank provider messages, terminal stream failures with retry headers, and content policy rejections during local and remote compaction on model downshift.

GitOrigin-RevId: 592170ac30c07b0b303a8d5cb15bd35c8f821b55
2026-11-10 00:53:04 +00:00
Charlie Marsh 5b98eaafeb Treat access program denials as terminal errors (#60476)
## What changed

Recognize `access_program_not_enabled` in HTTP 403 responses and response stream errors as a dedicated, non-retryable error. Preserve HTTP diagnostic details and provider stream messages, with a default message when none is supplied.

Stop SSE streams immediately on this error and avoid triggering WebSocket fallback for explicit access program denials. Add a fixed diagnostic label for doctor output and telemetry.

## Testing

Extend coverage for HTTP and WebSocket denials, immediate SSE termination despite retry headers, and doctor diagnostic redaction.

GitOrigin-RevId: 3a41f7bb80ad5e13a87e831b458d17cdd19a4b62
2026-11-10 00:08:32 +00:00
Charlie Marsh bb360e5db8 Stop retrying explicit invalid-workspace errors (#60475)
## Why

HTTP 403 responses with `invalid_workspace_selected` were treated as unexpected status errors, allowing retries and compaction fallback to another model after the server rejected the selected workspace.

## What changed

Recognize the code in `detail.code` or `error.code`, falling back to the `x-error-json` header when the body has no code. Classify these 403 responses as `InvalidWorkspaceSelected` and disable retries and compaction model fallback while preserving the response details and HTTP status. Other 403 responses retain their existing retry behavior.

## Testing

Add coverage for body and header error codes, code precedence, HTTP and WebSocket retry behavior, and local and remote compaction during a model downshift.

GitOrigin-RevId: f44a3bee5ef06e601909839868ab99cea6dd7d03
2026-11-10 00:07:57 +00:00
Charlie Marsh d3147716e0 Respect error retry policy during local compaction (#60473)
## Why

Local compaction retried invalid requests and server overload errors without retry advice, and used local backoff even when the server supplied `Retry-After`.

## What changed

Use `CodexErr::retry_delay` to decide whether and when to retry local compaction. Honor the original `Retry-After` deadline when present, while retaining the configured retry limit and context-window trimming behavior.

## Testing

Add coverage verifying that manual local compaction does not retry invalid requests or overload responses without retry advice, but retries overload responses with `Retry-After`.

GitOrigin-RevId: abe6cbba661f701b97f8b1ab83b1fe86979f03c0
2026-11-10 00:07:10 +00:00
ioanbudea-OAI 486c779c37 Serialize default thread permissions as a permission profile (#60472)
## What changed

Initialize thread metadata's `sandbox_policy` with a serialized `PermissionProfile::read_only()`, matching the format used by turn contexts and session settings. Remove the legacy `SandboxPolicy` field from `ThreadMetadataBuilder` and redundant rollout metadata defaults.

## Testing

Extend thread-store tests to cover reading the default read-only permission profile from SQLite and accepting both string and serialized legacy `danger-full-access` policies.

GitOrigin-RevId: ec9b88a47799a20529e28ef8ca6f5f7c2c8faf9e
2026-11-10 00:06:35 +00:00
Dmitriy Kovalenko caae161dd0 Keep thread storage available when diagnostic logs fail (#60466)
## Why

Failure to open the diagnostic logs database should not disable thread storage or database-only history listing. Thread deletion must still preserve saved conversations when diagnostic log cleanup cannot complete.

## What changed

- Allow state initialization to continue after non-corruption errors opening the logs database, while preserving corruption recovery.
- Report the original diagnostic database error after tracing is installed in the TUI and app server, and return it from log operations.
- Reject thread deletion before destructive cleanup when diagnostic storage failed to initialize.
- Continue periodic cleanup of legacy logs when the current logs database is unavailable.

## Testing

Extend coverage for unavailable log directories, database-only history listing, startup diagnostics, deletion preserving saved conversations, corrupt log headers, and periodic legacy log cleanup during a diagnostic storage outage.

GitOrigin-RevId: a5184580ae6c39ed0c4eefa8cb48ee7731a991c3
2026-11-09 23:22:08 +00:00
Benjamin Carlsson e1cc96712f Route TUI question answers through Cloud message admission (#60462)
## What changed

Submit asynchronous question answers through Cloud's start-or-steer admission path when a turn is running, and use start-if-idle submission otherwise. Resolve the submission intent against the session mode so local and remote sessions retain their existing behavior.

Apply normal message admission handling to Cloud answers, clearing accepted replies and restoring rejected replies to the composer.

## Testing

Add a regression test covering accepted and rejected Cloud question replies, including the submitted answer and client message ID, composer state, and absence of extra requests.

GitOrigin-RevId: 757556e8a11bc148a92cde8ca05fe06aa291ee2c
2026-11-09 22:21:18 +00:00
Dmitriy Kovalenko 76dcb8199b Honor permission grant scopes in executor capability discovery (#60461)
## Why

Approved filesystem access should make executor skills discoverable and readable for the lifetime of the grant. Turn-scoped access must not authorize persistent plugin servers or hooks, or bypass disabled-plugin policy.

## What changed

- Apply environment-specific session grants to capability discovery and refresh MCP after session grants change.
- Use a separate discovery inventory for skills with turn-scoped grants, keeping plugin servers and hooks on the session inventory. Reuse discovery results across unchanged model steps.
- Preserve disabled-plugin checks for unreadable manifests and symlinked manifest files or directories, including ancestor markers, while retaining standalone skill roots.

## Testing

Add coverage for V1 and V2 skill discovery before approval, after approval, and on the next turn; disabled-plugin ownership checks; discovery cache reuse; and session hooks surviving turn-scoped discovery failure.

GitOrigin-RevId: 929a7f8cb01f4bcfb4bee2c50ae02cd762066b2d
2026-11-09 22:20:07 +00:00
Dmitriy Kovalenko 0598a96e93 Prefer native clipboard images on macOS and honor image orientation (#60455)
## Why

The macOS clipboard reader requests TIFF even when PNG or JPEG data is available, causing clipboard owners to generate a large TIFF just for a paste. Pasted image files also need their orientation metadata applied before encoding attachments.

## What changed

- Read native macOS pasteboard representations before falling back to `arboard`, preferring PNG within each item while respecting item order and JPEG/TIFF ordering.
- Keep copied image files ahead of clipboard previews and apply orientation metadata when decoding files and native PNG/JPEG data.
- Share orientation-aware decoding with transcript thumbnails while preserving allocation limits.

## Testing

Add tests for pasteboard item ordering, all EXIF orientations in PNG and JPEG images, and rejection of images exceeding the allocation budget.

GitOrigin-RevId: 088f37a3205e49c805a09a84bbbb00b74dd6cb78
2026-11-09 21:30:05 +00:00
Dmitriy Kovalenko 7761f0a594 Update OpenSSL Rust dependencies (#60454)
## What changed

Update `openssl` from `0.10.75` to `0.10.82` and `openssl-sys` from
`0.9.111` to `0.9.118` in `codex-rs/Cargo.lock` and `MODULE.bazel.lock`.

GitOrigin-RevId: ec77f18ccdcec89a17c390672b42f3f99d09a1c5
2026-11-09 21:28:53 +00:00
Jenia Varavva 9f04d886f3 Support cancellation and deadlines for realtime attachments (#60443)
## Why

A pending realtime connection handshake can hold up subsequent attachment requests. Callers need to cancel obsolete attempts or limit how long they may take to establish a connection.

## What changed

- Add `RealtimeAttachmentOptions` with an optional cancellation receiver and `start_before` deadline to `Op::RealtimeConversationAttach`.
- Interrupt pending connection work and finish cleanup before acknowledging cancellation. Reject cancelled or expired requests before replacing an existing conversation, and recheck cancellation and the deadline before publishing a connection.
- Preserve a successfully published connection when cancellation arrives later. Dropping a cancellation sender whose value is `false` lets the attempt continue.
- Prepare the daemon startup test's socket directory with `codex_uds::prepare_private_socket_directory`.

## Testing

Add integration coverage for cancelling a held handshake, skipping cancelled or expired queued requests, preserving the next usable call, and releasing a pending handshake when its deadline expires without a cancellation receiver.

GitOrigin-RevId: 7144c1237bcbe3b859f10b654d919ae9ff20cbbb
2026-11-09 20:24:40 +00:00
Won Park 6bd17ba6ae Revalidate request auth ownership after budget checks (#60436)
## Why

Account changes during asynchronous request setup can invalidate the credentials selected for a generation request.

## What changed

- Restart HTTP request setup if the auth owner changes during the budget check.
- Validate the WebSocket connection's retained auth owner with `AuthOwner::is_current()` after budget checks.

## Testing

Add regression coverage for account switches during HTTP budget checks and external credential changes before WebSocket request setup, in both dual-header and assertion-only runtime auth modes.

GitOrigin-RevId: 7a1e1475a40aa2d34cd94f60f729ad697f3f7028
2026-11-09 19:50:14 +00:00
Eric Traut 05cf8eeb14 Dismiss the model switch prompt when account usage recovers (#60435)
## Why

The rate-limit model switch prompt can remain visible after account usage falls below the warning threshold.

## What changed

Use fresh account usage reads to clear pending prompts when all reported usage windows fall below 90%. If the prompt is already visible, replace it with a recovery notice that counts down for five seconds before dismissing. Users can also dismiss the notice with Enter or Esc.

Ignore stale account reads when detecting recovery and preserve the recovery state when backend banners replace the prompt.

## Testing

Add regression tests and a snapshot covering pending prompt cancellation, stale reads, the recovery notice countdown, automatic dismissal, and manual dismissal with Enter or Esc.

GitOrigin-RevId: 9408f7cc7b49c52535f00d8a476f208fe4872bdf
2026-11-09 19:37:04 +00:00
cooper-oai ac37f98c73 Reset app-server turn summaries when a turn starts (#60434)
## Why

An error recorded before a turn starts can cause a successful turn to be reported as failed.

## What changed

Reset `TurnSummary` on `TurnStarted`, preserving the new turn's `started_at` timestamp while clearing accumulated errors, command start times, and the last agent message.

## Testing

Extend turn completion tests to cover clearing an error recorded before turn start and retaining an error recorded during the turn.

GitOrigin-RevId: 19989b55d20df7b9a265bd0a1dfb3f00b6e8a9c5
2026-11-09 19:28:34 +00:00
cooper-oai 3ff5d6223b Bind API workload identity source reuse to session claims (#60433)
## Why

Matching API workload identity metadata alone can preserve a credential source across session-family or provider and mapping revision changes.

## What changed

- Compare API workload identity tokens using OAuth source claims so ordinary token refreshes preserve the source while session or identity changes retire it.
- Include `wif_runtime_authorization_version`, `wif_provider_revision`, and `wif_mapping_revision` in source comparisons.
- Reject API workload identity exchange tokens without parseable source claims and nonempty `iss` and `session_id` values. Evict rejected credentials so a subsequent resolve exchanges them again.

## Testing

Add regression coverage for refresh continuity, session-family and revision changes, and rejection and re-exchange of tokens with missing, empty, or whitespace-only `session_id` values.

GitOrigin-RevId: 67189c27efae8a233250a320e6d4fac71d865e90
2026-11-09 19:26:55 +00:00
ioanbudea-OAI 2728f99126 Upgrade bundled SQLite to 3.54 for WAL fixes (#60432)
## Why

SQLite 3.54 fixes `RUSTSEC-2026-0459` when opening a database with a WAL, while retaining the WAL-reset corruption fix.

## What changed

- Upgrade `libsqlite3-sys` to `0.39.1` and require SQLite 3.54 or newer with a compile-time assertion in `codex-state`.
- Pin `sqlx-core` and `sqlx-sqlite` to the same upstream revision that supports the newer SQLite dependency, and allow that Git source in `cargo-deny`.
- Refresh the Cargo and Bazel lockfiles.

GitOrigin-RevId: 768224af79de9b71b21d14912ff01a1176ad37c3
2026-11-09 19:26:23 +00:00
Charlie Marsh 27fcd7cbed Expose deferred MCP servers in resource listings (#60423)
## Why

Aggregate resource listings omitted dormant MCP servers, leaving callers without their names for explicit queries.

## What changed

Include a sorted `deferredServers` list in aggregate `list_mcp_resources` and `list_mcp_resource_templates` results alongside resources from ready servers. Apply the listing filters to deferred servers and omit the field when empty. Discovery leaves dormant servers unstarted; callers can query them by passing `server` explicitly.

## Testing

Extend the resource discovery scenario for direct calls and Code Mode to verify deferred server names, confirm discovery leaves the server unstarted, and then list and read resources by server name.

GitOrigin-RevId: f95b8beb64bb1329f4ae3245e8c375614fcb3360
2026-11-09 17:58:16 +00:00
Eric Traut 4f9e7171a1 Let terminal status become done while background terminals run (#60418)
## Why

Background terminals kept the terminal program status at `Working` after a turn completed, preventing it from reporting `Done` or returning to `Idle` when acknowledged.

## What changed

Stop treating running background processes as active work when computing terminal program status. Background terminals remain visible in the TUI while the status follows the turn lifecycle.

## Testing

Update the lifecycle regression test to complete a turn with a background terminal still running and assert the `Done` → `Idle` transition on acknowledgment.

GitOrigin-RevId: cb995947e6868d6128736a621f268ebfe3891eec
2026-11-09 16:59:14 +00:00
Eric Traut 83f02f706c Keep fitting URLs intact in fullscreen Markdown transcripts (#60416)
## Why

URLs in fullscreen Markdown transcripts could split across rows even when the full URL would fit on its own row.

## What changed

Mark non-code Markdown lines containing URL-like text with the `UrlAware` wrap policy so transcript layout preserves fitting URLs on a single row.

## Testing

Add a regression snapshot showing a documentation URL moving intact to the next row after introductory text. Update the conversation snapshot and copy-on-select test dimensions for the changed wrapping.

GitOrigin-RevId: 4812c83483cff412406a71ae6745977c5384c7da
2026-11-09 16:58:01 +00:00
smurching-oai 6222faa3c4 Enable model catalog discovery with gateway OAuth (#60414)
## Why

Custom providers with gateway OAuth and an explicit model catalog should be able to discover models without an API key or API key model discovery enabled.

## What changed

- Enable catalog refreshes for custom gateway providers when `model_catalog_url` and `base_url` have the same origin.
- Reuse gateway credentials without starting an interactive login during catalog refreshes.
- Keep an unrelated saved API key from making gateway catalog discovery depend on the API key discovery setting.

## Testing

Add an app-server test for discovering a gateway catalog after OAuth login with no API key. Update coverage for catalog invalidation after gateway credentials require login, including across manager restarts, with API key discovery disabled.

GitOrigin-RevId: b133c428cb45a9037e4b2ef13ff2f9473ed96636
2026-11-09 16:37:22 +00:00
olliem-oai e54a5713ca Simplify Guardian's post-denial approval guidance (#60391)
## What changed

Simplify the post-denial rule in the Guardian policy template: user re-approval after seeing the concrete risk sets `user_authorization` to `high`. Remove repeated qualifiers about explicit approval of the exact action and certainty that approval came from the user; the authorization scoring guidance still covers those requirements.

Update the Guardian extra-policy review snapshot to match the revised prompt.

GitOrigin-RevId: 63643222e8f9c46c9d902ac8f5d1e11d24fafe9c
2026-11-09 12:54:46 +00:00
Brent Traut d2b4d63e95 Allow deferring plain-text MCP output in thread item listings (#60390)
## What changed

Add experimental `deferOutput.mcpToolCall` support to `thread/items/list` requests scoped to a `turnId`. Successful, completed MCP calls with nonempty, unannotated plain-text results can return empty `result.content` with `outputDeferred: true`. Clients can retrieve the saved output through `thread/items/read`; connector identity remains on the listed item.

Keep rich results, JSON or fenced text, app UI results, and built-in `codex_app` results inline. Preserve plain-text output when creating bounded previews of oversized MCP results so those previews remain eligible for deferral. Reads return the saved preview when output exceeds the 64 KiB history limit.

## Testing

Extend thread history integration coverage for independent and combined command/MCP deferral, experimental capability gating, excluded result types, connector identity, oversized previews, and retrieval of deferred items.

GitOrigin-RevId: 5c160b30a4eac2a9b70e3fa65b6dbd83e935338b
2026-11-09 12:54:12 +00:00
Benjamin Carlsson e787af9624 Include Codex Apps configuration in cloud prewarm requests (#60389)
## What changed

Set `plugins_mcp.product_sku` to `"codex"` in cloud thread prewarm requests for both default environments and selected projects.

## Testing

Update request payload assertions to verify the Codex plugins configuration alongside managed environment defaults, model overrides, and deferred project readiness.

GitOrigin-RevId: c4ab95aa8e3440c816c5cd136444a038f4532eb9
2026-11-09 12:52:52 +00:00
Dylan Hurd 8703d32bd0 Treat goal objectives as untrusted context (#60342)
## What changed

- Pass goal objectives as untrusted `goal_objective` context instead of embedding them in continuation instructions. Direct the model to use `get_goal` if the objective is missing or truncated.
- Inject newly created objectives into their originating active turn without dropping unrelated client context. Render them as tool outputs when `UntrustedAsToolOutput` is enabled.
- Queue additional context together with automatic turn input so both reach the first model request.

## Testing

Extend app-server coverage to verify that model-written objectives appear as tool outputs at creation and continuation, without duplicating them in user messages. Update steering and Python SDK tests to check objective preservation and delivery alongside continuation instructions.

GitOrigin-RevId: 6f44f6d6c895bb4dc378c9cf84d6470ccc885c67
2026-11-09 03:58:05 +00:00
Benjamin Carlsson 6107b9886c Avoid duplicate assistant messages when resuming Cloud threads (#60335)
## Why

After Cloud thread history is replayed in the TUI, notifications for the same completed assistant items can render their text again.

## What changed

Track completed assistant items rendered from Cloud history by turn and item ID, and ignore subsequent starts, text deltas, and completions for those items. Apply this tracking when resuming threads and replaying thread snapshots, while allowing unfinished items and new turns to continue streaming.

## Testing

Extend the Cloud resume picker test to cover repeated notifications for completed messages, continued streaming in an active turn, and responses in a later turn. Retain coverage for queued user message reconciliation without resubmission.

GitOrigin-RevId: 1a829a2964586d876339c7c759022e4d366c8b2e
2026-11-09 03:01:00 +00:00
Benjamin Carlsson ffdf2daddb Suppress stale cloud stream disconnects after reopening a thread (#60327)
## Why

A queued cloud stream disconnect can outlive a successful reopen of the same conversation, causing an obsolete reconnect error to reach the TUI.

## What changed

Represent cloud reply stream losses with `AppServerEvent::ThreadStreamDisconnected` and filter queued losses superseded by a successful attachment to the same thread. Preserve losses for other threads and any newer disconnects; failed reopen attempts do not supersede pending losses.

Continue displaying current stream disconnects through the TUI's error notification handler.

## Testing

Add regression coverage for successful and failed reopens, disconnect ordering across threads, and TUI handling of disconnect events from the active and foreign backends.

GitOrigin-RevId: 640332b817970717fc816ab5a32bf658c01233bf
2026-11-09 02:31:46 +00:00
Benjamin Carlsson b9796386e5 Include older itemless Cloud failures in full transcripts (#60320)
## Why

Failed Cloud turns can contain an error without any items. Loading history through item pages alone can omit these older failures from the full transcript.

## What changed

- Add a `FullTranscript` hydration scope that fetches remaining Cloud turn metadata in pages of 100 after loading items.
- Deduplicate overlapping turn pages while preserving chronological order and already loaded items.
- Use the new scope for session transcripts while retaining `Complete` hydration for exports.

## Testing

Add a regression test covering older itemless failures, overlapping turn pages, repeated pagination cursors, transcript ordering, and item-only exports.

GitOrigin-RevId: 51183e35984aa0183d044061768555bb6f5d1189
2026-11-09 01:53:50 +00:00
Felipe Coury 8fcba7fae9 Improve side-chat discovery and navigation in the TUI (#60319)
## What changed

- Show latest user-prompt previews beneath saved side-chat titles, fetching previews only for visible entries when the chooser refreshes.
- Keep cached chats available during discovery, show loading and refresh status, and offer an inline retry action on failure.
- Preserve the selected chat across list updates and prevent asynchronous changes or held activation keys from opening an unintended entry. Account for preview rows in paging and mouse selection.
- Explain that side chats become available after the first main-chat message, and let `Ctrl+C` dismiss the chooser while preserving the main draft.
- Separate tabs with noninteractive gaps and improve hover styling for tabs, overflow arrows, and the add button.

## Testing

Extend integration tests and snapshots for discovery failures and retries, refreshed prompt previews, activation guards, variable-height paging, draft preservation, and tab hover states across light, dark, and fallback colors.

GitOrigin-RevId: 34423f5aeccb566682f7aa219f54ca5c7c8304fb
2026-11-09 01:52:42 +00:00
Benjamin Carlsson 25f4940d4a Defer executor readiness when prewarming a selected project (#60309)
## What changed

Set `deferred_environment` to `true` in cloud thread prewarm requests when a project is selected. Omit the field for default thread prewarming.

## Testing

Update the prewarm request encoding test to verify that only requests with a selected project include the deferred readiness flag.

GitOrigin-RevId: e10a646ebde9cc3acbdb01b304af0f73ecc1dbeb
2026-11-09 00:19:47 +00:00
Eric Traut 4e4767ffa7 Search task history from the command center (#60286)
## Why

Command center search only filtered tasks already loaded for browsing, leaving older tasks undiscoverable without manually loading more history.

## What changed

- Scan history on the active backend for case-insensitive matches in task names, previews, and working directories, using a separate paging cursor for each query.
- Add loading, retry, and `Show more matches` states. Cancel superseded searches and ignore stale results.
- Keep history matches separate from browse results and restore the previous selection when leaving search.
- Preserve the original task preview for search while displaying the latest prompt in task details.

## Testing

Extend discovery and command center tests to cover older history matches, fresh queries after browse pagination is exhausted, selection restoration, actions on search results, loading and retry states, and separate original previews and latest prompts.

GitOrigin-RevId: 9864ee006a14bd232e9cfd7ab2ee099c84667597
2026-11-08 19:35:45 +00:00
Charlie Marsh ee51bb132e Fix MCP startup tracking when attaching to shared app servers (#60280)
## Why

Clients attaching to a shared app server can miss startup notifications and have a different local MCP configuration. Waiting for locally configured servers can leave the TUI stuck in a busy state.

## What changed

- Track only reported MCP servers for shared app servers and subagents, settling startup once observed starts complete.
- Handle standalone terminal updates without reopening startup, while reporting failures and cancellations even when their starts were missed.
- Suppress duplicate diagnostics until an observed retry or notification lag, and include all received outcomes in each active round's summary.

## Testing

Add regression coverage for attachment before, during, and after startup; idle keyboard behavior after startup settles; terminal-only failures and cancellations; and repeated failures after retries or notification lag.

GitOrigin-RevId: e19f23c212f2f3cee1adeb5c3b94a508aa599242
2026-11-08 19:04:10 +00:00
Eric Traut 9ba7a3df52 Keep the agents overview open when there is no chat to return to (#60271)
## What changed

Only allow the cancel action to dismiss the agents overview when a chat is displayed or a startup thread is pending. Hide the `esc back` footer hint when there is no chat to return to, while retaining back hints for help and metadata editing.

## Testing

Add coverage for returning to a chat that is still starting and for pressing Escape in the overview after cancelling folder trust. Update snapshots and test setup to reflect whether a chat is available.

GitOrigin-RevId: af259330eb2a743fde449bbbd47c7f0eb6fa937e
2026-11-08 17:26:39 +00:00
Eric Traut a73fa8a869 Warn when a CLI model is absent from the ChatGPT model list (#60270)
## What changed

Show a startup warning when the active model matches the CLI model override but is missing from the ChatGPT model list, for ChatGPT accounts using the OpenAI provider. Suggest checking the spelling or choosing another model with `/model`, while preserving the selected model and submitting queued startup input.

Reuse the transcript-visible warning helper for this notice and existing usage warnings.

## Testing

Extend the startup test to check the warning text, preserved model selection, and queued input submission.

GitOrigin-RevId: bb1e8c415346bf271e25ef4e8571c13b4bc2c8c8
2026-11-08 17:17:51 +00:00
Sean Huang 748ab55ca7 Increase Bazel core unit test shards from 8 to 16 (#60206)
GitOrigin-RevId: d6188e178668c11ad212b907e420d32c2be25606
2026-11-08 05:59:11 +00:00
richardopenai c9b4267c37 Expose agent tree IDs and environment removal (#60190)
## What changed

- Add `CodexThread::agent_tree_id()` to identify a loaded agent tree. The root and native children share an ID; loading a new tree produces a new ID even when reusing a persisted thread ID.
- Add `EnvironmentManager::remove_environment()` to unregister an environment while preserving existing handles and the default environment ID.

## Testing

Extend tests to check tree IDs across child creation, forks, warm reuse, and cold reloads, and to verify environment removal and re-registration.

GitOrigin-RevId: 43944ed6766374508d9862cd5d333bc4cb67c338
2026-11-08 02:27:59 +00:00
Alex Kira c3936b4b8a Allow model overrides for incremental Code Mode tool messages (#60188)
## What changed

Add `exec_tools_update_hint` and `exec_tools_removed_definitions_header` to `model_messages.tools.incremental_tools` and use them when rendering Code Mode catalog updates and removals.

Overrides are literal strings limited to 512 UTF-8 bytes per field. Missing, null, or oversized values use the existing bundled wording. Empty strings omit the guidance while retaining changed definitions and removal keys. Wording changes alone do not trigger catalog updates.

## Testing

Extend unit coverage for defaults, null fields, independent fallback, and UTF-8 byte limits. Add scenario assertions and a snapshot covering custom and empty wording, model switches, catalog changes, and restoration after compaction.

GitOrigin-RevId: da9e00fdb5197a2b5fa39ce533ba87c76ff3e82c
2026-11-08 01:13:32 +00:00
alexsong-oai d960b36694 Allow creating custom providers during sign-in (#60186)
## Why

Custom-provider sign-in previously required a saved gateway configuration and stopped at an error when none existed.

## What changed

- Add “Create a custom provider or gateway” to the sign-in picker, reusing the settings form and provider-write handling.
- Return to the picker after saving, highlight the new provider, and require explicit selection before setting it as the default and completing sign-in.
- Preserve entered fields after validation failures and keep the focused field or Save action visible in short terminals.
- Use consistent custom-provider and gateway wording across sign-in, settings, and validation messages.

## Testing

Add onboarding tests and snapshots for an empty picker, creation, validation retries, short-terminal rendering, and explicit default selection. Extend app-server coverage for rejecting the reserved `ollama-chat` provider ID.

GitOrigin-RevId: 339ac5807c5eecdae08df4dbd89874ea7c764d35
2026-11-07 23:51:58 +00:00
Felipe Coury 8044c6867c Add keyboard and mouse navigation for sidebar tabs (#60181)
## What changed

- Add configurable `sidebar_up` and `sidebar_down` actions to cycle through tabs with wraparound while the sidebar has focus. Default leader shortcuts use `Shift-Tab` / `Tab`, `Up` / `Down`, and `k` / `j`.
- Support mouse-wheel tab switching over the tab strip and clickable overflow arrows when tabs do not fit.
- Show previous/next tab shortcuts in the leader HUD and keymap picker, and preserve pane zoom when switching tabs.

## Testing

Extend sidebar interaction tests and snapshots to cover overflow arrows, mouse-wheel navigation, leader shortcuts, repeated custom bindings, draft preservation, and scroll handling where the leader HUD overlaps the tab strip.

GitOrigin-RevId: 39ccb40f40560d1be850397f9597e765caa996a3
2026-11-07 23:18:39 +00:00
Benjamin Carlsson 1455fda735 Attach typed punctuation to completed skill mentions (#60180)
## Why

Skill completion inserts a trailing space, leaving unwanted whitespace when the next typed character is punctuation, such as `$rustdoc ,`.

## What changed

Replace the space inserted by skill completion when immediately followed by common closing punctuation, producing `$rustdoc,` instead. Support both skill mention pickers, including full-width punctuation and `》`, while preserving skill bindings.

Preserve existing draft whitespace and keep the separator for pasted text or punctuation entered after cursor navigation. Classify buffered punctuation as typing or a paste burst before deciding whether to remove the space.

## Testing

Add regression tests for punctuation, existing spacing, cursor navigation, and paste bursts, plus a snapshot covering `》`, recovery state, and preserved skill bindings.

GitOrigin-RevId: 8988add8092e8cb5f0618ef834590d52a81ad576
2026-11-07 23:00:32 +00:00
Alex Kira 5226f2fb4b Add metrics for incremental exec catalog updates (#60177)
## What changed

Count tool and namespace-instruction entry deltas in `codex.tools.exec_entry_updates`, tagged by `added`, `schema_changed`, or `removed`. Entry replacements count as `schema_changed`; full catalog declarations do not count as entry deltas.

Record rendered UTF-8 batch sizes in `codex.tools.exec_update_bytes`, including hints and framing but excluding full declarations and removal notices.

## Testing

Extend the namespace transition test to verify action counts, UTF-8 byte totals, and metric behavior when exec is hidden, restored, or unchanged.

GitOrigin-RevId: 22070b84230296d78a67b83641cbc02157d84419
2026-11-07 22:38:11 +00:00
Alex Kira aa9b9cc94e Test exec catalog preservation across session and compaction changes (#60173)
## What changed

- Cover incremental exec tool settings and catalog changes across resume, fork, tool mode switches, and compaction.
- Verify that adopting background compaction preserves live exec declarations, tool metadata updates, and retained conversation order after a model catalog refresh.
- Include an `exec` namespace in the top-level tool catalog ordering and snapshot round-trip test.

GitOrigin-RevId: 3df603b98a006abb55a5095b299080f036576242
2026-11-07 21:44:47 +00:00
psachdeva-oai 202b590e84 Preserve display instructions in answer moderation (#60172)
## Why

Recovered answer history needs presentation instructions alongside the moderation flag so clients can apply the intended display behavior.

## What changed

- Add optional `display` metadata with an `action` and optional `blockType`, `cyberTrustedAccess`, and `checkTrustedContacts` fields.
- Carry display metadata through final answers, legacy events, thread history reconstruction, and legacy rollout migration.
- Expose the metadata in the app-server protocol and update generated JSON schemas, TypeScript types, and Python SDK models. Missing display fields remain compatible with existing stored moderation data; the app-server emits absent optional values as `null`.

## Testing

Extend the final-answer moderation test to cover display metadata in answer items and legacy events. Add serialization coverage for missing display data, nullable fields, and preservation of an explicit `false` value.

GitOrigin-RevId: b798a2ecc53c2a94c7659ef3d9663b3143b70a1a
2026-11-07 21:31:08 +00:00
Alex Kira 33b3f80a09 Wire incremental exec tool updates into Code Mode sessions (#60163)
## Why

Changes to nested tools should update the model's catalog without repeating the full `functions.exec` declaration or rewriting retained context.

## What changed

Pass structured exec definitions through the tool router into the session's tool world state. Enable granular updates for Responses Lite in `CodeModeOnly` when both `IncrementalTools` and `IncrementalExecTools` are enabled.

Append changed tool definitions, namespace instructions, and removals as developer messages. Keep common exec instructions and shared types frozen until compaction, then install the latest full catalog.

## Testing

Add feature-gating coverage and a scenario snapshot covering tool additions and removals, namespace instruction changes, eager/deferred transitions, re-enabling tools, retained context, and catalog restoration after compaction.

GitOrigin-RevId: bbf850d4e5018388eeb4c09345d885d776962e09
2026-11-07 19:26:20 +00:00
Alex Kira 2bc8e7f545 Add support for incremental code mode tool definitions (#60157)
## What changed

Render stable entries for nested tool definitions and namespace instructions alongside the full `functions.exec` description. Add optional catalog tracking that emits complete replacements for added or changed entries and explicit notices for removed entries, while keeping the existing exec declaration unchanged.

Preserve entry hashes while exec is unavailable, then restore the full catalog and withdraw removed entries when it returns. Keep the existing snapshot format for ordinary tool catalogs.

This change provides the rendering and state support; runtime activation remains disabled.

## Testing

Add tests for definition rendering and namespace identity, batched additions and changes, removal notices, unchanged catalogs, and full catalog restoration after exec is hidden.

GitOrigin-RevId: f472bd3e8e770a8cad9663c72e290abe7d0473be
2026-11-07 18:24:25 +00:00
Felipe Coury 57e64682f8 Persist local workspace side chats and add tab close controls (#60152)
## What changed

- Save side chats as attachments to their parent conversation when local workspace history supports them, and let users reopen them from the sidebar after a restart.
- Show chat names or first-prompt previews in sidebar labels, and allow saved side chats to be renamed with `/rename`.
- Add tab close buttons, middle-click closing, and the configurable `close_sidebar_tab` shortcut, defaulting to `Ctrl-X W`. Closing a saved chat keeps it available in the picker; archiving removes it from Side chats.
- Confirm actions that stop running work, discard unsent input, or lose temporary history. Delete saved TUI side chats when deleting their parent conversation.

## Testing

Add coverage for reopening saved side chats after restart, archive handling, close confirmations, and preventing close-confirmation keys from accepting a replacement approval dialog.

GitOrigin-RevId: 3d47533d007286a7354660c08df13a83dd48d5d7
2026-11-07 17:31:27 +00:00
tongzhou wang 57a808a392 Preserve code mode dispatch errors in rollout traces (#60122)
## Why

Code mode requests can fail before a `CodeCellStarted` event. Suppressing their dispatch traces loses the caller-facing error in that case.

## What changed

Record dispatch lifecycles for code mode custom payloads, preserving their results independently of code cell events.

## Testing

Update the incompatible-payload regression test to use the code mode tool name and verify that replay retains the failed tool call and result payload even when no code cells were recorded.

GitOrigin-RevId: 687a36cd7ba55665ed7abc88c36732597e7fb025
2026-11-07 12:41:14 +00:00
tongzhou wang 43b4274f3f Buffer payload JSON reads during rollout trace replay (#60118)
GitOrigin-RevId: b0fbc478e19ceda1874d98ea50a39252a2951ed7
2026-11-07 12:32:02 +00:00
cooper-oai cce9d3228b Use runtime authentication for Analytics requests (#60101)
## What changed

- Honor `RuntimeAgentInstances` and the configured runtime auth mode for Analytics plan discovery and report requests to OpenAI endpoints.
- Share installation ID resolution and Codex runtime registration setup through `codex-runtime-agent-instance`.
- Preserve typed runtime authentication errors so expired credentials retain the “Sign in again to load Analytics” guidance.

## Testing

Add coverage for both runtime auth modes across regional and staging endpoints, fresh assertions for each request, sign-in guidance after bootstrap failure, redirect rejection, and invalid organization/project selectors.

GitOrigin-RevId: 50e0d959b3abd81ebe7a6a584e272f14cf52e504
2026-11-07 10:41:36 +00:00
cooper-oai efdacaf46f Stop retrying terminal runtime authentication denials (#60096)
## Why

Invalid assertions and paused or revoked runtime instances cannot recover through request retries or credential refresh. Permanent refresh-token failures also need to retain their sign-in error instead of becoming retryable stream errors.

## What changed

- Recognize terminal runtime denial codes in `401` and `403` response bodies and identity error headers, preserving HTTP diagnostics while stopping retries.
- Skip credential recovery for runtime denials in runtime-enabled model providers and backend requests, while preserving recovery for ordinary credential expiration.
- Propagate permanent refresh-token failures through runtime authentication as `RefreshTokenFailed` errors.

## Testing

Add coverage for body and header denials, preserved HTTP diagnostics, provider-scoped credential recovery, and cached permanent refresh failures. Complete-turn tests verify that runtime denials stop without retries or refreshes while expired credentials recover in both runtime authentication modes.

GitOrigin-RevId: 33f6f707454130e97e13f3b53e29d2c484602152
2026-11-07 09:48:46 +00:00
cooper-oai 4be90eb069 Fetch account security reminders through app-server (#60082)
## Why

Security reminder requests need to use app-server's active authentication and HTTP runtime, with results bound to the login that fetched them.

## What changed

- Add `account/securitySetup/read`, returning an optional notice with account and user IDs, plus generated protocol schemas and bindings.
- Fetch reminders in app-server only for a matching saved ChatGPT login. Return `notice: null` for ineligible, unavailable, or timed-out reads, and discard results when the login changes during the request.
- Route TUI reminder reads through the new method while retaining notice validation and identity checks. Unsupported servers produce no reminder.

## Testing

Add coverage for shared runtime use across restarts, ineligible authentication modes, and login changes during a fetch. Update TUI coverage for unavailable, unsupported, and mismatched notices.

GitOrigin-RevId: 426fee7ce98df17970957c06876881bc5b005196
2026-11-07 08:11:37 +00:00
rhan-oai c4f0e09912 Allow asynchronous model request budget checks (#60080)
## What changed

Make `ModelRequestContributor::budget_exhausted` return an `ExtensionFuture` and await budget checks before HTTP and WebSocket generation. WebSocket warmup continues to skip budget checks.

If the account changes during the post-connect budget check, rebuild the request setup and reconnect before sending the WebSocket request.

## Testing

Update tests to cover a pending budget check that resolves to exhaustion, warmup connection reuse, and an account switch while the post-connect budget check is awaiting completion.

GitOrigin-RevId: 462c74b86a46a4b2276f901c69187fc7cbc3ff81
2026-11-07 07:45:36 +00:00
rhan-oai f5ac7a757e Support asynchronous host service-tier reads and acceptance (#60075)
## What changed

Make `AgentServiceTier` reads asynchronous and have updates return a receipt for local acceptance. Await acceptance during root startup and settings updates outside state and registry locks, sharing the receipt with explicit same-tier retries.

Await shared-tier reads during child preparation, startup prewarm, and step capture. Allow cancellation while capturing a step, and keep host propagation independent of the acceptance wait.

## Testing

Extend the host-child WebSocket test to cover delayed acceptance, same-tier retries without duplicate updates, accessible settings while acceptance is pending, and tier inheritance during prewarm and subsequent steps.

GitOrigin-RevId: 0e2e1899834c37684e904c4a36e66344a0c6c7f3
2026-11-07 06:51:10 +00:00
cooper-oai f4275a2a2e Use runtime authentication for remote-control requests (#60073)
## Why

Remote-control enrollment, refresh, and client-management requests used ChatGPT bearer authentication without resolving the configured runtime authentication mode.

## What changed

Pass the app server's runtime auth slot and mode into remote control, and resolve authentication and HTTP client policy for each request. Supported OpenAI destinations use fresh runtime assertions in `dual_header` or `assertion_only` mode, while custom destinations retain bearer authentication.

Wait for runtime authentication to initialize and reject unsupported OpenAI origins or mismatched registered accounts. Pairing continues to use its server token.

## Testing

Add transport and app-server integration coverage for both runtime auth modes, fresh assertions, shared runtime registration, network policy enforcement, account validation, redirect credential handling, and pairing token preservation.

GitOrigin-RevId: 5401cf565630ab84eaba71ff6040ac27f7b92461
2026-11-07 06:32:12 +00:00
Felipe Coury 0ed34eb9ce Ensure side-chat policy reaches the first model request (#60067)
## Why

An inherited turn can suppress a fork's configured developer instructions, leaving the first side-chat request without its developer policy.

## What changed

- Move shared side-conversation instructions and the history boundary into `codex-context-fragments`.
- Inject the developer policy before the user-role boundary when creating a TUI side-chat fork, while retaining the configured instructions.
- Distinguish attached and temporary policies, applying the worktree restriction only to temporary side chats.
- Add guidance to set up recurring monitors in the main chat or a new chat because temporary side chats cannot run scheduled updates.

## Testing

Add a TUI integration test that checks the first side-chat model request contains the policy and boundary. Add a core request-history snapshot covering an attached side chat that preserves inherited context, policy, and its prior answer after resuming from disk.

GitOrigin-RevId: 889cb317dc3327457cd9ef0879ec9f77dbfaeeba
2026-11-07 05:59:44 +00:00
cooper-oai 1c414e0d65 Use thread runtime auth for Guardian Decisions and memory quota checks (#60064)
## Why

Guardian Decisions requests used bearer keys directly, bypassing runtime authentication. Memory startup quota checks used the app-level auth manager instead of the thread's provider auth context.

## What changed

- Bind Decisions credentials to runtime authentication and use route-aware HTTP clients with sensitive header protection. Preserve workload identity credentials, reuse the saved-login runtime binding, and isolate explicit API key bindings.
- Select the staging Decisions endpoint when the ChatGPT environment is staging.
- Use the thread's `ProviderAuthContext` for memory startup and quota checks, preserving account-bound network policy and applying runtime authentication.
- Keep custom destinations independent of runtime assertions.

## Testing

Add regression tests for dual-header and assertion-only authentication, fresh Decisions assertions, saved versus explicit credential isolation, workload identity, staging routing, redirect header protection, and memory quota authentication with custom destinations.

GitOrigin-RevId: 27bc7821a1cad1f5d1d2a71680527ea91ace95db
2026-11-07 05:50:00 +00:00
Benjamin Carlsson e6bf88ae02 Support Cloud image messages and editable draft handoffs (#60061)
## Why

Cloud messages previously accepted only plain text, and switching a draft to Cloud waited for session preparation without processing composer input.

## What changed

- Support ordered text and image parts in Cloud submissions and user-message summaries, preserving attachment placeholders, image detail, and client message IDs.
- Accept inline data URLs and uploaded file IDs, including image-only messages. Reject invalid references and text spans locally, and cap encoded image requests at 3.75 MiB while retaining the existing plain-text limit.
- Keep the composer editable and redraw the TUI while Cloud prepares a conversation. Carry the latest draft, attachments, and Vim mode into the destination, retain drafts on failure, and prevent submission to the outgoing session during the handoff.
- Preserve buffered paste input and pending clipboard reads across the handoff, with connection and failure hints.

## Testing

Add regression coverage for image wire encoding, receipt identity, validation and size boundaries, draft editing during successful and failed handoffs, clipboard completion, Vim state, and attachment recovery after rejected submissions.

GitOrigin-RevId: 0cbcde0ab89ba961780b5f88456057e6b6a19cd5
2026-11-07 04:48:30 +00:00
cooper-oai d4a341bd52 Reauthenticate runtime requests before reusing WebSocket access (#60055)
## Why

An open WebSocket can remain usable after its runtime is paused. Runtime-authenticated requests need a fresh handshake to revalidate access before submitting more work.

## What changed

- Reconnect before each runtime-authenticated Responses request and skip speculative preconnection. Preserve turn routing when the runtime identity is unchanged.
- Open a fresh connection for each runtime-authenticated Guardian classification instead of prewarming or reusing pooled sockets.
- Preserve HTTP fallback for unsupported upgrades and connection failures, while propagating authentication, authorization, rate-limit, and policy errors.

## Testing

Add regression coverage for pause and unpause behavior, credential changes, fresh assertions, and Guardian HTTP and WebSocket transports in both runtime authentication modes.

GitOrigin-RevId: 9f650147260da5cbbf5bb23dfff0af095fff3955
2026-11-07 04:06:26 +00:00
evanz-oai 44ccf39457 Preserve model catalogs when starting child agents (#60049)
## Why

Child startup can lose remote model capabilities such as `tool_search` when the selected catalog is uninitialized or disk data is older than the parent's in-memory snapshot.

## What changed

- Initialize the final provider, auth, and originator catalog before resolving a child's startup model, then read it from memory.
- Preserve loaded catalogs, including empty responses and updates that failed to persist, without overwriting concurrent refreshes.
- Reuse catalogs across retry and WebSocket transport overrides while retaining routing and header distinctions.

## Testing

Add regression coverage for child tool search with warm, cold, and disabled caches; failed cache writes; concurrent refreshes; empty catalogs; and Guardian reviewer catalog reuse.

GitOrigin-RevId: 01d995a65b623cc7d6f26e2dc9b6e8cf380de782
2026-11-07 03:16:52 +00:00
karenwong-openai 358e464528 Allow plugin starter prompts up to 512 characters (#60048)
## What changed

Raise the per-entry limit for plugin `interface.defaultPrompt` from 128 to 512 characters, retaining the maximum of three prompts. Update the protocol documentation and generated schemas and bindings to reflect the new limit.

## Testing

Update manifest coverage to accept a 512-character Unicode prompt and reject an over-limit prompt. Adjust the discovery warning test to use a 513-character prompt.

GitOrigin-RevId: 0ba3ceb253edf22a583f774492934b7c9b5ac231
2026-11-07 03:08:46 +00:00
viyatb-oai b7d2321ef7 Derive MCP network policy and preserve saved denials (#60046)
## Why

Stale saved grants or malformed rules can cause valid network denials to be discarded. A failed rule write can also leave the in-memory policy inconsistent with native enforcement.

## What changed

- Add a helper to derive MCP network policy from controller and environment policies, permission profiles, approval settings, and saved rules. Preserve managed restrictions and conservatively deny traffic that requires review, request hooks, or DNS checks the metadata cannot express.
- Retain valid saved denials when grants violate managed constraints or a rule batch is malformed.
- Serialize runtime updates and persistence, publishing denials before the write so they remain effective if saving fails. Publish saved grants after a successful write.
- Extract validation of listener settings for running proxy updates.

## Testing

Add coverage for policy composition, mixed-executor local binding, native proxy denial parity, stale grants, malformed denials, failed persistence, and compatibility with trusted MCP servers without policy negotiation support.

GitOrigin-RevId: ef00632acb48a51fc582f18d20a3e713f953a191
2026-11-07 03:06:33 +00:00
viyatb-oai a90c808408 Centralize Windows sandbox filesystem override resolution (#60042)
Add `WindowsSandboxFilesystemOverrides::resolve` to select the elevated or
restricted-token resolver, and use it in core, exec-server, and direct-spawn
sandbox preparation. Pass the child environment through to the elevated
resolver.

Replace the exported unsupported-sandbox reason helper with a test-local
wrapper around the shared resolver.

GitOrigin-RevId: f1d404356a4f680ce81123bc8284508f27d4d6ab
2026-11-07 02:46:41 +00:00
Eric Traut 11ca3f7531 Require explicit project trust in non-interactive runs (#60041)
## What changed

Keep untrusted project configuration and MCP servers disabled in exec runs, even with `--sandbox workspace-write`, and warn when project configuration is disabled.

Add `--trust` to `codex exec` and `codex review` to save project trust for the current and future chats, including MCP commands outside the sandbox. The grant persists with `--ephemeral`, refuses explicitly untrusted projects, and cannot be combined with `--ignore-user-config`.

Pass the working directory as a configuration default so embedded server startup does not implicitly grant trust. Preserve the selected `--oss` provider across configuration reloads.

## Testing

Extend CLI parsing and MCP integration coverage for explicit trust, persistence across ephemeral runs, disabled project configuration with write access, and rejection of conflicting or explicitly untrusted settings.

GitOrigin-RevId: b57f4f8829f98d77c5487fa8405c7f29b5d70d0c
2026-11-07 02:39:03 +00:00
Alex Kira 762f87d5bb Restrict legacy incremental tools to Amazon Bedrock providers (#60040)
## What changed

Gate `incremental_tools_legacy` on the `amazon-bedrock` and
`amazon-bedrock-runtime` provider IDs instead of the OpenAI provider for regular
Responses requests. Responses Lite continues to use `incremental_tools`.

## Testing

Expand the tool catalog update scenarios to cover both Bedrock provider IDs with
legacy incremental tools enabled and disabled. Update the regular Responses tool
removal scenario to use the Bedrock provider.

GitOrigin-RevId: ad0ff31975166a2a7fdcee6fefc272ecc79dd448
2026-11-07 02:37:50 +00:00
Charlie Marsh af9a98b074 Add opt-in lazy startup for cached stdio MCP servers (#60039)
## Why

Regular chats start MCP servers eagerly even when cached tool definitions are available and the servers go unused. Allow those chats to use the cached catalog and defer eligible stdio servers until first use.

## What changed

- Add the disabled-by-default `mcp_lazy_stdio_startup` feature and expose it through experimental feature configuration.
- Defer cached stdio servers in regular chats when enabled, while keeping servers that require a live startup connection eager. Required servers with `startup_readiness = "catalog"` may defer; explicit reconnects remain eager.
- Announce the full eager startup batch before terminal statuses and exclude dormant servers from the initial startup summary. Update TUI tracking so deferred servers can report startup independently in later rounds.

## Testing

Add scenario coverage for a cached server staying dormant during unrelated work, starting on first use, and refreshing tool definitions and visibility. Cover required live startup, eager event ordering, experimental feature configuration, and TUI status handling.

GitOrigin-RevId: 74075fcd4f26c8c79b5901b6a8cb03fdb9e35a7f
2026-11-07 02:28:44 +00:00
Charlie Marsh fb2b06a829 Surface MCP server startup errors when preparing cached tool calls (#60038)
## Why

A cached MCP tool can remain advertised after its server fails to start. Calling it previously returned a generic unavailable-tool error, hiding the startup failure from the model.

## What changed

Propagate preparation errors through MCP tool calls and recorded approval preparation, preserving the error chain and adding the server name to startup failures. Keep the unavailable-tool error for tools that are missing, filtered, or no longer visible to the model.

## Testing

Update the executor capability downgrade test to require the credential resolution startup error in the model's tool output and assert that the host token is absent.

GitOrigin-RevId: 434074eb748165b2fe19de3a40046835f26992df
2026-11-07 02:28:22 +00:00
Charlie Marsh 7ccf78dec4 Preserve MCP sharing discovery when deferring cached stdio startup (#60037)
## Why

Subagents reusing cached MCP tool definitions were forced to use the legacy protocol, preventing connection sharing from being negotiated on first use.

## What changed

Keep stdio protocol discovery enabled during deferred startup while allowing dormant subagents to advertise cached legacy tools. Track modern discovery separately from catalog updates so discovery clients reject older legacy catalogs while legacy clients can still reuse them. Keep modern tools out of the legacy catalog when joining pooled connections.

## Testing

Add coverage for deferred subagents negotiating sharing on first use and reusing the same server process, while a legacy sibling retains cached definitions without starting its server. Extend cache coverage to ensure older legacy fetches cannot undo modern discovery.

GitOrigin-RevId: 5f8f4deb22cfb81a08c05ff3fcd7ba5c9199551c
2026-11-07 02:26:13 +00:00
cooper-oai 0c58612c3c Fix authentication for git-attribution settings requests (#60035)
## Why

Git-attribution settings requests need to honor runtime authentication for their destination. Repeated authorization failures after a credential refresh must also let world-state contribution finish.

## What changed

- Use the thread's `ProviderAuthContext` credentials and runtime authentication when available.
- Bind the settings client's network policy to the authenticated account and select authentication through the runtime-aware backend client.
- Stop policy resolution after an unsuccessful settings lookup or timeout instead of restarting it when credentials changed during recovery.

## Testing

Add app-server coverage for `dual_header` and `assertion_only` authentication with default and custom destinations, including attribution instructions in model input. Add a regression test verifying that repeated `401` responses trigger only one credential refresh and omit attribution instructions.

GitOrigin-RevId: 4824bde7d9ec11c241f1caebc754d203dbb0480c
2026-11-07 02:09:31 +00:00
Eric Traut 738ef9f3bb Omit sensitive process inputs from spawn trace logs (#60034)
## Why

Command arguments and environment variables can contain credentials. Logging them when spawning a child process can expose those credentials in trace output.

## What changed

Replace argument, `arg0`, and environment contents in `spawn_child_async` trace logs with argument and environment counts and a flag indicating whether `arg0` is overridden. Keep the program, working directory, network sandbox policy, and stdio policy in the trace.

## Testing

Add a regression test that captures trace output and verifies that argument, `arg0`, and environment canaries are omitted while the program path remains visible.

GitOrigin-RevId: c317e7dcc6fd8b4eafb6fcfe98dc8634807c813d
2026-11-07 02:01:23 +00:00
Joe Savona cfc11eb483 Allow extension status content to use multiple footer rows (#60032)
## Why

Extension status content was limited to one row, clipping multiline text and content that wraps at narrow terminal widths.

## What changed

Measure extension status content at the available width and reserve up to four rows in both shared and separate status layouts. Account for mode indicators and warnings, and remeasure when content or available width changes.

Extra status rows yield to the draft and other composer surfaces when vertical space is limited. An unfocused composer keeps a single dim status row.

## Testing

Add regression coverage for resizing, wrapping beside mode indicators and warnings, hyperlink preservation, limited vertical space, cursor placement, footer overrides, focus changes, theme updates, and reasoning effort changes.

GitOrigin-RevId: 6a637b5cf6f34684639a92d920da4795c90abb6f
2026-11-07 02:01:00 +00:00
Joe Savona 5c7a1602c8 Unify TUI status line layout for extension content (#60031)
## What changed

- Use the same status renderer for shared footer rows and separate status lines, allocating extension content the width left by the mode indicator.
- Measure extension content with `measure_natural()` instead of rendering it at maximum width.
- Skip reasoning effort status transitions for extension content and clear an active transition when extension content replaces the status line.

## Testing

Add regression coverage for matching shared and separate layouts across terminal resizing, natural width measurement, viewport clipping with hyperlinks, and skipping effort transitions when switching between native and extension content.

GitOrigin-RevId: 4ffc52ec6374f3c2b4995c0472bee25aa15ae7a0
2026-11-07 01:59:44 +00:00
Joe Savona 7cdb219883 Render UI trees directly into terminal buffers (#60029)
## What changed

Use a shared layout traversal to measure prepared UI trees and paint text directly into terminal buffers. Add natural and viewport-constrained size measurement, and use direct rendering for extension footer content.

Preserve wrapping, styles, and terminal hyperlinks while clipping at grapheme boundaries and leaving overflow ellipses unlinked.

## Testing

Add coverage for size measurement in terminal cells, wide characters at clipping boundaries, and zero-width text around overflow ellipses. Update rendering tests to check painted buffer contents and hyperlinks.

GitOrigin-RevId: 828c45d3400f9e3dfce9a7bd812d1cc0ea51642f
2026-11-07 01:52:20 +00:00
Joe Savona f8df49a196 Reuse prepared UI trees for footer rendering (#60028)
## Why

Footer width measurement and rendering each prepared the same UI tree again.

## What changed

- Prepare footer extension content once and share the owned `PreparedUiTree` through `Arc`.
- Resolve colors against the active theme at render time, caching each color resolution within a render pass.
- Share leaf text buffers across prepared chunks instead of copying their slices.

## Testing

Add a test verifying that chunks from a clean text leaf retain slices of the original buffer. Update existing UI tree rendering tests to use the owned prepared representation.

GitOrigin-RevId: daba035c291338f3e0036e9ad4f2fd26f56a3910
2026-11-07 01:51:55 +00:00
Joe Savona 66a56b17a1 Keep configured status lines on the native renderer (#60027)
## Why

Enabling `tui_extensions_status_line` routed configured status lines through a plain-text extension renderer and hid the “Use theme colors” option in the status line picker.

## What changed

Always use the native status line renderer for configured items and their live picker previews, preserving theme colors and pull request links regardless of the extensions flag. Always expose the theme color option in the picker, and clarify that the flag enables experimental MCP status line providers.

## Testing

Update coverage to require native status line content across extensions flag changes and exercise the live picker preview with the flag enabled. Retain checks for pull request hyperlinks and color preference preservation.

GitOrigin-RevId: bce7df5696c2bd3583d3ef99c43e7a2014e17294
2026-11-07 01:51:31 +00:00
Joe Savona 8e7ccd8472 Add multiline layout and row wrapping to UI trees (#60026)
## What changed

Render prepared UI trees within a viewport's width and height, preserving authored line breaks and wrapping text while retaining styles and hyperlink ranges.

- Add `wrap: "wrap"` for rows to move children onto additional lines; keep `nowrap` as the default.
- Allocate space to row children while reserving later siblings' minimum widths.
- Mark horizontal clipping and vertical overflow with an unlinked ellipsis, including in single-line rendering.
- Respect word hyphens across style boundaries and nonbreaking spaces when wrapping.

## Testing

Add regression tests for nested row wrapping, sibling width allocation, hyperlink offsets and clipping, and word boundaries. Add a buffer snapshot covering authored line breaks, collapsed whitespace, styles, and links.

GitOrigin-RevId: fdfbdee92808c0a8f55e2fdf11db95d68a76d9a5
2026-11-07 01:49:05 +00:00
Joe Savona d749ee847f Separate UI tree preparation from line rendering (#60022)
## What changed

Add `UiTree::prepare` and `PreparedUiTree` to prepare styled inline text and row structure independently of viewport width. Compute minimum and preferred widths for text and nested rows, including gaps, and retain authored line breaks when filtering zero-width children.

Render the first line from the prepared tree while retaining overflow ellipses and hyperlink clipping.

## Testing

Add a preparation test covering row width measurements across styled text, nested rows, gaps, empty children, combining marks, and non-breaking spaces.

GitOrigin-RevId: 5f63366c0568a01cb55686d9f14c1b3fac90946f
2026-11-07 01:38:08 +00:00
Joe Savona 1a20f53c33 Normalize inline UI tree text across styled leaves (#60021)
## What changed

- Collapse spaces and tabs across inline leaves, trim leading and trailing whitespace, and keep rendering limited to the first line.
- Prepare Unicode line-break opportunities across style boundaries and join graphemes split across leaves. Use the first fragment's style and retain a hyperlink only when all fragments share its destination.
- Preserve row boundaries and explicit gaps, and use row gaps for status-line separators.
- Prevent zero-width fragments from adding row gaps or changing the ellipsis style.

## Testing

Add regression tests for whitespace collapse, split graphemes, hyperlink ownership, zero-width fragments, and line-break consistency between styled runs and contiguous text.

GitOrigin-RevId: 94e58808bc8469e9cd0adddb16c194b9568cfbb6
2026-11-07 01:37:46 +00:00
Joe Savona 7e980a54fe Strip terminal commands from UI tree strings (#60020)
## Why

The UI tree renderer's CSI-only sanitizer leaves OSC command contents visible in rendered text, including embedded hyperlink URLs.

## What changed

Use `vtparse` to sanitize each string independently, retaining printable text, tabs, and newlines while discarding terminal commands and other control characters. Preserve the existing text limit, first-line rendering, and tab expansion.

## Testing

Add a regression test covering color escapes, carriage returns, OSC hyperlinks, and an incomplete escape sequence before a structured link. Assert the rendered text and the structured link's hyperlink range.

GitOrigin-RevId: 51899f62d10f6a1321f96278616fe7a51bad17d9
2026-11-07 01:37:23 +00:00
Joe Savona 2157f98648 Add theme-aware semantic colors to extension UI trees (#60019)
## Why

Extension UI trees previously accepted only named terminal colors and literal RGB values. Semantic colors let extension content follow the active syntax theme and terminal color capabilities.

## What changed

- Accept `primary`, `surface`, `accent`, and `status-*` color roles for text foregrounds and row backgrounds.
- Resolve semantic colors against the active theme when rendering extension footer content. Prefer the `codex.accent` scope for `accent`, falling back to the theme's accent setting.
- Reuse status-line scope mappings and fallback colors, with terminal-default fallbacks for unavailable primary, surface, and accent colors.

## Testing

Add color serialization coverage and rendering snapshots for dark, light, and empty themes in truecolor and ANSI 16-color terminals, including nested foreground and background styles.

GitOrigin-RevId: 156f137859d74178f9ae6aa46a02eecb815e9802
2026-11-07 01:36:15 +00:00
Chris Dong 5ff78c5e66 Propagate turn triggers to usage analytics events (#60018)
## What changed

Include `turn_trigger` from turn metadata in tool, artifact, skill, app, plugin usage, and hook analytics events. Omit the field when no trigger is available.

## Testing

Extend app serialization and reducer tests to check trigger propagation, and verify that MCP tool events retain the trigger after turn completion.

GitOrigin-RevId: 975780983d0761eb34fecf5e8b4abe98a432d0c3
2026-11-07 01:25:00 +00:00
felixxia-oai 2f742f5885 Disable bundled skills in the prompt-prefix comparison test (#60017)
GitOrigin-RevId: d2a606620debc2ed043215b79f672d0d85acf2f1
2026-11-07 00:54:03 +00:00
cooper-oai 10cf2b9ea2 Honor managed runtime authentication modes and expand coverage (#60014)
## What changed

Allow `requirements.toml` to pin `features.runtime_agent_instances.mode` to `dual_header` or `assertion_only`. Apply the required mode when no explicit mode is configured and reject conflicting explicit settings, while preserving legacy boolean requirements.

Document experimental runtime authentication configuration, credential lifecycle, and bootstrap authentication behavior.

## Testing

Add coverage for managed mode defaults and conflicts, runtime reuse and rotation across account requests and restarts, fresh assertions on Realtime and MCP reconnects, and Realtime destination and environment restrictions.

GitOrigin-RevId: bcf9502178f477c1e8232386f1f3e360bf23d667
2026-11-07 00:18:36 +00:00
rhan-oai e0aa0434f4 Adapt multi-agent mode guidance for hosted tools (#60011)
## What changed

- When `multi_agent_v2.disable_native_tools` is enabled, use bundled mode policies instead of model catalog guidance, while preserving explicitly configured mode hints.
- Refer to multi-agent tools and instruct the model to read the full multi-agent skill before calling them. Keep proactive delegation enabled for `Ultra` reasoning and explicit-request-only delegation for other reasoning levels.
- Reset retained nonempty custom mode hints to explicit-request-only guidance when multi-agent support is disabled, including after a cold resume.

## Testing

Extend integration tests and request snapshots to cover hosted-tool guidance, configured hint precedence, proactive mode with `Ultra` reasoning, and the mode reset after a cold resume.

GitOrigin-RevId: 403791ef76f990e385d9c155d9c2edc9acfcd4fe
2026-11-06 23:50:54 +00:00
Dmitriy Kovalenko a5a00d6c73 Add a shared Windows Bazel setup action (#60010)
## What changed

Add `.github/actions/setup-bazel-windows` to prepare MSVC, derive the Bazel Windows path, download the pinned Cygwin snapshot, and run the existing verified Windows dependency bootstrap. Export the Windows system root and host architecture for subsequent steps.

Use the action in the Bazel workflow and argument-comment lint action. Remove an unused `EnvironmentAttachment` import from the session tests.

GitOrigin-RevId: 8dc711dc9301bb44d49be3fdab79bd4ca981b7d0
2026-11-06 23:48:38 +00:00
alexsong-oai 2497eab251 Add custom gateway selection to TUI sign-in (#60009)
## What changed

- Add the disabled-by-default `gateway_setup_wizard` feature to let users choose a saved custom gateway during eligible local sign-in onboarding.
- Save the selection as `model_provider`, restart the embedded app server with that provider, and complete required primary authentication and gateway OAuth before starting the first chat.
- Show gateway loading and configuration errors, browser sign-in links, and an OAuth retry action. Respect provider policy and launch overrides.

## Testing

Add coverage for onboarding eligibility, saved gateway selection and persistence, and gateway error and OAuth screens. Add a terminal integration test verifying that the selected gateway receives the first chat with authentication.

GitOrigin-RevId: 92bd2da3abd28d6c2274c91b2d7561bf359f0ca0
2026-11-06 23:35:54 +00:00
Benjamin Carlsson 0389e80f07 Refactor TUI clipboard and composer input handling (#60008)
## What changed

- Extract helpers for image paste shortcuts, paste-burst ticks, restricted draft edits, and composer activity detection.
- Thread `ShellPrefixHandling` through text insertion and pending-input flushing.
- Return a configuration rebuild future that does not borrow the app or base configuration.

## Testing

Add a regression test covering image paste while `!` is buffered: Enter preserves the draft during the paste burst, and subsequent submission includes the image and literal `!` without running a shell command.

GitOrigin-RevId: fb9a3c8a70aed524c65022f2c0910ce2ad11d4d2
2026-11-06 23:24:15 +00:00
Benjamin Carlsson 7de8a0afc0 Start cloud threads with the local GitHub project (#60007)
## What changed

Pass the local project's GitHub origin to cloud prewarming so new cloud threads can provision a repository checkout. Preserve the attached local project when switching backends and resolve its origin for each thread start.

Normalize supported GitHub origins to credential-free HTTPS URLs and select a repository-specific cloud working directory. Unsupported origins retain the blank environment behavior. Keep project metadata outside the app-server wire protocol, and fix HTTP Git URL parsing so query strings and fragments cannot be mistaken for authority text.

## Testing

Add coverage for project routing, origin normalization and rejection, managed environment encoding, local project retention, and Git URL credential stripping.

GitOrigin-RevId: 5859769965faf060461ccc1cbb3fd48f8e2f2155
2026-11-06 23:00:38 +00:00
JonLuca De Caro df769889c0 Reduce SQLite write overhead for thread activity and history (#60006)
## Why

Token-usage observations previously required full metadata writes. Concurrent history writers could also occupy pool connections while waiting for SQLite's single writer.

## What changed

- Update only timestamps and token totals for eligible activity patches, preserving concurrent metadata edits. Retain metadata repair for missing rows, changed sources, missing spawn edges, history promotion, and preview backfill.
- Serialize local history writes before acquiring transaction connections so readers can use the remaining pool connections.
- Use `ROWS UNBOUNDED PRECEDING` for cumulative log-byte limits so SQLite can compute byte and row limits in one pass.

## Testing

Add coverage for token updates preserving concurrent edits, clamping negative totals, and rejecting stale source or missing spawn metadata. Extend metadata repair tests across legacy and paginated history modes to cover token updates, preview backfill, and spawn-edge repair.

GitOrigin-RevId: 4a30fd42a7498c616ed13adb46fc3d7e0226a94d
2026-11-06 22:45:37 +00:00
dand-oai 01ab354312 Expose ChatGPT user IDs in account/read responses (#60004)
## What changed

Add a nullable `userId` to `GetAccountResponse`, populated from the same authenticated account snapshot as the rest of the response. ChatGPT and personal access token sessions return the canonical ChatGPT user ID when available; API-only and signed-out sessions return `null`.

Update the cloud client, generated schemas, TypeScript and Python types, and account identity documentation. Default missing IDs to `None` when deserializing responses from older app servers.

## Testing

Extend account response tests to check ChatGPT and personal access token user IDs, null IDs for other providers and signed-out sessions, and ID changes when switching providers with saved ChatGPT credentials.

GitOrigin-RevId: 7ad3da3cfc835c4d08d03c8e91b06cd7e007d874
2026-11-06 22:27:47 +00:00
cooper-oai 44f1b0e867 Apply runtime authentication to realtime connections (#60003)
## Why

Realtime connections bypassed runtime authentication and reused captured authentication headers for sideband handshakes. They need to honor the selected credential source and its transport policy across call creation, retries, and reconnects.

## What changed

- Use runtime authentication for realtime WebSocket connections, WebRTC call creation, and sideband attachment when enabled for supported OpenAI destinations.
- Resolve authentication on every WebSocket handshake, preserving credential ownership and request scope while generating fresh assertions. Reject authentication failures without falling back to bearer authentication.
- Keep call creation and sideband attachment bound to the selected credentials and account network policy, including when inference uses a different provider.
- Avoid runtime initialization for local marketplace and MCP operations, plugin commands that do not use the remote catalog, and model debugging with a configured catalog.

## Testing

Add coverage for fresh handshake credentials on retries and reconnects, credential and account changes, runtime authentication modes, destination validation, and registration failures.

GitOrigin-RevId: 57e53122912fa78a524427b0f51013f76f9f7681
2026-11-06 22:27:23 +00:00
felixxia-oai 09bd19a0de Decouple Guardian retrieval from local message-board handles (#60002)
## Why

Guardian's retrieval, channel selection, and evidence delivery depend on concrete local message-board types. Expose the required operations through shared interfaces so these consumers can use trait-based board handles.

## What changed

- Introduce `BoardReadView` for captured catalogs and post boundaries, with read operations and JSON search configuration but no mutation methods.
- Extend `AgentMessageBoard` with namespace identification, read-view capture, and channel subscription operations, and implement them for the local board.
- Add `message_board_read_tools` to bind the five read-only tools to a captured view.
- Migrate Guardian consumers to `AgentMessageBoard` and `BoardReadView`, retaining Guardian namespace checks and captured read boundaries.

## Testing

Adapt read-view and Guardian retrieval tests to the trait interfaces. Add assertions for the five retrieval tools and rejection of ordinary boards by retrieval binding, subscription capture, and delivery planning.

GitOrigin-RevId: f8c5bc65d8297f6df6e3b02d6c09006bcaea4b1a
2026-11-06 22:26:03 +00:00
felixxia-oai ecef7e0936 Add bounded original-evidence delivery for Guardian reviewers (#60001)
## What changed

Add `DeliveryPlan::deliver` to supply selected originals as `guardian_original_evidence` context in source order. Read whole posts one board page at a time and batch them within the model's tool-output budget, rejecting originals that cannot fit intact.

Record delivered ordinals only after the admission callback succeeds, and advance channel positions when the plan completes. Preserve successful admissions across partial plans so retries and overlapping channel selections do not duplicate evidence.

Add `LocalBoardReadView::read_post_texts` to retrieve posts in the requested order while enforcing the captured board boundary.

## Testing

Add retrieval tests covering ordered delivery into a retained conversation without starting inference, deduplication, failed admission, oversized-original retries, older evidence from newly selected channels, captured-view boundaries, and paged reads.

GitOrigin-RevId: b2f03e039c6677e0b94dceaa7ed75a966edf81eb
2026-11-06 22:11:16 +00:00
felixxia-oai 5f82dc9e59 Plan Guardian evidence delivery in source order (#60000)
## What changed

Add `DeliveryState` to plan unique evidence originals from selected Guardian board channels in source order. Read request IDs in pages by insertion sequence within a captured board view, and reject evidence beyond the review's source-history cutoff.

Share evidence request-ID encoding between the housekeeper and delivery planner, and expose the source cutoff on `EvidenceSnapshot`.

## Testing

Add retrieval tests covering deduplication across channels, source ordering across storage pages, exclusion of unselected channels and posts appended after capture, and rejection of evidence beyond the source cutoff.

GitOrigin-RevId: fc181a52b46137538bb94a5bba1c1d6bf1bccf32
2026-11-06 22:10:52 +00:00
felixxia-oai af83299ada Add model-driven Guardian channel selection (#59999)
## What changed

Add `ReviewerSubscriptions::prepare` to select evidence channels using the review task, current subscriptions, and captured catalog. Validate unique channel names before atomically replacing the caller's subscriptions within that catalog, preserving subscriptions to channels outside it.

Share typed sampling between selection and housekeeper routing, enforce input byte budgets, and expose `OperationResult` so callers can honor runtime reuse or rollback requirements. Selection observes cancellation and deadlines before saving membership.

## Testing

Add integration coverage for subscription replacement, caller isolation, preservation of later channels, cancellation before sampling, and rejection of selections outside the captured catalog with a rollback disposition.

GitOrigin-RevId: fcab0de88ac862e21cdf3c780c780385e2543604
2026-11-06 22:10:28 +00:00
felixxia-oai eb485f57ba Add atomic bulk channel subscription updates (#59998)
## What changed

Add `LocalAgentMessageBoard::set_subscriptions` to apply a caller's subscribe and unsubscribe choices for multiple channels in one transaction. Validate all supplied channels before applying changes, and preserve subscriptions for other channels, threads, and agents.

Allow this self-only operation on read-only live connections, reject fixed views, and emit no notifications. Share subscription and opt-out updates with the existing single-subscription API.

## Testing

Add coverage for bulk updates through a read-only connection, atomic failure when a channel is missing, preservation of other channels and agents, and the absence of notifications.

GitOrigin-RevId: 83ed587f9c5deaa3e9de87adb6319f9de0c804b1
2026-11-06 22:09:04 +00:00
felixxia-oai 8d0098930e Add subscription tools for Guardian reviewers (#59995)
## What changed

Add `ReviewerSubscriptions` to capture a Guardian catalog and expose self-only `subscribe` and `unsubscribe` tools. Restrict requests to channels in that catalog and return captured post IDs so later evidence stays outside the review boundary. Read current membership from storage and filter it through the captured catalog.

Share message-board tool size limits and query the latest channel post directly when updating subscriptions.

## Testing

Add coverage for caller-only subscription changes, rejection of later channels and explicit agent targets, captured post IDs, and unchanged subscriptions for other agents. Extend message-board tests to check unsubscribe post IDs and reject missing channels.

GitOrigin-RevId: 48bf4270d6079f7e436096175c67bb211ccbc248
2026-11-06 21:55:20 +00:00
felixxia-oai e4bd7871b1 Add read-only evidence retrieval tools for Guardian reviewers (#59994)
## What changed

- Expose `guardian_board` tools to list channels and threads, search posts, and read evidence through a captured read-only view. Require a Guardian storage namespace and keep reads within the review's fixed cutoff, including searches across unsubscribed channels.
- Support literal, case-insensitive searches over decoded JSON fields and nested function-call arguments so quotes, Windows paths, and Unicode escapes do not hide matching evidence.
- Strip response-envelope harness metadata from captured evidence except for `user_input_order`, preserving message payloads and source ordering.

## Testing

Add retrieval coverage for unsubscribed channels, fixed cutoffs, and escaped JSON searches. Update evidence tests to verify serialized payloads retain source order while excluding other harness metadata.

GitOrigin-RevId: 3128e4a2d59d1f71f2cce0bc6b1fbdf7e2aba287
2026-11-06 21:54:55 +00:00
felixxia-oai 632eee03e9 Add fixed read views for local message boards (#59993)
## Why

Concurrent appends can shift live results between pages. Readers need a fixed catalog and post boundary to browse without including later activity.

## What changed

- Add `LocalAgentMessageBoard::read_view` and export `LocalBoardReadView`, exposing the captured channel catalog and a read-only board handle.
- Freeze channel summaries and apply a post sequence cutoff to searches, thread listings, reply summaries, and individual reads. Later appends are excluded even when backdated.
- Reject all mutations through fixed views, including subscription changes, while preserving live handle behavior.

Views share SQLite storage without holding a transaction open. They do not retain deleted posts.

## Testing

Add integration coverage for frozen catalogs and paginated reads, exclusion of newer and backdated appends, mutation denial, and continued live updates.

GitOrigin-RevId: d32cd4989d07040891fa5d38f6ee91fa1960d0d6
2026-11-06 21:54:28 +00:00
fahad-OAI 8fcabd75a0 Preserve app invocation context across MCP tool refreshes (#59991)
## What changed

Keep the advertised `_codex_apps.invocation_context` when an app's tool metadata refreshes on the same server connection, while using refreshed values for other metadata. If the invocation context changes on a different connection, skip the call as unavailable.

## Testing

Extend the code-mode compaction test to refresh app tools before resuming a cell and verify that calls retain the original invocation context while picking up the refreshed `resource_uri`.

GitOrigin-RevId: 1b6072faed74623994ea82035a6ed977451984a4
2026-11-06 21:53:04 +00:00
Joe Savona 1a2f5babe8 Add inherited styling to TUI display trees (#59988)
## What changed

Support `bold`, `italic`, and `underline` nodes, plus text properties for color, weight, italics, and underlining. Nested text can override inherited styles, including disabling modifiers.

Add row backgrounds that apply to children and gaps. Text colors and row backgrounds accept the eight standard ANSI color names or `#RRGGBB` values, with RGB colors resolved through the terminal palette. Preserve the last visible span's style on overflow ellipses while keeping them unlinked.

## Testing

Add coverage for style serialization and invalid values, nested modifier depth limits, inherited styles and overrides, row backgrounds, styled truncation, and foreground/background palette resolution, including a rendered buffer snapshot.

GitOrigin-RevId: 6b19b6b740cd754890c8adb489fba414a6ee62d3
2026-11-06 21:36:56 +00:00
Sean Huang cf39544acd Resolve startup models using thread creation options (#59987)
## What changed

Replace `ThreadManager::models_manager_for_startup` with `resolve_startup_model`, which accepts `StartThreadOptions` and returns the selected `ModelInfo` before starting or cold-resuming a thread.

Share model resolution and effective session source selection with thread startup so the lookup honors the same catalog, configuration overrides, and provider fallback setting.

## Testing

Update coverage to compare startup model information with the started thread's selected model, including provider catalog defaults and context window overrides. Add coverage for provider fallback being enabled and disabled.

GitOrigin-RevId: 57040c4afeacc47c7596832271898577a3584c89
2026-11-06 21:34:25 +00:00
Benjamin Carlsson 78b1dda5f6 Render typed prompts as Markdown in the TUI (#59983)
## Why

Typed prompts currently display Markdown syntax literally, including emphasis, lists, and code fences.

## What changed

- Render Markdown in typed prompts while retaining the prompt gutter, background, and hyperlinks.
- Preserve literal rendering for spoken prompts, prompts with inline text elements, and text without visible Markdown formatting.
- Keep the original Markdown when copying a whole prompt, and preserve source text for code block and blockquote copy targets.
- Preserve bold styling when leaving the dim prompt marker and track hyperlink columns incrementally across styled spans.

## Testing

Add regression coverage for prompt rendering at multiple widths, hyperlink positions, terminal bold styling, and copying Markdown source, code blocks, and blockquotes, including original code line endings and fenced tables with table rendering disabled.

GitOrigin-RevId: eda62043ca8a9fe012ea7e0683fe05de6ad1b898
2026-11-06 21:21:15 +00:00
Curtis 'Fjord' Hawthorne 6abffd442d Test rejection of PNGs with readable dimensions but corrupt pixels (#59980)
Add a regression test that corrupts a PNG's compressed pixel data while
preserving readable dimensions. Verify that `load_for_prompt_bytes` returns
`ImageProcessingError::Decode` in `ORIGINAL_DETAIL` mode even when the image
is small enough to pass through without resizing.

GitOrigin-RevId: 92d9239b469d3e3cf4437eb6fecbf7c11d0bcc7a
2026-11-06 21:03:03 +00:00
jif 1be4eb123e Test command completion before network denial grace expires (#59974)
## What changed

Extend remote network approval tests to cover executor-owned proxies. Verify that `exec_command` delivers the process result while a network review is pending, without waiting for the denial grace period.

Freeze Tokio time after command startup and use a real-time timeout to detect delayed results. Share the test setup with the existing controller-owned proxy cases, preserving local-binding policy and process-exit cleanup assertions.

GitOrigin-RevId: f07fe273c16d55305ee088223449def68384c104
2026-11-06 20:36:32 +00:00
Sean Huang 247934cfe5 Enable gRPC and host output truncation by default for Code Mode (#59973)
## What changed

Mark `code_mode_host_grpc` and `code_mode_host_output_truncation` as stable and enable them by default. Code Mode now defaults to gRPC over stdio and truncates output in the host before sending it to Core.

## Testing

Update integration tests to exercise the default configuration and explicit feature opt-outs, covering output budgets, truncation notices, and wait termination. Keep the stdio reconnection test explicitly configured for that transport.

GitOrigin-RevId: 5847a249d698fb9b1ecf4921aca4e6efc501f890
2026-11-06 20:29:09 +00:00
Benjamin Carlsson 8842c09a7f Fix Opus header installation with relative symlink inputs (#59972)
## Why

Opus build inputs can be relative symlinks. CMake can preserve those links during header installation, leaving dangling links in the install prefix.

## What changed

Add and export the `opusic-sys` patch referenced by the Bazel configuration. The patch copies public headers into the CMake build directory and uses those copies for `PUBLIC_HEADER` installation.

GitOrigin-RevId: 03f0e1ab536fdf894dc23a40acc331bf16bcae13
2026-11-06 20:26:49 +00:00
Dmitriy Kovalenko e428b9a16b Reduce contention in thread writer lock coordination (#59969)
## Why

Exclusive coordination serialized writer acquisition across unrelated threads and could delay releasing writer ownership while waiting to remove a lock file.

## What changed

Use shared coordination when opening thread writer locks. Attempt the initial stale-lock sweep only when exclusive coordination is immediately available, and keep rollout publication exclusively coordinated.

When dropping a writer guard, remove its lock file only if exclusive coordination can be acquired immediately. Otherwise, release ownership and leave the file available for reuse or later cleanup.

## Testing

Extend the writer-lock test to cover acquisition for different threads under shared coordination, rejection of competing owners for the same thread, and prompt ownership release and reacquisition when cleanup cannot acquire exclusive coordination.

GitOrigin-RevId: 3e187b32dbef3bcfdd8c62e91eca58b615f3879e
2026-11-06 20:16:15 +00:00
ioanbudea-OAI 2889d8e1bf Normalize turn context permissions to a required profile (#59963)
## What changed

Make `TurnContextItem.permission_profile` required and remove its legacy `sandbox_policy` and `file_system_sandbox_policy` fields. Normalize older histories into a permission profile during deserialization, preserving the restrictive fallback for malformed filesystem rules.

Keep legacy compatibility fields in rollout serialization so older readers remain usable. Update turn recording, metadata extraction, and permission checks to consume the profile directly.

## Testing

Add coverage for legacy normalization, profile-only serialization, missing permissions, and malformed filesystem rules. Extend rollout round-trip fixtures to cover deny rules and filesystem roots from another platform.

GitOrigin-RevId: 27515fec60cccbac5806b98fb71f54e311a09701
2026-11-06 19:29:06 +00:00
jif 4e688da437 Skip the network denial grace period when remote decisions drain (#59960)
## Why

Completed remote commands wait up to 100 ms for late network denials even when all execution-owned network decision callbacks and requests have finished.

## What changed

Allow deferred network approval cleanup to finish as soon as an executor-owned remote proxy's decisions drain. Retain the grace period when a shared listener could still report an untagged denial, including when that listener starts during the command. Always register the blocked-request observer when starting the session proxy.

## Testing

Extend the paused-time regression test to cover immediate completion after remote callbacks drain and propagation of a late denial from a newly registered shared listener.

GitOrigin-RevId: 41bda6504f6d97d5626beba58cf30fb4a9a2dbdd
2026-11-06 19:18:02 +00:00
Sean Huang 12dc86beb3 Expose model metadata from each thread's catalog and settings (#59958)
## What changed

- Add `ThreadManager::models_manager_for_startup` to obtain the model catalog used when starting or cold-resuming a root thread, including its effective originator.
- Add `CodexThread::selected_model_info` to resolve the model for future turns using the thread's current settings, catalog, and model overrides.
- Share catalog selection logic between startup lookup and thread creation.

## Testing

Add coverage verifying that startup and thread lookups use the thread-specific catalog, preserve the configured context window, and reflect model selection updates.

GitOrigin-RevId: d7976caebb7459e1e9ca55f3c6f6bb2af92cf3de
2026-11-06 19:16:53 +00:00
iceweasel-oai ebe94e25c5 Bump ignore to 0.4.30 (#59955)
GitOrigin-RevId: 43fe84738d323dbeebe0640c0540ed7dcff69ddf
2026-11-06 18:57:58 +00:00
jif 0768988e55 Resolve skill display names in read and installations tools (#59954)
## What changed

Allow `skills.read` and `skills.installations` to resolve visible skills by their full display name or the truncated name returned by `skills.list`. Preserve package locator and alias precedence, merged installation locations, and source filtering.

Reject ambiguous names with guidance to use `skills.list` and pass the intended package locator. Hidden and disabled skills remain unavailable through name lookup.

## Testing

Add regression coverage for name resolution, package and alias precedence, truncated UTF-8 names, merged locations, source filters, and ambiguous names.

GitOrigin-RevId: 5a2526d94f259cadb184563807127cb49955106d
2026-11-06 18:43:32 +00:00
Vaibhav Srivastav 4688e49329 Route broad Codex setup questions through self-knowledge guidance (#59949)
## What changed

Update the `openai-docs` sample skill to read `references/codex-self-knowledge.md` first for broad Codex setup or team customization questions, using its guidance to choose and combine configuration options. Keep other product behavior questions on the existing documentation lookup route.

GitOrigin-RevId: 0d307ab128ee8d3952b1527c20d1e659b79820d3
2026-11-06 17:47:31 +00:00
provencher-oai 4980f9585a Narrow openai-docs to product Q&A and first-time API setup (#59944)
## What changed

Refocus `openai-docs` on Codex and ChatGPT Work behavior and first-time API integrations. Skip API questions about existing integrations, action requests, and tasks fully answered by supplied text or data. Retain model migration guidance when users explicitly invoke `$openai-docs`.

Replace the broad routing workflow with guidance to check available tools and settings, consult documentation for the relevant product surface, and verify recent changes through the changelog and linked client changes or tests.

Update the skill's display metadata and affected skill catalog snapshots to match.

GitOrigin-RevId: 0a0e9abbee9975ebd30917b7477f475096f2c86b
2026-11-06 17:09:54 +00:00
ioanbudea-OAI c1c07853fe Use permission profiles for protected-model startup downgrades (#59933)
## What changed

Check the effective permission profile directly when applying startup restrictions for models that require automatic review, instead of converting it to a legacy sandbox policy.

Preserve the downgrade to `workspace-write` for profiles with full disk write access and enabled network access, excluding external enforcement and writable paths that cannot be converted to local paths. Share writable-path conversion with the legacy sandbox adapter.

## Testing

Add startup regression coverage for profiles that are downgraded, preserved, or rejected, including read-only carveouts and writable paths that cannot be converted locally. Verify restored permissions, automatic review selection, and workspace settings.

GitOrigin-RevId: 256c949f23d84dfba185a45a01b638ff5f1df52e
2026-11-06 16:00:54 +00:00
Felipe Coury 814347ecd2 Improve sidebar chat selection and tab hover highlighting (#59928)
## Why

The sidebar chooser used hard-coded keys and hints instead of configured list bindings, limiting navigation and making custom shortcuts inconsistent.

## What changed

- Use configured list actions for chooser navigation, acceptance, and cancellation, including key chords, page movement, and jumps to the first or last choice. Show the configured shortcuts in footer and retry hints.
- Place “New side chat” first and group existing chats into compact rows with a count and optional thread colors. Keep the selected chat visible in short panes.
- Highlight inactive side-chat tabs on hover while preserving the selected tab's styling. Redraw when the hovered tab changes and suppress hover highlighting during pane resizing.

## Testing

Extend interaction tests and snapshots to cover custom acceptance chords, `j`/`k` navigation, paging, and tab hover styles and redraws with either pane focused, including the fallback when terminal colors are unavailable.

GitOrigin-RevId: bad992b3786215dcb5569acfc72af8841fad949d
2026-11-06 15:34:29 +00:00
jif 2c502d8b3d Bind Guardian Decisions requests to their credential source (#59914)
## Why

Guardian Decisions retained a copied login key after the saved login changed or was removed. Queued comparisons need to respect credential changes, while runtime-bound threads must remain tied to their startup credential source.

## What changed

- Select login credentials from the thread's `ProviderAuthContext`, falling back to the supplied auth manager when no context exists.
- Resolve saved login keys before sending requests and reject queued comparisons if their credential source has changed. Pin runtime-bound credentials to the source selected at startup.
- Revalidate implicit keys before sending, rejecting missing, padded, or FedRAMP keys. Preserve explicit key overrides and the environment-key fallback.

## Testing

Extend credential lookup and queued-request tests to cover reloaded logins, runtime source pinning, rejection of stale queued comparisons, replacement-key authorization, invalid keys, and logout.

GitOrigin-RevId: 1d975613040e08c3825ba6355a166cf0fa812cad
2026-11-06 13:54:03 +00:00
jif 2210380232 Resolve Guardian policy from the reviewed thread's catalog (#59913)
## Why

Async classification could use policy from the manager's startup catalog even when the reviewed thread had a different reviewer policy.

## What changed

Share reviewer resolution between synchronous review and async classification, using the thread's catalog and reviewer eligibility rules. Select reviewer metadata from the same catalog snapshot, filter out models unsupported by API authentication, and preserve captured parent metadata when no eligible default reviewer exists.

## Testing

Update the async classification regression test with distinct thread and manager catalog policies, asserting that the thread reviewer's policy appears in classifier instructions.

GitOrigin-RevId: 0b28644d30bda42d2cf1bd8a31de2e8f8d38e1a6
2026-11-06 13:44:03 +00:00
jif ad1dbba32d Scope file change approval cancellation to the requesting turn (#59910)
## Why

A delayed file change approval cancellation could interrupt a later turn, even when the original approval was no longer pending.

## What changed

Send `Op::CancelPatchApproval` with the approval ID and requesting turn ID from the app server. Resolve cancellations only for a matching pending approval and interrupt its requesting turn only if it is still active. Route legacy `Op::PatchApproval` abort decisions through the same pending-approval handling.

## Testing

Add a regression test that cancels an approval, then replays that cancellation while a second turn has a pending approval with the same call ID. Verify that the second approval succeeds and its turn remains active.

GitOrigin-RevId: 4c833ccd0f33c2df4e9dfb25e2729ab19b6c879f
2026-11-06 13:21:43 +00:00
jif bbf57cec15 Avoid full image decoding for original-detail context estimates (#59908)
Read inline image dimensions with `ImageReader::into_dimensions` instead of
loading the full image into memory. Keep the existing patch-based estimate
and fallback when dimensions cannot be read.

GitOrigin-RevId: fd45eb748ce03134261c867397e1fe46c6023f2d
2026-11-06 13:18:18 +00:00
jif f57966695f Validate implicit API keys for Guardian Decisions (#59905)
## Why

Decisions uses a commercial endpoint, so implicitly inherited credentials must exclude FedRAMP API keys.

## What changed

Reject empty, whitespace-padded, and FedRAMP keys selected from cached authentication or `OPENAI_API_KEY`, returning a credentials error without rewriting the key. Explicit `CODEX_GUARDIAN_DECISIONS_API_KEY` overrides retain their existing behavior.

## Testing

Extend the cached-key precedence test to verify that FedRAMP project and service-account keys, including a whitespace-padded key, are rejected even when `OPENAI_API_KEY` provides a fallback.

GitOrigin-RevId: 8904b0e5b30662aaf7eb7535309b01c254bcbb82
2026-11-06 13:06:00 +00:00
jif e3fe1ade2c Delete incomplete prereleases by release ID (#59903)
## Why

A release can be replaced under the same tag during asset upload. Cleanup by tag could then delete the replacement release.

## What changed

Move GitHub release publication into `.github/scripts/publish-github-release.sh`. Create releases through the API and capture their IDs so an exit trap deletes only the newly created prerelease if asset upload fails. Clear the trap after upload so a metadata update failure preserves the uploaded assets.

Keep existing releases and tags intact, verify tags before creating releases, and continue creating stable releases as drafts until upload completes.

## Testing

Extend the publication test to cover upload failures, retries, metadata update failures, stable drafts, replacement releases, and missing tags. The focused test passes.

GitOrigin-RevId: a310d5b77a66dc6a9cf2d136c280d968f0e7a28f
2026-11-06 12:52:36 +00:00
jif b8725c1896 Keep verified question/answer records whole under elastic budgets (#59902)
## Why

Truncating verified answers can obscure the association between questions and responses. Elastic entry caps must preserve that association.

## What changed

Mark verified answer records in root conversation and trusted user answer sections so elastic preparation keeps them intact when they fit. Replace oversized records with the protected incomplete-answer notice and record zero retained evidence bytes.

## Testing

Add a regression test with two questions and opposite answers, checking that both evidence sections omit oversized records whole and preserve complete records when the entry cap allows them.

GitOrigin-RevId: 0fe9e8c0955cb09845a929274e3d52b816119624
2026-11-06 12:49:54 +00:00
jif f49ae52079 Recompute the approval reviewer when switching models (#59893)
## Why

Switching away from a model that requires automatic review should restore the user's requested approval reviewer instead of retaining the model's enforced reviewer.

## What changed

Recompute the reviewer from the requested preference and model requirements when the model changes without an explicit reviewer update, unless the session uses a trusted guardian reviewer. Preserve an explicit automatic-review preference across subsequent model switches.

## Testing

Extend the app-server settings regression test to cover restoring user review after leaving a protected model and retaining an explicit automatic-review choice across repeated model switches.

GitOrigin-RevId: a5672d1ebe94c2fac201ad460b4789d11df03b1a
2026-11-06 12:04:44 +00:00
jif b1a0dff158 Bound REPL provenance costs in elastic context preparation (#59891)
## Why

A reviewer receiving retained REPL responses after compaction can exhaust its context budget on protected response headers alone when the store contains many small results.

## What changed

Select a contiguous suffix of the newest responses before allocating body budgets, bounding elastic selection by the token-derived cost of provenance headers and separators. Preserve retained response bodies and images for subsequent allocation, and include dropped responses in the omission count. Apply this selection to both text-only and multimodal evidence.

## Testing

Extend the elastic REPL regression test with 10,000 responses in both evidence modes, checking budget admission, contiguous newest-response retention, preserved text and images, and combined storage and selection omission counts.

GitOrigin-RevId: 47c10d2f50e863ce4ba186be888788b8be5299dc
2026-11-06 11:53:40 +00:00
jif b6f53857fc Remove incomplete prereleases after asset upload failures (#59887)
## Why

Prereleases are published before their assets are uploaded. A failed upload can leave an incomplete public release and prevent a rerun from recreating its `prereleased` event.

## What changed

Track newly created prereleases and successful asset uploads in the release workflow. Remove a newly created prerelease if its upload fails, preserving the tag so a rerun can recreate the release. Keep existing releases and releases whose assets finished uploading, even if the metadata update fails.

## Testing

Add a regression test that runs the workflow commands with a stubbed `gh`, covering upload failure cleanup, a successful rerun, preservation of existing prereleases, and metadata update failures after upload.

GitOrigin-RevId: 29411d6d1e649f4e8c67e84a41d9de2c9d31558f
2026-11-06 11:32:48 +00:00
psachdeva-oai ddd1812a51 Carry targeted moderation decisions on final-answer messages (#59842)
## What changed

Read `final_answer_moderation` metadata and attach `moderation: { moderated: boolean }` to the completed final-answer message only when its item ID matches. Apply this in both normal and plan modes, and reset the pending decision when a new response starts.

Preserve the answer's native item ID and moderation flag through legacy events and history reconstruction. Combine text parts into one legacy event when a moderation decision is present.

Expose nullable moderation data on app-server agent messages and update the JSON schemas, TypeScript types, and Python models.

## Testing

Add an integration test for moderation on completed answers and their legacy events. Extend protocol conversion tests to cover populated moderation data and serialization as `null` when absent.

GitOrigin-RevId: f286b67731a84b3daf5d10b7644f2e31b62f0e53
2026-11-06 07:43:44 +00:00
Alex Kira 55897425e8 Add opt-in incremental tools for regular OpenAI Responses (#59832)
## Why

Incremental tool declarations were limited to Responses Lite. Regular OpenAI Responses requests sent the full current tool catalog on each request.

## What changed

- Add the disabled-by-default `incremental_tools_legacy` feature for regular OpenAI Responses, independently of the Responses Lite `incremental_tools` flag.
- Support tool declarations and updates in conversation history, including during compaction, while preserving existing history prefixes.
- Keep hosted `web_search` configuration in top-level `tools` rather than `additional_tools`, including in compaction requests.

## Testing

Extend request-history scenarios and snapshots to cover regular Responses catalog updates, model switches, compaction, and MCP tool removal and restoration. Assert that incremental requests preserve input prefixes and keep web search out of history declarations.

GitOrigin-RevId: fa347409e387aa973ce2e41df8505769b7db1ec2
2026-11-06 06:07:46 +00:00
Benjamin Carlsson 7b8d67e456 Add a gated Cloud backend to the TUI (#59828)
## What changed

- Register an additional Cloud connection on supported macOS and Linux launches when `TuiMultiBackend` is enabled, using the selected ChatGPT account and local network policy.
- Preserve backend settings and identify Cloud in connection controls and status.
- Let Cloud supply the model when a thread opens, skip local skills requests and stale results, and allow resume without a local working-directory override.
- Preserve Git metadata in Cloud thread snapshots and continue history hydration past empty filtered pages within the scan budget.
- Report Cloud connection failures and require reopening Codex to reconnect.

## Testing

Add regression coverage for Cloud model bootstrap, skipped skills requests, resume directory handling, history pagination through filtered pages, and Git metadata preservation.

GitOrigin-RevId: 6717f0f5ad7708c5e9b5796d94711dd1eecc49bb
2026-11-06 05:26:52 +00:00
Eddie Chen a037e65ead Preserve client metadata through queued submissions (#59826)
## Why

Queued inputs previously stored and dispatched without the submitting client's Responses API metadata, losing attribution such as `client_type` when the queued turn started.

## What changed

- Accept `responsesapiClientMetadata` when adding or updating queued submissions and expose it on returned queue items.
- Persist metadata with the input and forward it when starting a selected item or dispatching an idle queue, including after restoration.
- Preserve existing metadata when an update omits it or supplies an empty map; replace it when a non-empty map is supplied.
- Keep stored inputs readable by older queue workers and update generated protocol artifacts.

## Testing

Extend queue service and app-server tests to cover metadata round trips, preservation and replacement on edits, compatibility with older readers, and forwarding during selected, idle, and restored dispatch.

GitOrigin-RevId: 508043b1d3d0298c9af2be8e05b6999de46596a1
2026-11-06 05:10:44 +00:00
Felipe Coury 5fab289359 Enable resizing the sidebar chooser (#59824)
## Why

Sidebar resizing previously required an open side chat, leaving the chooser without the same width controls.

## What changed

- Support keyboard resizing, width presets, and divider dragging for the sidebar chooser, with resize hints that fit narrow sidebars.
- Keep keyboard resize mode active across startup thread assignment and replacement of the chooser by a new side chat, so `Enter` finishes resizing without submitting the parent draft.
- Activate resize bindings only when a split is available, and prevent divider drags from starting while the split is animating.

## Testing

Add regression coverage for chooser resizing, width preservation when switching between the chooser and a chat, startup and side-chat creation transitions, draft preservation, and unavailable resize bindings in narrow terminals.

GitOrigin-RevId: 511cd4bb5894e6f33f0cf5d7472bb3013361ffe0
2026-11-06 04:53:30 +00:00
cooper-oai faeb379646 Bind runtime auth to the provider's selected credential source (#59823)
## Why

Runtime authentication must use the credential selected by the model provider. Explicit API keys and command credentials need independent ownership so cached connections and in-flight work cannot cross credential sources.

## What changed

- Register and reuse runtimes per credential source, supporting explicit provider keys and command credentials without falling back to saved login credentials.
- Track `AuthOwner` by credential manager and owner generation across WebSocket state, compaction, and scoring.
- Preserve cached identity and runtime registration state during credential-source outages or failed storage reloads. Require a successful auth reload before logout revokes credentials.
- Reject requests whose production or staging environment differs from runtime registration, including model catalog requests.

## Testing

Add regression coverage for credential selection and runtime reuse, owner isolation, source outages, failed reloads and logout recovery, and environment mismatches.

GitOrigin-RevId: 7bab55e0ea502593393df10046309fd8502edbd0
2026-11-06 04:33:14 +00:00
smurching-oai df38cb3b2a Add device-code authorization for gateway OAuth (#59822)
## Why

Gateway sign-in needs an alternative for terminals that cannot open a browser.

## What changed

- Add optional `gateway_oauth.device_authorization_url` configuration and a `login_with_device_code` API that presents a verification URL and user code, polls for approval, and persists the resulting credentials.
- Use the configured proxy and network policy, validate verification URLs, and bound OAuth responses. Support cancellation and report denied or expired codes without exposing issuer error details.

## Testing

Add tests for successful authorization and credential persistence, unsafe verification URLs, network-policy denials, denied and expired codes, and cancellation during approval or credential storage.

GitOrigin-RevId: 96398578fb866d34929e85c04eadf468d8cd3255
2026-11-06 04:24:04 +00:00
Abhinav aece559654 Allow provider selection for gateway OAuth reads and logins (#59819)
## Why

Gateway OAuth reads and logins previously used only the current provider, preventing clients from authorizing another configured provider without changing the default.

## What changed

- Add optional `modelProvider` params to `account/gatewayOAuth/read` and `account/gatewayOAuth/login`, preserving current-provider behavior for omitted or null params and selectors.
- Validate explicit providers against current managed policy without changing the default or any thread's provider.
- Retain readiness state across providers and send `account/gatewayOAuth/changed` notifications for every configured provider sharing the changed credential.
- Update protocol schemas, TypeScript types, Python models, and documentation.

## Testing

Add coverage for non-default provider login, retained readiness when alternating providers, notifications for shared credentials without starting login, and legacy TypeScript request compatibility.

GitOrigin-RevId: cfd472c322b821fe36b8c133a8de774f4ba48534
2026-11-06 04:02:11 +00:00
Benjamin Carlsson a142c90e26 Handle TUI message submission receipts and preserve uncertain drafts (#59817)
## Why

The TUI's cached active turn can be stale when a cloud message is submitted. A lost reply also leaves delivery uncertain, so automatically resending the draft risks submitting it twice.

## What changed

- Let the cloud server choose whether an Enter submission starts or steers a turn, and apply its receipt to the matching client message ID.
- Keep Tab-queued input waiting until the admitted turn finishes, including before its start notification arrives.
- Restore rejected submissions to the composer. Hold duplicate or unconfirmed submissions out of automatic delivery until history confirms them.
- Reconcile saved drafts and pending steers by client message ID when resuming sessions, and preserve submissions belonging to other turns during interruption recovery.
- Classify cloud preflight failures as invalid parameters so rejected queued input can be restored safely.

## Testing

Add regression coverage for cloud receipt outcomes, queued-input ordering, rejected drafts, lost replies, interruption recovery, and session resume with identical message text but distinct client IDs.

GitOrigin-RevId: ec4eb581e450488434bc4614ec59273d73ffd0a1
2026-11-06 03:51:37 +00:00
alexsong-oai 6eb51a438a Retry gateway credential exports after unauthorized responses (#59816)
## Why

Cached gateway command credentials need to be refreshed when the gateway rejects them with a `401`.

## What changed

Clear the cached `credential_export` token after an inference HTTP `401` or a WebSocket upgrade rejected with `401`, then rerun the command for one retry. Preserve subsequent primary authentication recovery if the retry is also unauthorized, and document the behavior.

## Testing

Add integration coverage for using a new exported token, reporting an invalid export, recovering primary authentication after the gateway retry, and stopping after a second unauthorized WebSocket upgrade.

GitOrigin-RevId: 3397476dbfd3bec1bd44f90657c4f9e17bb7df67
2026-11-06 03:51:12 +00:00
Dmitriy Kovalenko 7b54fd245d Pack relative relocations in x86-64 musl release builds (#59805)
## What changed

Add `-z pack-relative-relocs` to the Cargo and Bazel release linker flags for
`x86_64-unknown-linux-musl`, alongside the existing safe identical code folding.

GitOrigin-RevId: 1398ea6775e6b8ec81e624def6c23e8053363544
2026-11-06 03:09:21 +00:00
lt-oai da279f6fd4 Support optional thread IDs in hosted file uploads (#59795)
## What changed

Add an optional `thread_id` to `HostedFileUploadContext` and include it as `codex_thread_id` in file creation requests when provided. Keep MCP app uploads without this field while retaining the thread ID in tool-call metadata.

## Testing

Extend upload tests to check inclusion and omission of `codex_thread_id`, and assert that MCP app calls retain `_meta.threadId` without adding it to file uploads.

GitOrigin-RevId: cff15b35e5130e56973f944b3b849807550d298b
2026-11-06 02:42:02 +00:00
rhan-oai 1031a7b9aa Check extension budgets before model generation requests (#59794)
## What changed

Add a default `ModelRequestContributor::budget_exhausted` hook and fail generation with `SessionBudgetExceeded` when any contributor reports an exhausted budget for the thread.

Check budgets before HTTP requests and before WebSocket connection setup, then check again after the connection is established. WebSocket warmup remains available when the budget is exhausted.

## Testing

Add coverage for budget changes during a tool call, verifying that exhaustion prevents the next model request while an available budget allows completion. Extend WebSocket coverage to verify that exhausted generation opens no connection and warmup still permits connection reuse once the budget becomes available.

GitOrigin-RevId: 97ce02dc7f9bd54830e4b73c4f0334a30367eebf
2026-11-06 02:31:54 +00:00
Owen Lin 2f02d8461d Support update-boundary paging across forked thread histories (#59793)
## Why

Item reads with an update boundary previously rejected forked thread histories and only supported an exclusive lower bound on update ordinals.

## What changed

- Add `before_updated_at_ordinal` as an exclusive upper bound, mutually exclusive with `after_updated_at_ordinal`.
- Allow update-filtered and update-ordered item reads across parent and child segments, applying segment bounds and preserving cursor pagination in both directions.
- Require an update boundary for update-order sorting and reject either boundary when using an item anchor or item-ID filtering.

## Testing

Extend thread-store tests to cover upper-bound filtering, descending cursor pagination, forward and backward paging across forked lineages, mutually exclusive boundaries, and ordinals outside SQLite's integer range.

GitOrigin-RevId: 63f7e18fb24a89a41ff8e570cf65963622519a25
2026-11-06 02:21:38 +00:00
viyatb-oai a6ed292aa3 Centralize managed proxy preparation and sandbox routing (#59792)
## What changed

Move proxy configuration and routing selection into `prepare_managed_network`. Keep native Windows launches direct by stripping managed proxy variables before credential brokering, and select dedicated listeners only for Windows MXC launches.

Consolidate managed network context filtering in `SandboxManager` and simplify proxy preparation for Linux and MXC while preserving the macOS Seatbelt context.

## Testing

Add Windows regression coverage for native launches with both disabled and enabled proxy configurations, verifying that managed proxy variables are removed while caller environment values and API credentials are preserved.

GitOrigin-RevId: 29fe1fb02afb574b4108032b7e8028d19d8270b4
2026-11-06 02:21:14 +00:00
Benjamin Carlsson 3cf4899cb5 Render delegated thread messages as Markdown in the TUI (#59789)
## Why

Incoming delegated messages were rendered as plain text, leaving Markdown formatting visible and links without hyperlink metadata.

## What changed

Use a dedicated history cell to render the message body as Markdown while keeping the source task attribution literal. Preserve hyperlinks and wrapping, and apply the appropriate list spacing for scrollback and the redrawable transcript.

Use the same rendering for live messages, resumed history, and transcript projection.

## Testing

Extend replay coverage to check matching live and replayed output, transcript rendering, hyperlink destinations, and shared source text across wrapped rows. Add a snapshot covering list spacing in scrollback and the redrawable transcript.

GitOrigin-RevId: e9864c7721fa1afa2d3662ab9f57122ab696a51e
2026-11-06 02:01:43 +00:00
alexsong-oai b1263c593d Support credential export commands for gateway authentication (#59787)
## What changed

Allow `model_providers.<id>.gateway_oauth.credential_export` to supply a gateway access token instead of browser OAuth. Run the configured command on first use, cache its token in memory, and deliver it through the configured header or cookie. Export failures surface directly, and command-backed providers do not require an OAuth session.

Require mutually exclusive OAuth and exporter settings, same-origin model catalog access, and rejection of HTTP redirects for command-backed gateway credentials. Share the bounded, timeout-controlled command runner with AWS credential export.

## Testing

Add tests for inference and model listing without OAuth, token caching and recovery after invalid output, preservation of primary authentication, and rejection of mixed OAuth/exporter configuration.

GitOrigin-RevId: e3dbfd8823b1992045f1c1efd56ec98ee17e07a5
2026-11-06 02:00:39 +00:00
Ruslan Nigmatullin 5e5bdee745 Decouple message lifecycle state from model-visible item IDs (#59785)
## Why

A message's model-visible item ID may be unknown until the recipient records it. Message lifecycle observers need to capture publication state before that point.

## What changed

Remove `message_id` from `MessageLifecycleInput` and give each publication's `ExtensionData` a fresh UUID key. Stop assigning an item ID when publishing messages for lifecycle observers.

## Testing

Update the agent mailbox test to store a contributor-specific token in `ExtensionData` at publication and retrieve it at consumption, verifying that publication state survives queued delivery and recipient eviction.

GitOrigin-RevId: e254f94994d0976e61cb46ee23297f3248b9a389
2026-11-06 01:50:20 +00:00
Felipe Coury d63a342256 Support multiple side chats in the TUI sidebar (#59784)
## What changed

- When side retention is enabled, let the sidebar chooser create additional side chats from the main chat or reopen existing ones.
- Add numbered, clickable tabs and keyboard navigation in the chooser. Keep the selected tab visible when space is limited.
- Preserve drafts, transcript history, and the sidebar layout when switching between sibling side chats.
- Make `/side` with a prompt request a new side chat, while `/side` without arguments reopens the selected side chat. Preserve existing reuse behavior when side retention is disabled.

## Testing

Extend TUI tests and snapshots to cover creating sibling side chats, switching through the chooser and tabs, retaining drafts and history, and restoring image attachments after failed creation.

GitOrigin-RevId: 4166010c253c40a409390f7020b69478c04cf98c
2026-11-06 01:49:57 +00:00
Alex Kotliarskyi f6a69b5873 Tie gRPC code-mode connection lifetime to live sessions (#59783)
## Why

Some hosts assign a worker per connection. Idle connection eviction can prevent a quiet session from reaching the worker holding its lease, while retaining a connection after the last session closes unnecessarily keeps that worker allocated.

## What changed

- Disable the HTTP connection pool idle timeout for gRPC code-mode connections.
- Cache URL-based clients weakly and let live sessions own the shared client, releasing their ownership on closure or failure even while the provider remains alive.
- Acquire clients for deferred RPCs only when needed and return the session error if the client has already been released.

## Testing

Add regression tests that verify connection reuse and stored state after 120 seconds of inactivity, and connection closure after the last shared session fails while the provider and session handles remain alive.

GitOrigin-RevId: bd1ff00c4003c03ed173c23dd2ed373ed354ab65
2026-11-06 01:49:33 +00:00
Dmitriy Kovalenko 1840e7dead Enable safe identical code folding for x86-64 musl releases (#59780)
## What changed

Enable `--addrsig` and `--icf=safe` for `x86_64-unknown-linux-musl` release packages in Cargo and Bazel.

Opt Cargo release builds into these flags with `CODEX_MUSL_RELEASE_LINK_FLAGS=1`, selecting `lld` and preserving existing `RUSTFLAGS`. Apply the corresponding flags in Bazel's release package transition for the x86-64 musl platform.

GitOrigin-RevId: ade3c619dad2f03fd93a6fec35477607caec8b31
2026-11-06 01:33:51 +00:00
alexsong-oai 74bfe33ec8 Add provider configuration editing to the TUI (#59779)
## What changed

- Add an “Add custom provider” entry to the provider picker and an “Edit configuration” action for editable providers.
- Provide forms for custom gateway names, base URLs, and API key environment variable names, plus supported Bedrock and GCP settings.
- Validate required fields, suggest environment variable names from the provider catalog, and preserve drafts when validation or saving fails.
- Save configuration through the connected app server, write only changed fields, and refresh the provider list after saving. For uncertain creation results, ask users to check the list before adding the provider again.

## Testing

Add editor tests for validation, draft recovery, Vim input, and patches that preserve unchanged authentication settings. Add an integration test covering the edit action and custom provider creation while preserving the default provider, with snapshots of the new UI.

GitOrigin-RevId: 8eb32ed30ed27ab671f08f565af48705f2b9f193
2026-11-06 01:33:27 +00:00
tongzhou wang 6103cf6c78 Expose acceptance metadata and code-cell links in rollout traces (#59778)
## What changed

- Add `accepted_at_unix_ms` and `accepted_seq` to conversation items, recording the first local `HistoryItemAccepted` event in trace order. Inherited context alone does not count as local acceptance.
- Add `started_code_cell_id` to model-requested `exec` tool calls when a matching code cell exists in the same thread and, when known, turn. Resolve links after replay so deferred cell starts can be matched.
- Default the new optional fields to absent when deserializing older traces and omit them from serialized output when unset.

## Testing

Extend reducer tests to cover duplicate acceptance events with out-of-order clock readings, inherited items without local acceptance, and `exec` calls with and without matching code cells.

GitOrigin-RevId: dfb594630f77d7c899398aa181c88a681587b1df
2026-11-06 01:20:54 +00:00
Abhinav daa69c411c Allow selecting a configured provider in model/list (#59776)
## Why

Clients need to list models for a configured provider other than the app-server's startup default.

## What changed

Add an optional `modelProvider` parameter to `model/list` and expose it in the generated schemas and client types. Explicit selections use provider definitions loaded at startup and respect current managed provider requirements. Unknown providers return a structured `modelProviderNotConfigured` error.

Use a temporary catalog when selecting another provider, preserving the default catalog and its disk cache while retaining runtime authentication. Requests without a selector keep the existing provider and caching behavior.

## Testing

Add coverage for provider selection, preservation of the default catalog and disk cache, unknown-provider errors, managed requirement enforcement, and runtime authentication for temporary catalogs.

GitOrigin-RevId: 6092df9f6141810c6ac215a8e1fb601f77e54747
2026-11-06 01:10:49 +00:00
ioanbudea-OAI 73b1a3bc85 Remove the legacy Seatbelt command wrapper (#59774)
## What changed

Update Seatbelt tests to call `create_seatbelt_command_args` directly with explicit filesystem and network policies, and remove the unused legacy-policy wrapper.

Reuse `FileSystemSandboxPolicy::read_only()` in read-only policy conversion and test setup instead of constructing equivalent policies inline or through legacy conversion.

GitOrigin-RevId: 2e2b3342425a3477986f41135caa18003b697fe4
2026-11-06 00:59:18 +00:00
ioanbudea-OAI c2bd770ca7 Remove the legacy sandbox policy constructor (#59772)
## What changed

Remove `FileSystemSandboxContext::from_legacy_sandbox_policy` and migrate its test callers to `from_permission_profile`. Construct read-only, disabled, and externally enforced sandbox contexts directly with `PermissionProfile`.

GitOrigin-RevId: e330b89d060061eda106232eab554be5ccd06149
2026-11-06 00:37:27 +00:00
rhan-oai 94ca55a93c Add shared service-tier support for host-owned agents (#59770)
## What changed

- Expose an optional `AgentServiceTier` provider so host-owned children, including detached children, inherit the root's committed tier during spawn preparation, startup prewarm, and each inference step.
- Reject per-turn tier overrides for children using the shared provider. Root updates apply to subsequent requests without changing requests already in flight.
- Preserve independent configured tiers and role overrides when no provider is installed, including across eviction and reload. Spawned children inherit the parent's thread preference rather than its per-turn override.
- Publish the latest committed root tier only after successful runtime registration, preventing failed duplicate starts from changing shared settings.

## Testing

Add coverage for detached-child WebSocket prewarm and between-step tier changes, shared-child override rejection, independent-tier inheritance and reload, and settings updates before registration.

GitOrigin-RevId: f0f3676813a1c59bd77baf95121e2d13e0163a8e
2026-11-06 00:24:27 +00:00
Charlie Marsh 74417e9c6b Reuse decoded WebSocket event kinds in telemetry (#59769)
## Why

WebSocket telemetry reparses text frames to extract event kinds that the transport already decodes.

## What changed

Pass decoded event kinds to telemetry and report receive failures separately. Keep JSON parsing for timing metrics and as a fallback when stream event decoding fails. Remove the `tokio-tungstenite` dependency from `codex-otel` and restrict it to tests in `codex-core`.

Limit wrapped error parsing to error events or failed stream decoding, preserving HTTP error forwarding when unrelated stream fields are malformed.

## Testing

Update runtime summary coverage to include receive failures and extend the WebSocket error forwarding test with a malformed stream field.

GitOrigin-RevId: e1f9d200fd6d30ec124a2354bdbc01f3082ddde3
2026-11-06 00:24:03 +00:00
Alex Zamoshchin 08e4f43c9a Stop prefetching plugin discovery at app-server startup (#59768)
## What changed

- Remove startup prefetching of remote catalogs, featured plugins, and recommendations while retaining installed-plugin refreshes and bundle downloads.
- Fetch featured plugin IDs on demand, concurrently with marketplace fetching when listing the remote global catalog, and reuse the cached results.
- Retire `plugin_discovery_prefetch` as an ignored compatibility flag and remove forced background catalog refreshes.

## Testing

Update app-server tests to verify that startup downloads installed bundles without discovery requests and that two `plugin/list` calls share one featured-plugin fetch.

GitOrigin-RevId: aa10474f3429102d624c83472e81ec85e3b470ae
2026-11-06 00:23:38 +00:00
Felipe Coury 9df200a068 Add sidebar tabs and nonblocking side-chat creation (#59767)
## Why

Starting a side chat waits for fork and setup requests. Keep the workspace responsive during those requests and let users return to an existing side chat through the sidebar chooser.

## What changed

- Add a clickable `Side chat` tab and `+` chooser, plus the configurable `focus_sidebar_tabs` action bound to `leader t` by default.
- Create workspace side chats in the background, showing loading and failure states with `Enter` to retry and `Esc` to go back. Preserve opening prompts and avoid taking focus when the user has moved away.
- Retain inherited permission profiles and defer startup notifications until the side chat is registered on its owning backend.
- Quiet the parent composer while the chooser has focus and prevent completion popups or repeated activation keys from consuming chooser input.

## Testing

Extend tests and snapshots for loading and failure states, returning to an existing chat, draft preservation, inherited permissions, focus transitions, and deferred MCP startup notifications.

GitOrigin-RevId: 244bcd3f170819e2260f21dc1041cf8899fe048c
2026-11-06 00:21:16 +00:00
Charlie Marsh b3c5a49458 Update WebSocket dependency forks (#59759)
## What changed

- Advance the pinned `tokio-tungstenite` and `tungstenite` fork revisions and update the Cargo and Bazel lockfiles.
- Use `OAuthCredentialsStore::File` in the gateway credential test to avoid spending the model discovery deadline on keyring-backed decryption.

GitOrigin-RevId: 2862850215abce478136137b9b68a37f3caaeed4
2026-11-05 23:10:43 +00:00
jamy-OAI b313cca1cf Enforce host-required cyber access programs per thread (#59754)
## What changed

- Expose `RequiredCyberAccessPrograms` so hosts can require an explicit allowed program on a thread. Snapshot the requirement before extension callbacks; hosts must reapply it on cold resume.
- Validate resolved `access_programs` before HTTP and WebSocket model requests, rejecting omitted or disallowed programs. Explicit `Standard` remains distinct from omission. Reject memory summarization and realtime requests when a requirement is present.
- Keep required programs scoped to the parent thread by preventing Guardian reviewers from inheriting its program, including Guardian v2 reviews.

## Testing

Add HTTP and WebSocket coverage for allowed programs, omission, disallowed programs, unsupported providers, and connection reuse. Extend Guardian tests to verify parent-only program scope and that removing the public attachment does not erase the startup snapshot.

GitOrigin-RevId: 9306a9af0e03e7a1728dfeb610cd7ec7517367fd
2026-11-05 22:49:46 +00:00
bkotsopoulos 09358089b0 Configure the Opus Bazel patch and isolate auth tests (#59752)
## What changed

- Configure Bazel to apply `opusic_sys_install_headers.patch` to `opusic-sys` with `-p1`.
- Run the cloud-managed MCP OAuth test with `--no-browser` and keep stdin open until the child exits so EOF cannot race the HTTP callback.
- Serialize the cancelled-refresh test with other auth environment tests and temporarily clear the access-token environment variable.

GitOrigin-RevId: ad76b72ae98320bd0e3ff3231e1ed874332ce38c
2026-11-05 22:18:49 +00:00
richardopenai c48785a9b7 Stop Noise relay recovery on rejected executor credentials (#59750)
## Why

Registry `401` responses during harness key validation previously produced generic relay resets, causing recovery to retry rejected executor credentials instead of surfacing the authentication failure.

## What changed

- Send an authenticated Noise handshake rejection for registry `401` responses without opening an application transport.
- Propagate the rejection as `EnvironmentRegistryAuth` and preserve it in the terminal connection state so recovery stops with a specific authentication error.
- Preserve registry HTTP status codes so `403` responses for stale harness grants and transient service failures can continue through recovery.

## Testing

Add tests that reject tampered authentication rejections and exercise session recovery: `401` stops after one rejected recovery attempt, while `403`, `502`, and `503` retry with fresh harness grants and reconnect successfully.

GitOrigin-RevId: 9a55412e583146c094948618c7c9aeb4fb4b953e
2026-11-05 22:03:55 +00:00
cooper-oai 219ab4043e Use runtime authentication for OpenAI MCP and app requests (#59749)
## What changed

- Select fresh authentication for each HTTP operation on eligible OpenAI MCP connections while preserving the connection's credential source and account network policy. Stop redirects when requests carry runtime assertions.
- Pass the owning thread's authentication and runtime context through app discovery, connector metadata, and trusted-access requests. Include the runtime authentication mode in MCP connection and tool-cache identities.
- Give resumed actors analytics clients bound to their own authentication context, and serialize stored-credential reloads with token refresh while preserving host-provided credentials.

## Testing

Add coverage for fresh request assertions, revoked account policies, redirect handling, resumed-actor isolation, and MCP uploads in dual-header and assertion-only modes.

GitOrigin-RevId: f06900a6db61cd6cf53c3aa8075afeec4d5706d9
2026-11-05 22:03:29 +00:00
Benjamin Carlsson e934edd68c Add typed Cloud user-message submission receipts (#59746)
## What changed

Add `CloudRequestHandle::submit_user_message` to submit a message with a stable ID using `SubmissionMode::Steer`. Return a `CloudUserMessageReceipt` that distinguishes started, steered, and duplicate admissions while preserving server-provided turn status and duplicate identity.

Report preflight rejections and invalid requests as `-32602`, while preserving uncertain admission outcomes as errors without automatic retries. Keep existing `turn/start` callers on `StartIfIdle` with their existing response and error behavior.

## Testing

Add receipt mapping tests and a mock-server worker test covering submission modes, single admission attempts, uncertain outcomes, input validation, and disconnected reply streams.

GitOrigin-RevId: eba120cf47cf0297b072ea373341ead663fb9bc9
2026-11-05 21:44:12 +00:00
zm-oai b93a7b1512 Repair legacy Windows sandbox bin permissions for SYSTEM (#59745)
## Why

Legacy `.sandbox-bin` ACLs grant `SYSTEM` Modify access without `WRITE_DAC`, preventing the provisioning service from reapplying the bin policy.

## What changed

- Grant `SYSTEM` inheritable `WRITE_DAC` access when protecting the sandbox bin so it can update permissions on the directory and its children.
- Before legacy provisioning, repair the old ACL through an authenticated owner handle when `SYSTEM` is denied access. Upgrade only the expected SYSTEM entry in a protected, allow-only ACL, reject unexpected permissions, and verify that `SYSTEM` can reopen the directory with `WRITE_DAC`.

## Testing

Extend ACL coverage to check `SYSTEM` permissions on the bin and existing and newly created runner files. Add an ignored Windows integration test requiring LocalSystem and user-owned legacy homes to cover successful repair, repeated repair, and rejection of an explicit SYSTEM deny entry.

GitOrigin-RevId: 2303cdf5182947c2d044c79ac7027a16f0373c7d
2026-11-05 21:33:57 +00:00
jamy-OAI af92ae158d Forward explicit cyber access programs with header authentication (#59743)
## Why

Explicit cyber access program selections were dropped for requests using `CodexAuth::Headers`, preventing the server from evaluating the requested program.

## What changed

Forward explicit program selections for header-authenticated requests, leaving entitlement decisions to the server.

## Testing

Add integration tests covering explicit selections and omission over HTTP and a reused WebSocket connection, preservation of actor and account headers, and propagation of backend HTTP 403 denials without dropping the selected program.

GitOrigin-RevId: 5e549e87a1420ce8a5f1ce5c704cc6b7630af3ba
2026-11-05 21:21:19 +00:00
Felipe Coury 194f2662b8 Add a sidebar chooser and floating workspace shortcut panels (#59739)
## What changed

- Open a sidebar chooser when no side chat exists, with keyboard and mouse controls to start a new side chat while preserving the parent draft.
- Animate sidebar opening and closing, including reversing an unfinished transition, when animations are enabled.
- Show context-aware workspace shortcuts in a floating panel after a short delay, and render presets in the same overlay without moving the composer.
- Prevent chooser input from accepting an approval dialog before it has been painted.

## Testing

Add coverage for chooser activation and draft preservation, sidebar animation reversal, shortcut and preset snapshots, and approval input handling.

GitOrigin-RevId: 014112622a94798f4e611756c55112dfd8016051
2026-11-05 21:05:51 +00:00
2718 changed files with 96619 additions and 140997 deletions

No files matched your search

+5 -6
View File
@@ -18,8 +18,8 @@ common --experimental_platform_in_output_dir
# Match Cargo's MSVC static CRT policy and V8's allocator linkage. Only the
# MSVC C/C++ toolchain consumes this feature; other toolchains ignore it.
# Include host dependencies so native build tools use the same runtime.
build --features=static_link_msvcrt
build --host_features=static_link_msvcrt
build --features=-dynamic_link_msvcrt --features=static_link_msvcrt
build --host_features=-dynamic_link_msvcrt --host_features=static_link_msvcrt
build --workspace_status_command=./scripts/workspace-status.sh
build:windows --workspace_status_command=./scripts/workspace-status.cmd
@@ -222,12 +222,11 @@ common:ci-v8 --config=ci
common:ci-v8 --build_metadata=TAG_workflow=v8
common:ci-v8 --build_metadata=TAG_os=linux
# Native Windows MSVC builds inherit the runner's MSVC SDK environment.
# Native Windows MSVC builds use the registered LLVM toolchain and its SDK.
# Voice's separately declared native build tools still need the runner environment.
# Client environment capture and repository discovery happen before target
# transitions, so these runner settings cannot live in runtime_package.bzl.
# Hermetic LLVM targets the GNU ABI on Windows even on an MSVC platform.
build:ci-windows-msvc --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0
build:ci-windows-msvc --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows,@local_config_cc//:cc-toolchain-arm64_windows
build:ci-windows-msvc --repo_env=BAZEL_MSVC_RUNTIME_VISUAL_STUDIO_EULA=1
build:ci-windows-msvc --action_env=PATH
build:ci-windows-msvc --host_action_env=PATH
build:ci-windows-msvc --action_env=INCLUDE
@@ -68,6 +68,7 @@ runs:
working-directory: codex-rs
env:
TARGET: ${{ inputs.target }}
CODEX_MUSL_RELEASE_LINK_FLAGS: "1"
run: bash "${GITHUB_WORKSPACE}/.github/scripts/install-musl-build-tools.sh"
- name: Disable aws-lc jitter entropy (musl)
@@ -22,7 +22,7 @@ runs:
- name: Prepare native Windows audio dependencies
if: ${{ runner.os == 'Windows' }}
uses: ./third_party/voice/cargo-ci/windows-setup
uses: ./.github/actions/setup-bazel-windows
with:
target: x86_64-pc-windows-msvc
-20
View File
@@ -1,20 +0,0 @@
name: setup-msvc-env
description: Expose an MSVC developer environment for the requested Windows target.
inputs:
target:
description: Rust target triple that will be built on this Windows runner.
required: true
host-arch:
description: Optional Visual Studio host architecture override.
required: false
default: ""
runs:
using: composite
steps:
- name: Expose MSVC SDK environment
shell: pwsh
env:
HOST_ARCH: ${{ inputs.host-arch }}
TARGET: ${{ inputs.target }}
run: '& "$env:GITHUB_ACTION_PATH/setup-msvc-env.ps1" -Target "$env:TARGET" -HostArch "$env:HOST_ARCH"'
@@ -1,257 +0,0 @@
param(
[Parameter(Mandatory = $true)]
[string]$Target,
[string]$HostArch = ""
)
# Cargo can cross-compile the Rust code for Windows ARM64 on a Windows x64
# runner, but rustup alone does not expose the matching MSVC/UCRT include and
# library paths. Ask Visual Studio for the target-specific developer
# environment, then persist the relevant variables through GITHUB_ENV so the
# later Cargo step sees the same environment as a normal VsDevCmd shell.
switch ($Target) {
"x86_64-pc-windows-msvc" {
$TargetArch = "x64"
$RequiredComponent = "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
}
"aarch64-pc-windows-msvc" {
$TargetArch = "arm64"
$RequiredComponent = "Microsoft.VisualStudio.Component.VC.Tools.ARM64"
}
default {
throw "Unsupported Windows MSVC target: $Target"
}
}
# VsDevCmd needs both sides of the cross compile: the architecture of the
# machine running the tools and the architecture of the binaries being linked.
# Infer the host from the runner unless a caller needs to override it.
if (-not $HostArch) {
$HostArch = if ($env:PROCESSOR_ARCHITEW6432 -eq "ARM64" -or $env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
"arm64"
} else {
"x64"
}
}
$VsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path $VsWhere)) {
throw "vswhere.exe not found"
}
# Require the target VC tools component, not merely any Visual Studio install,
# so an x64 archive producer cannot silently link ARM64 tests with the wrong
# SDK/toolchain layout.
$InstallPath = & $VsWhere -latest -products * -requires $RequiredComponent -property installationPath 2>$null
if (-not $InstallPath) {
throw "Could not locate a Visual Studio installation with component $RequiredComponent"
}
$VsDevCmd = Join-Path $InstallPath "Common7\Tools\VsDevCmd.bat"
if (-not (Test-Path $VsDevCmd)) {
throw "VsDevCmd.bat not found at $VsDevCmd"
}
$VarsToExport = @(
"INCLUDE",
"LIB",
"LIBPATH",
"PATH",
"UCRTVersion",
"UniversalCRTSdkDir",
"VCINSTALLDIR",
"VCToolsInstallDir",
"WindowsLibPath",
"WindowsSdkBinPath",
"WindowsSdkDir",
"WindowsSDKLibVersion",
"WindowsSDKVersion"
)
# Run VsDevCmd inside cmd.exe because it is a batch file, then copy just the
# variables Cargo/rustc need into the GitHub Actions environment file. PowerShell
# cannot mutate the parent composite-action environment directly.
$EnvLines = & cmd.exe /c ('"{0}" -no_logo -arch={1} -host_arch={2} >nul && set' -f $VsDevCmd, $TargetArch, $HostArch)
$VcToolsInstallDir = $null
foreach ($Line in $EnvLines) {
if ($Line -notmatch "^(.*?)=(.*)$") {
continue
}
$Name = $Matches[1]
$Value = $Matches[2]
if ($VarsToExport -contains $Name) {
if ($Name -ieq "Path") {
$Name = "PATH"
}
if ($Name -eq "VCToolsInstallDir") {
$VcToolsInstallDir = $Value
}
"$Name=$Value" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
}
if (-not $VcToolsInstallDir) {
throw "VCToolsInstallDir was not exported by VsDevCmd.bat"
}
# Prefer Rust's bundled linker when rustup provides one, then Visual Studio's
# LLVM linker, and finally MSVC link.exe. This keeps the cross-compile path close
# to Rust's normal Windows MSVC behavior while still working on runner images
# where one of those linkers is absent.
$Linker = $null
$Rustc = Get-Command rustc -ErrorAction SilentlyContinue
if ($Rustc) {
$Sysroot = (& rustc --print sysroot 2>$null).Trim()
$RustHost = & rustc -vV 2>$null | Select-String "^host: " | ForEach-Object { $_.Line.Substring(6) }
if ($RustHost) {
$RustHost = $RustHost.Trim()
}
if ($Sysroot -and $RustHost) {
$RustLld = Join-Path $Sysroot "lib\rustlib\$RustHost\bin\rust-lld.exe"
if (Test-Path $RustLld) {
$Linker = $RustLld
}
}
}
if (-not $Linker) {
$Linker = Join-Path $InstallPath "VC\Tools\Llvm\x64\bin\lld-link.exe"
}
if (-not (Test-Path $Linker)) {
$Linker = Join-Path $VcToolsInstallDir "bin\Host${HostArch}\${TargetArch}\link.exe"
}
if (-not (Test-Path $Linker)) {
throw "Windows linker not found at $Linker"
}
# rustc passes `/arm64hazardfree` for ARM64 MSVC links. The lld variants on our
# Windows x64 archive producers reject that flag, including when rustc places it
# inside a response file. Compile a tiny forwarding wrapper that strips only
# that unsupported flag, then delegate every other argument to the real linker.
if ($TargetArch -eq "arm64" -and (Split-Path -Leaf $Linker) -match "lld") {
$WrapperDir = Join-Path $env:RUNNER_TEMP "msvc-lld-wrapper"
New-Item -Path $WrapperDir -ItemType Directory -Force | Out-Null
$WrapperPath = Join-Path $WrapperDir "lld-link-wrapper.exe"
$WrapperSource = @'
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
internal static class Program
{
private static int Main(string[] args)
{
var linker = Environment.GetEnvironmentVariable("MSVC_REAL_LINKER");
if (string.IsNullOrEmpty(linker))
{
Console.Error.WriteLine("MSVC_REAL_LINKER is not set");
return 1;
}
var startInfo = new ProcessStartInfo(linker)
{
UseShellExecute = false,
};
var filteredArgs = new List<string> { "-flavor", "link", "/defaultlib:ucrt", "/nodefaultlib:libucrt" };
foreach (var arg in args)
{
if (!string.Equals(arg, "/arm64hazardfree", StringComparison.OrdinalIgnoreCase))
{
filteredArgs.Add(QuoteArgument(FilterResponseFile(arg)));
}
}
startInfo.Arguments = string.Join(" ", filteredArgs);
using var process = Process.Start(startInfo);
if (process is null)
{
Console.Error.WriteLine($"Failed to start linker: {linker}");
return 1;
}
process.WaitForExit();
return process.ExitCode;
}
private static string FilterResponseFile(string argument)
{
if (argument.Length < 2 || argument[0] != '@')
{
return argument;
}
var responsePath = argument.Substring(1);
if (!File.Exists(responsePath))
{
return argument;
}
var filteredResponsePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".rsp");
var responseContents = Regex.Replace(
File.ReadAllText(responsePath),
"/arm64hazardfree",
string.Empty,
RegexOptions.IgnoreCase);
File.WriteAllText(filteredResponsePath, responseContents);
return "@" + filteredResponsePath;
}
private static string QuoteArgument(string argument)
{
if (argument.Length == 0)
{
return "\"\"";
}
if (argument.IndexOfAny(new[] { ' ', '\t', '"' }) < 0)
{
return argument;
}
var quoted = new StringBuilder("\"");
var backslashes = 0;
foreach (var character in argument)
{
if (character == '\\')
{
backslashes++;
continue;
}
if (character == '"')
{
quoted.Append('\\', (backslashes * 2) + 1);
quoted.Append(character);
backslashes = 0;
continue;
}
quoted.Append('\\', backslashes);
backslashes = 0;
quoted.Append(character);
}
quoted.Append('\\', backslashes * 2);
quoted.Append('"');
return quoted.ToString();
}
}
'@
$WrapperSourcePath = Join-Path $WrapperDir "lld-link-wrapper.cs"
$WrapperSource | Out-File -FilePath $WrapperSourcePath -Encoding utf8
$Csc = Join-Path $InstallPath "MSBuild\Current\Bin\Roslyn\csc.exe"
if (-not (Test-Path $Csc)) {
throw "csc.exe not found at $Csc"
}
& $Csc /nologo /target:exe /out:$WrapperPath $WrapperSourcePath
if ($LASTEXITCODE -ne 0) {
throw "Failed to compile lld-link wrapper"
}
"MSVC_REAL_LINKER=$Linker" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$Linker = $WrapperPath
}
Write-Output "Using Windows linker: $Linker"
$CargoTarget = $Target.ToUpperInvariant().Replace("-", "_")
"CARGO_TARGET_${CargoTarget}_LINKER=$Linker" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
@@ -1,80 +0,0 @@
name: windows-code-sign
description: Sign Windows release files with Azure Trusted Signing.
inputs:
target:
description: Target triple for the artifacts to sign.
required: true
binaries:
description: Space-delimited binary basenames to sign.
default: "codex codex-responses-api-proxy codex-windows-sandbox-setup codex-command-runner"
additional-files:
description: Newline-delimited absolute paths to additional files to sign.
default: ""
client-id:
description: Azure Trusted Signing client ID.
required: true
tenant-id:
description: Azure tenant ID for Trusted Signing.
required: true
subscription-id:
description: Azure subscription ID for Trusted Signing.
required: true
endpoint:
description: Azure Trusted Signing endpoint.
required: true
account-name:
description: Azure Trusted Signing account name.
required: true
certificate-profile-name:
description: Certificate profile name for signing.
required: true
runs:
using: composite
steps:
- name: Azure login for Trusted Signing (OIDC)
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
with:
client-id: ${{ inputs.client-id }}
tenant-id: ${{ inputs.tenant-id }}
subscription-id: ${{ inputs.subscription-id }}
- name: Prepare file list
id: prepare
shell: bash
env:
TARGET: ${{ inputs.target }}
BINARIES: ${{ inputs.binaries }}
ADDITIONAL_FILES: ${{ inputs.additional-files }}
run: |
set -euo pipefail
{
echo "files<<EOF"
for binary in ${BINARIES}; do
echo "${CARGO_TARGET_DIR}/${TARGET}/release/${binary}.exe"
done
if [[ -n "$ADDITIONAL_FILES" ]]; then
printf '%s\n' "$ADDITIONAL_FILES"
fi
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Sign Windows release files with Azure Trusted Signing
uses: azure/trusted-signing-action@1d365fec12862c4aa68fcac418143d73f0cea293 # v0.5.11
with:
endpoint: ${{ inputs.endpoint }}
trusted-signing-account-name: ${{ inputs.account-name }}
certificate-profile-name: ${{ inputs.certificate-profile-name }}
exclude-environment-credential: true
exclude-workload-identity-credential: true
exclude-managed-identity-credential: true
exclude-shared-token-cache-credential: true
exclude-visual-studio-credential: true
exclude-visual-studio-code-credential: true
exclude-azure-cli-credential: false
exclude-azure-powershell-credential: true
exclude-azure-developer-cli-credential: true
exclude-interactive-browser-credential: true
cache-dependencies: false
files: ${{ steps.prepare.outputs.files }}
@@ -1,113 +0,0 @@
<#
BuildBuddy cache keys include the action and test environment, so Bazel should
not inherit the full hosted-runner PATH on Windows. That PATH includes volatile
tool entries, such as Maven, that can change independently of this repo and
cause avoidable cache misses.
This script derives a smaller, cache-stable PATH that keeps the Windows
toolchain entries Bazel-backed CI tasks need: MSVC and Windows SDK paths,
MinGW runtime DLL paths for gnullvm-built tests, Git, PowerShell, Node, Python,
DotSlash, and the standard Windows system directories.
`prepare-bazel-ci` runs this after exporting the MSVC environment, and the script
publishes the result via `GITHUB_ENV` as `CODEX_BAZEL_WINDOWS_PATH` so later
steps can pass that explicit PATH to Bazel.
#>
$stablePathEntries = New-Object System.Collections.Generic.List[string]
$seenEntries = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::OrdinalIgnoreCase)
$windowsAppsPath = if ([string]::IsNullOrWhiteSpace($env:LOCALAPPDATA)) {
$null
} else {
"$($env:LOCALAPPDATA)\Microsoft\WindowsApps"
}
$windowsDir = if ($env:WINDIR) {
$env:WINDIR
} elseif ($env:SystemRoot) {
$env:SystemRoot
} else {
$null
}
function Add-StablePathEntry {
param([string]$PathEntry)
if ([string]::IsNullOrWhiteSpace($PathEntry)) {
return
}
if ($seenEntries.Add($PathEntry)) {
[void]$stablePathEntries.Add($PathEntry)
}
}
foreach ($pathEntry in ($env:PATH -split ';')) {
if ([string]::IsNullOrWhiteSpace($pathEntry)) {
continue
}
if (
$pathEntry -like '*Microsoft Visual Studio*' -or
$pathEntry -like '*Windows Kits*' -or
$pathEntry -like '*Microsoft SDKs*' -or
$pathEntry -eq 'C:\mingw64\bin' -or
$pathEntry -like 'C:\msys64\*\bin' -or
$pathEntry -like 'C:\Program Files\Git\*' -or
$pathEntry -like 'C:\Program Files\PowerShell\*' -or
$pathEntry -like 'C:\hostedtoolcache\windows\node\*' -or
$pathEntry -like 'C:\hostedtoolcache\windows\Python\*' -or
$pathEntry -eq 'D:\a\_temp\install-dotslash\bin' -or
($windowsDir -and ($pathEntry -eq $windowsDir -or $pathEntry -like "${windowsDir}\*"))
) {
Add-StablePathEntry $pathEntry
}
}
$gitCommand = Get-Command git -ErrorAction SilentlyContinue
if ($gitCommand) {
Add-StablePathEntry (Split-Path $gitCommand.Source -Parent)
}
$nodeCommand = Get-Command node -ErrorAction SilentlyContinue
if ($nodeCommand) {
Add-StablePathEntry (Split-Path $nodeCommand.Source -Parent)
}
$python3Command = Get-Command python3 -ErrorAction SilentlyContinue
if ($python3Command) {
Add-StablePathEntry (Split-Path $python3Command.Source -Parent)
}
$pythonCommand = Get-Command python -ErrorAction SilentlyContinue
if ($pythonCommand) {
Add-StablePathEntry (Split-Path $pythonCommand.Source -Parent)
}
$pwshCommand = Get-Command pwsh -ErrorAction SilentlyContinue
if ($pwshCommand) {
Add-StablePathEntry (Split-Path $pwshCommand.Source -Parent)
}
foreach ($mingwPath in @('C:\mingw64\bin', 'C:\msys64\mingw64\bin', 'C:\msys64\ucrt64\bin')) {
if (Test-Path $mingwPath) {
Add-StablePathEntry $mingwPath
}
}
if ($windowsAppsPath) {
Add-StablePathEntry $windowsAppsPath
}
if ($stablePathEntries.Count -eq 0) {
throw 'Failed to derive cache-stable Windows PATH.'
}
if ([string]::IsNullOrWhiteSpace($env:GITHUB_ENV)) {
throw 'GITHUB_ENV must be set.'
}
$stablePath = $stablePathEntries -join ';'
Write-Host 'Derived CODEX_BAZEL_WINDOWS_PATH entries:'
foreach ($pathEntry in $stablePathEntries) {
Write-Host " $pathEntry"
}
"CODEX_BAZEL_WINDOWS_PATH=$stablePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
@@ -261,6 +261,12 @@ target_cxx_var="CXX_${TARGET}"
target_cxx_var="${target_cxx_var//-/_}"
echo "${target_cxx_var}=${cxx}" >> "$GITHUB_ENV"
# Fold identical code and pack relocations for x86-64 musl release packages.
if [[ "${TARGET}" == "x86_64-unknown-linux-musl" && "${CODEX_MUSL_RELEASE_LINK_FLAGS:-}" == "1" ]]; then
link_flags=(-Cllvm-args=--addrsig -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--icf=safe,-z,pack-relative-relocs)
echo "RUSTFLAGS=${RUSTFLAGS:+$RUSTFLAGS }${link_flags[*]}" >> "$GITHUB_ENV"
fi
cargo_linker_var="CARGO_TARGET_${TARGET^^}_LINKER"
cargo_linker_var="${cargo_linker_var//-/_}"
echo "${cargo_linker_var}=${musl_linker}" >> "$GITHUB_ENV"
@@ -68,19 +68,21 @@ for command_name in python3 zip; do
fi
done
missing_environment=0
for variable_name in \
APPLE_NOTARIZATION_AKV_KEY_NAME \
AZURE_KEYVAULT_NAME
do
if [[ -z "${!variable_name:-}" ]]; then
echo "$variable_name must be configured before notarizing a binary." >&2
missing_environment=1
fi
done
if [[ "${APPLE_NOTARIZATION_BACKEND:-akv}" != signer-service ]]; then
missing_environment=0
for variable_name in \
APPLE_NOTARIZATION_AKV_KEY_NAME \
AZURE_KEYVAULT_NAME
do
if [[ -z "${!variable_name:-}" ]]; then
echo "$variable_name must be configured before notarizing a binary." >&2
missing_environment=1
fi
done
if [[ "$missing_environment" -ne 0 ]]; then
exit 2
if [[ "$missing_environment" -ne 0 ]]; then
exit 2
fi
fi
mkdir -p "$report_dir"
@@ -15,6 +15,7 @@ import time
import urllib.error
import urllib.parse
import urllib.request
import uuid
from dataclasses import dataclass
from pathlib import Path
from typing import Any
@@ -165,14 +166,22 @@ def base64url_decode(value: str) -> bytes:
def create_apple_jwt(
configuration: NotarizationConfiguration, *, issued_at: int
configuration: NotarizationConfiguration | None, *, issued_at: int
) -> str:
"""Create an authentication token for notarization requests."""
"""Create Apple's JWT; a None configuration selects Signer Service."""
header = {"alg": "ES256", "kid": configuration.apple_key_id, "typ": "JWT"}
header = {
"alg": "ES256",
"kid": configuration.apple_key_id
if configuration
else os.environ["APPLE_NOTARIZATION_KEY_ID"],
"typ": "JWT",
}
# Restrict the token to notarization requests.
claims = {
"iss": configuration.issuer_id,
"iss": configuration.issuer_id
if configuration
else os.environ["APPLE_NOTARIZATION_ISSUER_ID"],
"iat": issued_at,
"exp": issued_at + JWT_LIFETIME_SECONDS,
"aud": "appstoreconnect-v1",
@@ -186,6 +195,9 @@ def create_apple_jwt(
)
signing_input = f"{encoded_header}.{encoded_claims}"
digest = hashlib.sha256(signing_input.encode("ascii")).digest()
if configuration is None:
signature = sign_digest_with_signer_service(digest)
return f"{signing_input}.{base64url_encode(signature)}"
key_url = configuration.versioned_key_id
request_body = json.dumps({"alg": "ES256", "value": base64url_encode(digest)})
@@ -240,6 +252,87 @@ def create_apple_jwt(
return f"{signing_input}.{base64url_encode(signature)}"
def sign_digest_with_signer_service(digest: bytes) -> bytes:
"""Sign the Apple JWT digest with the configured Signer Service key."""
endpoint = os.environ["APPLE_NOTARIZATION_SIGNER_ENDPOINT"]
url = urllib.parse.urlsplit(os.environ["ACTIONS_ID_TOKEN_REQUEST_URL"])
query = dict(urllib.parse.parse_qsl(url.query), audience=endpoint)
request = urllib.request.Request(
urllib.parse.urlunsplit(url._replace(query=urllib.parse.urlencode(query))),
headers={
"Authorization": "Bearer " + os.environ["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]
},
)
try:
with urllib.request.urlopen(request, timeout=30) as response:
token = json.load(response)["value"]
except urllib.error.HTTPError as error:
raise NotarizationError(
f"GitHub OIDC request returned HTTP {error.code}"
) from None
except OSError:
raise NotarizationError(
"GitHub OIDC request failed; transport details redacted"
) from None
except (ValueError, KeyError, TypeError):
raise NotarizationError(
"GitHub OIDC returned an invalid token response"
) from None
proto = Path(os.environ["APPLE_NOTARIZATION_SIGNER_PROTO"])
try:
result = subprocess.run(
[
"grpcurl",
"-import-path",
str(proto.parent),
"-proto",
proto.name,
"-max-time",
"30",
"-expand-headers",
"-rpc-header",
"authorization: Bearer ${NOTARIZATION_OIDC_TOKEN}",
"-rpc-header",
f"x-openai-route-key: {uuid.uuid4()}",
"-d",
"@",
urllib.parse.urlsplit(endpoint).netloc + ":443",
"oaiproto.security.signer.v1.SignerService/Sign",
],
input=json.dumps(
{
"purpose": os.environ["APPLE_NOTARIZATION_SIGNER_PURPOSE"],
"digest": base64.b64encode(digest).decode(),
}
),
env={**os.environ, "NOTARIZATION_OIDC_TOKEN": token},
check=True,
capture_output=True,
text=True,
)
except (OSError, subprocess.CalledProcessError):
# grpcurl errors may contain authorization headers or response bodies.
raise NotarizationError(
"Signer Service signing request failed; details redacted"
) from None
try:
result = json.loads(result.stdout)
key_id, algorithm = result["keyId"], result["algorithm"]
signature = base64.b64decode(result["signature"], validate=True)
except (ValueError, KeyError, TypeError):
raise NotarizationError(
"Signer Service returned an invalid signing response"
) from None
if key_id != os.environ["APPLE_NOTARIZATION_SIGNER_KEY_ID"]:
raise NotarizationError("Signer Service returned an unexpected signing key")
if algorithm != "SIGNING_ALGORITHM_ECDSA_P256_SHA256":
raise NotarizationError(
"Signer Service returned an unexpected signing algorithm"
)
return signature
def json_request(
url: str, token: str, *, body: dict[str, Any] | None = None
) -> dict[str, Any]:
@@ -416,12 +509,12 @@ def write_developer_log(
def notarize(
path: Path,
configuration: NotarizationConfiguration,
configuration: NotarizationConfiguration | None,
*,
max_wait_seconds: int,
report_log: Path | None,
) -> str:
"""Submit an artifact, upload it to Apple, and wait for a terminal result."""
"""Submit an artifact and await Apple's result; None selects Signer Service."""
issued_at = int(time.time())
token = create_apple_jwt(configuration, issued_at=issued_at)
@@ -503,13 +596,24 @@ def main() -> int:
raise NotarizationError("--max-wait-seconds must be non-negative")
if arguments.report_log is not None:
arguments.report_log.parent.mkdir(parents=True, exist_ok=True)
backend = os.environ.get("APPLE_NOTARIZATION_BACKEND", "akv")
if backend not in {"akv", "signer-service"}:
raise NotarizationError(
"APPLE_NOTARIZATION_BACKEND must be akv or signer-service"
)
configuration = (
NotarizationConfiguration.from_environment() if backend == "akv" else None
)
notarize(
arguments.file,
NotarizationConfiguration.from_environment(),
configuration,
max_wait_seconds=arguments.max_wait_seconds,
report_log=arguments.report_log,
)
except NotarizationError as error:
except KeyError as error:
print(f"Missing notarization configuration: {error.args[0]}", file=sys.stderr)
return 1
except (NotarizationError, OSError) as error:
print(f"Notarization failed: {error}", file=sys.stderr)
return 1
return 0
@@ -188,15 +188,20 @@ def verify(package, reports, expected_target, configuration: ProfileConfiguratio
binary = package / relative
target = package / APP if relative == EXECUTABLE else binary
prefix = reports / f"{binary.name}-cert-"
subprocess.run(
["codesign", "-d", f"--extract-certificates={prefix}", str(target)],
check=True,
)
if (
hashlib.sha256(Path(f"{prefix}0").read_bytes()).hexdigest()
!= configuration.certificate_sha256
):
raise ValueError(f"Unexpected signing certificate: {relative}")
verify_certificate(target, prefix, configuration)
def verify_certificate(target, prefix, configuration: ProfileConfiguration):
"""Require the independently approved leaf certificate for each signed executable."""
subprocess.run(
["codesign", "-d", f"--extract-certificates={prefix}", str(target)],
check=True,
)
if (
hashlib.sha256(Path(f"{prefix}0").read_bytes()).hexdigest()
!= configuration.certificate_sha256
):
raise ValueError(f"Unexpected signing certificate: {target}")
def parse_profile_args(parser, configuration: ProfileConfiguration | None):
@@ -12,7 +12,7 @@ import provisioned_macos_cli_package as bundle
def main(configuration: bundle.ProfileConfiguration | None = None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("operation", choices=("sign", "verify"))
parser.add_argument("operation", choices=("sign", "sign-only", "verify"))
parser.add_argument("package", type=Path)
args, configuration = bundle.parse_profile_args(parser, configuration)
package = args.package.resolve(strict=True)
@@ -24,11 +24,13 @@ def main(configuration: bundle.ProfileConfiguration | None = None):
reports = Path(repo_root) / "signing-verification"
reports.mkdir(parents=True, exist_ok=True)
provisioned = os.environ.get("PROVISIONED_MACOS", "false") == "true"
signing = args.operation in ("sign", "sign-only")
if signing:
configuration.validate_signing_certificate(
Path(os.environ["OAI_AKV_SIGNING_CERTIFICATE_PEM"])
)
if provisioned:
if args.operation == "sign":
configuration.validate_signing_certificate(
Path(os.environ["OAI_AKV_SIGNING_CERTIFICATE_PEM"])
)
if signing:
bundle.prepare(package, reports, configuration)
else:
bundle.verify(package, reports, os.environ["TARGET"], configuration)
@@ -44,7 +46,7 @@ def main(configuration: bundle.ProfileConfiguration | None = None):
target = package / bundle.APP
identifier = bundle.CODE_SIGNING_ID
entitlements = reports / "codex-provisioned-entitlements.plist"
if args.operation == "sign":
if signing:
command = [
"bash",
str(bundle.SIGNING / "sign_macos_code.sh"),
@@ -72,7 +74,7 @@ def main(configuration: bundle.ProfileConfiguration | None = None):
stdout=output,
check=True,
)
if not provisioned:
if args.operation == "sign" and not provisioned:
subprocess.run(
[
"bash",
@@ -103,11 +105,11 @@ def main(configuration: bundle.ProfileConfiguration | None = None):
" and certificate 1[field.1.2.840.113635.100.6.2.6] exists"
" and certificate leaf[field.1.2.840.113635.100.6.1.13] exists"
)
requirement += (
f' and certificate leaf[subject.OU] = "{configuration.team_id}"'
)
if provisioned and relative == "bin/codex":
requirement += (
f' and identifier "{bundle.CODE_SIGNING_ID}"'
f' and certificate leaf[subject.OU] = "{configuration.team_id}"'
)
requirement += f' and identifier "{bundle.CODE_SIGNING_ID}"'
subprocess.run(
[
"codesign",
@@ -120,6 +122,10 @@ def main(configuration: bundle.ProfileConfiguration | None = None):
],
check=True,
)
if not provisioned:
bundle.verify_certificate(
target, reports / f"{name}-cert-", configuration
)
signature = reports / f"{name}-signature.txt"
with signature.open("wb") as output:
subprocess.run(
@@ -1,3 +1,4 @@
import base64
import contextlib
import hashlib
import io
@@ -148,6 +149,73 @@ class NotarizationTest(unittest.TestCase):
):
notary.create_apple_jwt(CONFIGURATION, issued_at=1)
def test_signer_service_refreshes_tokens_without_azure(self):
environment = {
"APPLE_NOTARIZATION_BACKEND": "signer-service",
"APPLE_NOTARIZATION_ISSUER_ID": CONFIGURATION.issuer_id,
"APPLE_NOTARIZATION_KEY_ID": CONFIGURATION.apple_key_id,
"APPLE_NOTARIZATION_SIGNER_ENDPOINT": "https://signer.example.com",
"APPLE_NOTARIZATION_SIGNER_PURPOSE": "test-notarization",
"APPLE_NOTARIZATION_SIGNER_KEY_ID": "expected-key",
"APPLE_NOTARIZATION_SIGNER_PROTO": "/tmp/notarization_signer.proto",
"ACTIONS_ID_TOKEN_REQUEST_URL": "https://pipelines.actions.githubusercontent.com/token",
"ACTIONS_ID_TOKEN_REQUEST_TOKEN": "request-secret",
}
with (
tempfile.NamedTemporaryFile() as artifact,
patch.dict(os.environ, environment, clear=True),
patch.object(
sys, "argv", ["notarize_with_akv.py", "--file", artifact.name]
),
patch.object(notary.time, "time", side_effect=[1, 900, 900]),
patch.object(
notary,
"json_request",
side_effect=[
{"data": {"id": "submission-1", "attributes": CREDENTIALS}},
{"data": {"attributes": {"status": "Accepted"}}},
],
) as request,
patch.object(notary, "upload_to_apple_s3"),
patch.object(
notary.urllib.request,
"urlopen",
side_effect=[
response({"value": "first-oidc"}),
response({"value": "fresh-oidc"}),
],
),
patch.object(
notary.subprocess,
"run",
return_value=azure_response(
{
"keyId": "expected-key",
"algorithm": "SIGNING_ALGORITHM_ECDSA_P256_SHA256",
"signature": base64.b64encode(bytes(64)).decode(),
}
),
) as sign,
):
self.assertEqual(notary.main(), 0)
self.assertEqual(
[
json.loads(notary.base64url_decode(entry.args[1].split(".")[1]))["iat"]
for entry in request.call_args_list
],
[1, 900],
)
self.assertEqual(
[entry.args[0][0] for entry in sign.call_args_list], ["grpcurl", "grpcurl"]
)
self.assertEqual(
[
entry.kwargs["env"]["NOTARIZATION_OIDC_TOKEN"]
for entry in sign.call_args_list
],
["first-oidc", "fresh-oidc"],
)
def test_uploads_polls_and_retains_sanitized_apple_diagnostics(self) -> None:
signature = azure_response(
{
@@ -224,8 +292,17 @@ class NotarizationWrapperTest(unittest.TestCase):
f"#!/usr/bin/env bash\nset -euo pipefail\n{body}\n"
)
executable.chmod(0o755)
for kind in ("binary", "dmg"):
with self.subTest(kind=kind):
for kind, backend in (
("binary", "akv"),
("dmg", "akv"),
("binary", "signer-service"),
):
selected_environment = dict(environment)
if backend == "signer-service":
selected_environment["APPLE_NOTARIZATION_BACKEND"] = backend
for name in ENVIRONMENT:
selected_environment.pop(name, None)
with self.subTest(kind=kind, backend=backend):
artifact = root / ("codex.dmg" if kind == "dmg" else "codex")
artifact.write_bytes(b"signed release artifact")
subprocess.run(
@@ -238,7 +315,7 @@ class NotarizationWrapperTest(unittest.TestCase):
"--report-dir",
str(root / "report"),
],
env=environment,
env=selected_environment,
check=True,
capture_output=True,
text=True,
@@ -26,7 +26,7 @@ with open(os.environ["CALL_LOG"], "a") as log:
if name == "codesign":
for arg in args:
if arg.startswith("--extract-certificates="):
Path(arg.split("=", 1)[1] + "0").write_bytes(Path(os.environ["MOCK_CERTIFICATE"]).read_bytes())
Path(arg.split("=", 1)[1] + "0").write_bytes(b"wrong certificate" if os.environ.get("MOCK_WRONG_CERTIFICATE") else Path(os.environ["MOCK_CERTIFICATE"]).read_bytes())
if "--test-requirement" in args and os.environ.get("MOCK_WRONG_SIGNING_IDENTITY"):
print("code failed to satisfy specified code requirement(s)", file=sys.stderr)
sys.exit(1)
@@ -149,6 +149,26 @@ class MacosSigningTests(ProvisioningTestCase):
check=False,
)
def test_sign_only_signs_standard_package_without_notarization(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory).resolve()
package, driver, env = self.fixture(root, False, "aarch64-apple-darwin")
result = self.run_driver(driver, "sign-only", package, env)
self.assertEqual(result.returncode, 0, result.stderr)
calls = [
json.loads(line)
for line in (root / "calls.jsonl").read_text().splitlines()
]
self.assertEqual(
[
call[call.index("--target") + 1]
for call in calls
if call[0] == "sign_macos_code.sh"
],
[str(package / path) for path in ("bin/codex", *bundle.HELPERS)],
)
self.assertFalse(any(call[0].startswith("notarize") for call in calls))
def test_standard_and_provisioned_signing_and_verification(self):
for provisioned, target, omit_empty in itertools.product(
(False, True),
@@ -333,6 +353,7 @@ class MacosSigningTests(ProvisioningTestCase):
(
"MOCK_WRONG_SIGNING_IDENTITY",
"MOCK_WRONG_ENTITLEMENTS",
"MOCK_WRONG_CERTIFICATE",
"MOCK_EXECUTOR_ENTITLEMENTS",
),
):
@@ -353,6 +374,8 @@ class MacosSigningTests(ProvisioningTestCase):
"code failed to satisfy specified code requirement(s)",
result.stderr,
)
elif failure == "MOCK_WRONG_CERTIFICATE":
self.assertIn("Unexpected signing certificate", result.stderr)
else:
self.assertIn("unexpected", result.stdout)
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail
repo_api="repos/$GITHUB_REPOSITORY"
# Look up this tag, including drafts. A lookup error must abort publication.
# shellcheck disable=SC2016
exists="$(gh api graphql \
-f query='query($owner:String!,$repo:String!,$tag:String!){repository(owner:$owner,name:$repo){release(tagName:$tag){databaseId}}}' \
-f owner="$GITHUB_REPOSITORY_OWNER" \
-f repo="${GITHUB_REPOSITORY#*/}" \
-f tag="$GITHUB_REF_NAME" \
--jq '.data.repository.release != null')"
if [[ "$exists" == false ]]; then
# The create API would create a missing tag from the default branch.
gh api --silent "$repo_api/git/ref/tags/$GITHUB_REF_NAME"
draft=true
if [[ "$PRERELEASE" == true ]]; then
# Create prereleases directly to preserve the prereleased event.
draft=false
fi
release_id="$(gh api --method POST "$repo_api/releases" \
-f tag_name="$GITHUB_REF_NAME" -f name="$RELEASE_NAME" -F "body=@$RELEASE_NOTES" \
-F draft="$draft" -F prerelease="$PRERELEASE" -f make_latest=false --jq '.id')"
if [[ "$PRERELEASE" == true ]]; then
# A maintainer can replace a release under the same tag during upload.
trap '
echo "Removing incomplete prerelease $release_id" >&2
gh api --method DELETE "$repo_api/releases/$release_id" || true
' EXIT
fi
fi
mapfile -d '' assets < <(find dist -type f -print0 | sort -z)
gh release upload "$GITHUB_REF_NAME" "${assets[@]}" --repo "$GITHUB_REPOSITORY" --clobber
trap - EXIT
gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" \
--title "$RELEASE_NAME" --notes-file "$RELEASE_NOTES" --prerelease="$PRERELEASE" \
--draft=false --latest="$MAKE_LATEST"
@@ -1,103 +0,0 @@
#!/usr/bin/env python3
"""Assign Windows Bazel test targets using checked-in duration estimates."""
import argparse
import sys
from pathlib import Path
DEFAULT_DURATION_SECONDS = 1
DURATIONS_PATH = Path(__file__).with_name("windows_bazel_test_durations.tsv")
def read_durations(path: Path) -> dict[str, int]:
durations = {}
for line_number, line in enumerate(
path.read_text(encoding="utf-8").splitlines(), 1
):
if not line.strip() or line.lstrip().startswith("#"):
continue
fields = line.split("\t")
if len(fields) != 2 or not fields[0] or not fields[1].isdecimal():
raise ValueError(
f"{path}:{line_number}: expected target<TAB>positive integer"
)
target, duration_text = fields
duration = int(duration_text)
if duration < 1:
raise ValueError(f"{path}:{line_number}: duration must be positive")
if target in durations:
raise ValueError(f"{path}:{line_number}: duplicate target {target}")
durations[target] = duration
return durations
def assign_targets(
targets: list[str], durations: dict[str, int], shard_count: int
) -> tuple[list[list[str]], list[int]]:
if shard_count < 1:
raise ValueError("shard count must be positive")
if not targets:
raise ValueError("no Bazel test targets were provided")
if any(not target.strip() for target in targets):
raise ValueError("Bazel test target labels must not be empty")
if len(targets) != len(set(targets)):
raise ValueError("duplicate Bazel test target labels were provided")
assignments: list[list[str]] = [[] for _ in range(shard_count)]
loads = [0] * shard_count
# Place the longest targets first, breaking ties by label and shard number.
for target in sorted(
targets,
key=lambda target: (-durations.get(target, DEFAULT_DURATION_SECONDS), target),
):
shard = min(range(shard_count), key=lambda shard: (loads[shard], shard))
assignments[shard].append(target)
loads[shard] += durations.get(target, DEFAULT_DURATION_SECONDS)
for assignment in assignments:
assignment.sort()
return assignments, loads
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--shard", required=True, type=int)
parser.add_argument("--shard-count", required=True, type=int)
parser.add_argument(
"--durations",
type=Path,
default=DURATIONS_PATH,
help="use this timing file instead of the checked-in default",
)
args = parser.parse_args()
if not 1 <= args.shard <= args.shard_count:
parser.error("shard must be between 1 and shard count")
try:
durations = read_durations(args.durations)
targets = sys.stdin.read().splitlines()
assignments, loads = assign_targets(targets, durations, args.shard_count)
except (OSError, ValueError) as error:
parser.error(str(error))
selected_targets = assignments[args.shard - 1]
if not selected_targets:
parser.error(
f"no Bazel test targets selected for shard {args.shard}/{args.shard_count}"
)
target_set = set(targets)
print(
f"Windows Bazel shards: targets={[len(assignment) for assignment in assignments]}, "
f"estimated test-seconds={loads}, default weights={len(target_set - durations.keys())}, "
f"unused weights={len(durations.keys() - target_set)}. "
f"Selected shard {args.shard}/{args.shard_count}.",
file=sys.stderr,
)
# Keep LF delimiters when native Windows Python feeds Git Bash mapfile.
sys.stdout.buffer.write(("\n".join(selected_targets) + "\n").encode("utf-8"))
if __name__ == "__main__":
main()
-63
View File
@@ -1,63 +0,0 @@
# Configure a fast drive for Windows CI jobs.
#
# GitHub-hosted Windows runners do not always expose a secondary D: volume. When
# they do not, create a Dev Drive VHD. CI depends on this path for its
# build directories where CI spends significant time doing I/O, so fail the
# job if no real Dev Drive is available.
function Test-DevDrive {
param([string]$Drive)
& fsutil devdrv query $Drive *> $null
return $LASTEXITCODE -eq 0
}
function Invoke-BestEffort {
param([scriptblock]$Script, [string]$Description)
try {
& $Script
} catch {
Write-Warning "$Description failed: $($_.Exception.Message)"
}
}
if ((Test-Path "D:\") -and (Test-DevDrive "D:")) {
Write-Output "Using existing Dev Drive at D:"
$Drive = "D:"
} else {
if (Test-Path "D:\") {
Write-Output "Existing D: volume is not a Dev Drive; provisioning a new Dev Drive VHD."
}
try {
$VhdPath = Join-Path $env:RUNNER_TEMP "codex-dev-drive.vhdx"
$SizeBytes = 64GB
if (Test-Path $VhdPath) {
Remove-Item -Path $VhdPath -Force
}
New-VHD -Path $VhdPath -SizeBytes $SizeBytes -Dynamic -ErrorAction Stop | Out-Null
$Mounted = Mount-VHD -Path $VhdPath -Passthru -ErrorAction Stop
$Disk = $Mounted | Get-Disk -ErrorAction Stop
$Disk | Initialize-Disk -PartitionStyle GPT -ErrorAction Stop
$Partition = $Disk | New-Partition -AssignDriveLetter -UseMaximumSize -ErrorAction Stop
$Volume = $Partition | Format-Volume -FileSystem ReFS -NewFileSystemLabel "CodexDevDrive" -DevDrive -Confirm:$false -Force -ErrorAction Stop
$Drive = "$($Volume.DriveLetter):"
if (-not (Test-DevDrive $Drive)) {
throw "Provisioned volume at $Drive did not pass Dev Drive verification."
}
Invoke-BestEffort { fsutil devdrv trust $Drive } "Trusting Dev Drive $Drive"
Invoke-BestEffort { fsutil devdrv enable /disallowAv } "Disabling AV filter attachment for Dev Drives"
Write-Output "Using Dev Drive at $Drive"
} catch {
throw "Failed to create Dev Drive: $($_.Exception.Message)"
}
}
"CI_BUILD_ROOT=$Drive" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
-96
View File
@@ -1,96 +0,0 @@
# CI-only prerequisites. Never install these tools into a Codex package.
param(
[Parameter(Mandatory = $true)][string]$Target,
[Parameter(Mandatory = $true)][string]$SnapshotArchive
)
$ErrorActionPreference = "Stop"
$PkgHashes = @{
"x86_64-pc-windows-msvc" = @("x64", "5604cf25ef38bb6a09520cff25ae9f0ecd8c2443053b15e40df4ad1eae0e4405")
"aarch64-pc-windows-msvc" = @("arm64", "d5752ce2ac2296c8abb91fb12c12e75ee99ba8a18b52ce5febf325847b6f062b")
}
if (-not $PkgHashes.ContainsKey($Target)) { throw "Unsupported target: $Target" }
$Root = Join-Path $env:RUNNER_TEMP "voice-windows-build-tools"
$Evidence = Join-Path $Root "evidence"
$Cygwin = Join-Path $Root "cygwin"
$Cache = Join-Path $Root "cache"
New-Item -ItemType Directory -Path $Root, $Evidence | Out-Null
$ManifestPath = Join-Path $PSScriptRoot "voice-cygwin-snapshot.json"
$Manifest = Get-Content -Raw $ManifestPath | ConvertFrom-Json
$SnapshotTool = Join-Path $PSScriptRoot "voice-cygwin-inputs.py"
& python $SnapshotTool extract --archive $SnapshotArchive --directory (Join-Path $Cache $Manifest.cacheDirectory)
if ($LASTEXITCODE -ne 0) { throw "Cygwin snapshot could not be verified and extracted" }
Copy-Item $ManifestPath (Join-Path $Evidence "cygwin-snapshot.json")
# Official https://cygwin.com/setup/sha512.sum and pkgconf release asset digests.
# The complete package closure is pinned separately in cygwin-snapshot.json.
$Inputs = @(
@{
url = "https://cygwin.com/setup/setup-2.937.x86_64.exe"
file = "setup.exe"
algorithm = "SHA512"
digest = "6acea47c59781c9e7f544a18d53935d59df6e44d5d52ac95ee165671b8e388820455eebf30ccc7d254b00c3d0eb694269a0f8dc84b17944c1f355dac9c5aafcc"
},
@{
url = "https://github.com/pkgconf/pkgconf/releases/download/pkgconf-3.0.6/pkgconf-$($PkgHashes[$Target][0])-3.0.6.msi"
file = "pkgconf.msi"
algorithm = "SHA256"
digest = $PkgHashes[$Target][1]
}
)
foreach ($InputFile in $Inputs) {
$Destination = Join-Path $Root $InputFile.file
Invoke-WebRequest -Uri $InputFile.url -OutFile $Destination
$Actual = (Get-FileHash -Path $Destination -Algorithm $InputFile.algorithm).Hash.ToLowerInvariant()
if ($Actual -ne $InputFile.digest) { throw "Build input digest mismatch: $($InputFile.file)" }
}
$Inputs | ConvertTo-Json | Set-Content (Join-Path $Evidence "bootstrap-inputs.json")
$Packages = $Manifest.requestedPackages -join ","
# Only setup.xz + setup.xz.sig are present: local mode still verifies that
# signature. Never substitute an unsigned setup.ini or enable a network fallback.
$Setup = Start-Process -FilePath (Join-Path $Root "setup.exe") -Wait -PassThru -ArgumentList @(
"--quiet-mode", "--no-admin", "--no-shortcuts", "--only-site",
"--local-install", "--no-version-check",
"--root", "`"$Cygwin`"", "--local-package-dir", "`"$Cache`"",
"--packages", $Packages
)
if ($Setup.ExitCode -ne 0) { throw "Cygwin setup failed: $($Setup.ExitCode)" }
Copy-Item (Join-Path $Cygwin "var/log/setup.log*") $Evidence
Copy-Item (Join-Path $Cygwin "etc/setup/installed.db") $Evidence
& (Join-Path $Cygwin "bin/cygcheck.exe") -cd | Set-Content (Join-Path $Evidence "packages.txt")
if ($LASTEXITCODE -ne 0) { throw "Cannot inventory Cygwin packages" }
& python $SnapshotTool check-installed --inventory (Join-Path $Evidence "packages.txt")
if ($LASTEXITCODE -ne 0) { throw "Installed Cygwin package set differs from the snapshot" }
Get-ChildItem $Cache -File -Recurse | ForEach-Object {
@{ file = [IO.Path]::GetRelativePath($Cache, $_.FullName); bytes = $_.Length;
sha512 = (Get-FileHash $_.FullName -Algorithm SHA512).Hash.ToLowerInvariant() }
} | ConvertTo-Json | Set-Content (Join-Path $Evidence "package-cache.json")
# Administrative extraction uses TARGETDIR, not a normal MSI installation:
# no product registration or system PATH modification. Fail rather than fall
# back to an ambient executable or ordinary installer if the payload is absent.
$Image = Join-Path $Root "pkgconf-image"
$Extract = Start-Process msiexec.exe -Wait -PassThru -ArgumentList @(
"/a", "`"$(Join-Path $Root 'pkgconf.msi')`"", "/qn", "/norestart",
"TARGETDIR=`"$Image`"", "/L*v", "`"$(Join-Path $Evidence 'pkgconf-extract.log')`""
)
if ($Extract.ExitCode -ne 0) { throw "pkgconf extraction failed: $($Extract.ExitCode)" }
$Candidates = @(Get-ChildItem $Image -Filter pkgconf.exe -File -Recurse)
if ($Candidates.Count -ne 1) { throw "Expected exactly one native pkgconf executable" }
# Bazel shell-quotes execpaths containing spaces; Cargo executes PKG_CONFIG
# directly. Keep the executable and its support files at a space-free execpath.
$Native = Join-Path $Image "native"
if (Test-Path $Native) { throw "Native pkgconf destination must be fresh" }
Move-Item -LiteralPath $Candidates[0].Directory.FullName -Destination $Native
$PkgConfig = Join-Path $Native "pkgconf.exe"
$Version = & $PkgConfig --version
if ($LASTEXITCODE -ne 0 -or $Version -ne "3.0.6") { throw "Unexpected native pkgconf version" }
@{ target = $Target; cygwin_root = $Cygwin; pkg_config = $PkgConfig;
pkgconf_version = $Version; requested_packages = $Packages } |
ConvertTo-Json | Set-Content (Join-Path $Evidence "tools.json")
# Declare complete installed support trees only after snapshot and tool checks.
& python (Join-Path $PSScriptRoot "voice_windows_tools.py") --root $Root --target $Target --pkg-config $PkgConfig
if ($LASTEXITCODE -ne 0) { throw "Cannot declare Windows Bazel tool inputs" }
"VOICE_WINDOWS_BAZEL_REPOSITORY=$Root" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
"VOICE_CYGWIN_ROOT=$Cygwin" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
"VOICE_PKG_CONFIG=$PkgConfig" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
+118
View File
@@ -1,10 +1,13 @@
import io
import json
import os
from pathlib import Path
import re
import shutil
import subprocess
import tarfile
import tempfile
import textwrap
import unittest
from unittest.mock import patch
@@ -261,6 +264,121 @@ class DotSlashReleaseConfigTests(unittest.TestCase):
class StablePublicationTests(unittest.TestCase):
def test_github_release_upload_and_cleanup(self):
bash = shutil.which("bash")
if bash is None:
self.skipTest("Release workflow requires Bash 4.4 or newer")
version = subprocess.check_output(
[bash, "-c", 'echo "${BASH_VERSINFO[0]} ${BASH_VERSINFO[1]}"'],
text=True,
)
if tuple(map(int, version.split())) < (4, 4):
self.skipTest("Release workflow requires Bash 4.4 or newer")
script = Path(__file__).resolve().with_name("publish-github-release.sh")
with tempfile.TemporaryDirectory() as tmpdir:
root = Path(tmpdir)
gh = root / "gh"
gh.write_text(
textwrap.dedent("""\
#!/usr/bin/env bash
set -euo pipefail
case "$1 $2" in
'api graphql')
if compgen -G 'release-*' >/dev/null; then echo true; else echo false; fi ;;
'api --silent')
[[ "$3" == "repos/test/codex/git/ref/tags/$GITHUB_REF_NAME" ]]
[[ -f "${3##*/}.tag" ]] || exit 5 ;;
'api --method')
case "$3 $4" in
'POST repos/test/codex/releases')
printf '%s\\n' "$@" > "release-$CREATE_ID"
echo "$CREATE_ID" ;;
'DELETE repos/test/codex/releases/'*)
echo "DELETE $4" >> operations
rm -- "release-${4##*/}" ;;
*) exit 99 ;;
esac ;;
'release upload')
echo upload >> operations
[[ "$3" == "$GITHUB_REF_NAME" && -f "$4" ]]
if [[ "$FAIL_AT" == replace ]]; then
mv "release-$CREATE_ID" release-999
exit 7
fi
[[ "$FAIL_AT" != upload ]] || exit 7 ;;
'release edit')
echo edit >> operations
[[ "$FAIL_AT" != edit ]] || exit 8 ;;
*) exit 99 ;;
esac
""")
)
gh.chmod(0o755)
alpha = "rust-v0.100.0-alpha.1"
delete = "DELETE repos/test/codex/releases"
# Repeated tags reuse the preceding release state for a retry.
for tag, fail_at, create_id, status, surviving_id, operations in (
(alpha, "upload", 101, 7, None, ["upload", f"{delete}/101"]),
(alpha, "", 102, 0, 102, ["upload", "edit"]),
(alpha, "upload", 103, 7, 102, ["upload"]),
("rust-v0.100.0-alpha.2", "edit", 104, 8, 104, ["upload", "edit"]),
("rust-v0.100.0", "upload", 105, 7, 105, ["upload"]),
(
"rust-v0.100.0-alpha.3",
"replace",
106,
7,
999,
["upload", f"{delete}/106"],
),
("rust-v0.100.0-alpha.4", "missing_tag", 107, 5, None, []),
):
with self.subTest(tag=tag, fail_at=fail_at):
directory = root / tag
tag_file = directory / f"{tag}.tag"
if not directory.exists():
(directory / "dist").mkdir(parents=True)
(directory / "dist/package.tar.gz").write_bytes(b"package")
(directory / "notes.md").write_text("release notes\n")
if fail_at != "missing_tag":
tag_file.touch()
operation_log = directory / "operations"
operation_log.write_text("")
prerelease = "-alpha." in tag
result = subprocess.run(
[bash, str(script)],
cwd=directory,
env={
**os.environ,
"PATH": f"{root}{os.pathsep}{os.environ['PATH']}",
"GITHUB_REPOSITORY": "test/codex",
"GITHUB_REPOSITORY_OWNER": "test",
"GITHUB_REF_NAME": tag,
"RELEASE_NAME": tag.removeprefix("rust-v"),
"RELEASE_NOTES": "notes.md",
"MAKE_LATEST": str(not prerelease).lower(),
"PRERELEASE": str(prerelease).lower(),
"FAIL_AT": fail_at,
"CREATE_ID": str(create_id),
},
capture_output=True,
text=True,
)
self.assertEqual(result.returncode, status, result.stderr)
self.assertEqual(tag_file.exists(), fail_at != "missing_tag")
self.assertEqual(operation_log.read_text().splitlines(), operations)
releases = list(directory.glob("release-*"))
self.assertEqual(
[p.name for p in releases],
[f"release-{surviving_id}"] if surviving_id else [],
)
if surviving_id:
fields = releases[0].read_text().splitlines()
self.assertIn(f"tag_name={tag}", fields)
self.assertIn(f"draft={str(not prerelease).lower()}", fields)
self.assertIn(f"prerelease={str(prerelease).lower()}", fields)
def test_github_latest_orders_numerically_and_allows_equal_reruns(self):
latest = {"tag_name": "rust-v0.100.0", "draft": False, "prerelease": False}
self.assertFalse(should_make_latest("0.99.9", latest))
@@ -1,147 +0,0 @@
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
from select_windows_bazel_targets import DURATIONS_PATH
from select_windows_bazel_targets import assign_targets
from select_windows_bazel_targets import read_durations
class SelectWindowsBazelTargetsTest(unittest.TestCase):
def test_balances_targets_with_complete_deterministic_coverage(self) -> None:
durations = {
f"//test:{name}": duration
for name, duration in zip("abcdefgh", range(8, 0, -1))
}
targets = list(durations)
assignments, loads = assign_targets(targets, durations, 4)
self.assertEqual(loads, [9, 9, 9, 9])
self.assertEqual(
sorted(target for shard in assignments for target in shard), sorted(targets)
)
self.assertEqual(
assign_targets(list(reversed(targets)), durations, 4), (assignments, loads)
)
self.assertTrue(all(shard == sorted(shard) for shard in assignments))
def test_missing_weights_use_one_and_unused_weights_do_not_create_targets(
self,
) -> None:
targets = ["//test:c", "//test:a", "//test:b"]
assignments, loads = assign_targets(targets, {"//test:stale": 100}, 2)
self.assertEqual(assignments, [["//test:a", "//test:c"], ["//test:b"]])
self.assertEqual(loads, [2, 1])
def test_rejects_empty_or_duplicate_target_input(self) -> None:
for targets in ([], [""], ["//test:a", "//test:a"]):
with self.subTest(targets=targets), self.assertRaises(ValueError):
assign_targets(targets, {}, 4)
def test_reads_duration_file_and_rejects_invalid_weights(self) -> None:
with tempfile.TemporaryDirectory() as temp_dir:
path = Path(temp_dir) / "durations.tsv"
path.write_text(
"# comment\n\n//test:a\t12\n//test:b\t1\n", encoding="utf-8"
)
self.assertEqual(read_durations(path), {"//test:a": 12, "//test:b": 1})
for contents in (
"//test:a 12\n",
"//test:a\t0\n",
"//test:a\t-1\n",
"//test:a\t1.5\n",
"//test:a\t1\n//test:a\t2\n",
):
with self.subTest(contents=contents), self.assertRaises(ValueError):
path.write_text(contents, encoding="utf-8")
read_durations(path)
def test_cli_uses_checked_in_weights_and_writes_only_lf_delimited_targets(
self,
) -> None:
durations = read_durations(DURATIONS_PATH)
known = sorted(durations, key=lambda target: (-durations[target], target))[:4]
self.assertEqual(len(known), 4)
targets = [*known, "//test:new-target"]
expected, _ = assign_targets(targets, durations, 4)
script = DURATIONS_PATH.with_name("select_windows_bazel_targets.py")
for shard, assignment in enumerate(expected, 1):
command = [
sys.executable,
str(script),
"--shard",
str(shard),
"--shard-count",
"4",
]
for ordered_targets in (targets, list(reversed(targets))):
with self.subTest(shard=shard, ordered_targets=ordered_targets):
result = subprocess.run(
command,
input=("\r\n".join(ordered_targets) + "\r\n").encode(),
capture_output=True,
check=True,
)
self.assertEqual(
result.stdout, ("\n".join(assignment) + "\n").encode()
)
self.assertIn(b"default weights=1", result.stderr)
def test_cli_uses_only_the_requested_duration_file(self) -> None:
script = DURATIONS_PATH.with_name("select_windows_bazel_targets.py").resolve()
with tempfile.TemporaryDirectory() as temp_dir:
path = Path(temp_dir) / "durations.tsv"
path.write_text("//test:a\t1\n//test:b\t9\n", encoding="utf-8")
command = [sys.executable, str(script), "--shard-count", "2"]
for shard, expected in ((1, b"//test:b\n"), (2, b"//test:a\n//test:c\n")):
with self.subTest(shard=shard):
result = subprocess.run(
[*command, "--shard", str(shard), "--durations", path.name],
input=b"//test:a\n//test:b\n//test:c\n",
cwd=temp_dir,
capture_output=True,
check=True,
)
self.assertEqual(result.stdout, expected)
self.assertIn(b"estimated test-seconds=[9, 2]", result.stderr)
self.assertIn(b"unused weights=0", result.stderr)
result = subprocess.run(
[*command, "--shard", "1", "--durations", "missing.tsv"],
input=b"//test:a\n",
cwd=temp_dir,
capture_output=True,
check=False,
)
self.assertNotEqual(result.returncode, 0)
self.assertEqual(result.stdout, b"")
self.assertIn(b"missing.tsv", result.stderr)
def test_cli_rejects_bad_or_empty_selection_without_partial_output(self) -> None:
script = DURATIONS_PATH.with_name("select_windows_bazel_targets.py")
for targets, error in (
(b"", b"no Bazel test targets were provided"),
(b"//test:a\n//test:a\n", b"duplicate Bazel test target labels"),
(b"//test:a\n", b"no Bazel test targets selected for shard 2/2"),
):
with self.subTest(targets=targets):
result = subprocess.run(
[sys.executable, str(script), "--shard", "2", "--shard-count", "2"],
input=targets,
capture_output=True,
check=False,
)
self.assertNotEqual(result.returncode, 0)
self.assertEqual(result.stdout, b"")
self.assertIn(error, result.stderr)
if __name__ == "__main__":
unittest.main()
-83
View File
@@ -1,83 +0,0 @@
"""Expose verified Windows build-tool installations as local Bazel inputs.
This declares the installed support trees; the caller authenticates their
inputs and verifies the installed package inventory first.
"""
import argparse
import itertools
import json
from pathlib import Path
import stat
def export_repository(root: Path, target: str, pkg_config: Path):
if target not in ("x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc"):
raise ValueError("unsupported Windows target")
root = root.resolve(strict=True)
pkg_config = pkg_config.resolve(strict=True)
names = {
"shell": "cygwin/bin/bash.exe",
"make": "cygwin/bin/make.exe",
"cygpath": "cygwin/bin/cygpath.exe",
"automake": "cygwin/bin/automake-1.18",
"pkg_config": pkg_config.relative_to(root).as_posix(),
}
if not names["pkg_config"].startswith("pkgconf-image/"):
raise ValueError("pkg-config must belong to the extracted image")
outputs = ("BUILD.bazel", "MODULE.bazel", "voice-tools.json")
if any((root / name).exists() for name in outputs):
raise ValueError("Bazel tool repository outputs must be fresh")
# A nested package boundary would silently remove files from Bazel's glob.
# Reparse points could escape the installation or hide support directories.
for directory in ("cygwin", "pkgconf-image"):
tree = root / directory
if not tree.is_dir():
raise ValueError(f"missing tool tree: {directory}")
for path in itertools.chain((tree,), tree.rglob("*")):
info = path.lstat()
if (
stat.S_ISLNK(info.st_mode)
or getattr(info, "st_file_attributes", 0)
& stat.FILE_ATTRIBUTE_REPARSE_POINT
or not (stat.S_ISDIR(info.st_mode) or stat.S_ISREG(info.st_mode))
or path.name.casefold() in ("build", "build.bazel")
):
raise ValueError(f"unsupported tool-tree entry: {path}")
if any(not (root / name).is_file() for name in names.values()):
raise ValueError("required Windows build tool missing")
definitions = [
'package(default_visibility = ["//visibility:public"])',
# Cygwin records installation timestamps in this unused Java truststore.
# Exclude it so reinstalling the same tools preserves action cache keys.
'filegroup(name = "cygwin", srcs = glob(["cygwin/**"], '
'exclude = ["cygwin/etc/pki/ca-trust/extracted/java/cacerts"], allow_empty = False))',
'filegroup(name = "pkgconf", srcs = glob(["pkgconf-image/**"], allow_empty = False))',
'filegroup(name = "tools", srcs = [":cygwin", ":pkgconf", "voice-tools.json"])',
]
definitions.extend(
f"filegroup(name = {json.dumps(name)}, srcs = [{json.dumps(path)}])"
for name, path in names.items()
)
metadata = {
"schemaVersion": 1,
"target": target,
"cygwinArchitecture": "x86_64",
"tools": names,
}
for name, contents in (
("BUILD.bazel", "\n".join(definitions) + "\n"),
("MODULE.bazel", 'module(name = "voice_windows_tools")\n'),
("voice-tools.json", json.dumps(metadata, indent=2) + "\n"),
):
with (root / name).open("x", encoding="utf-8") as output:
output.write(contents)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--root", type=Path, required=True)
parser.add_argument("--target", required=True)
parser.add_argument("--pkg-config", type=Path, required=True)
args = parser.parse_args()
export_repository(args.root, args.target, args.pkg_config)
@@ -1,251 +0,0 @@
# Windows Bazel duration weights; columns: target<TAB>seconds.
# Seeded from 24 successful public openai/codex Windows job logs across six main
# runs, September 21-23, 2026. Public GitHub Actions run IDs:
# 35638529858, 35665540272, 35694732932, 35912411800, 35919297566, 35924169500.
# To refresh, take the median summed inner-run time (N * average) from clean,
# uncached PASSED summaries, excluding partial cache hits and FLAKY results.
# Round up to positive integer seconds. These weights exclude build/download time.
# Every queried target is assigned; missing weights default to 1 and stale entries are ignored.
//codex-rs/agent-graph-store:agent-graph-store-unit-tests 76
//codex-rs/agent-identity:agent-identity-unit-tests 66
//codex-rs/agent-roles:agent-roles-unit-tests 48
//codex-rs/analytics:analytics-unit-tests 29
//codex-rs/app-server-client:app-server-client-unit-tests 51
//codex-rs/app-server-daemon:app-server-daemon-unit-tests 4
//codex-rs/app-server-protocol:app-server-protocol-unit-tests 19
//codex-rs/app-server-test-client:app-server-test-client-unit-tests 25
//codex-rs/app-server-test-client:codex-app-server-test-client-bin-unit-tests 1
//codex-rs/app-server-transport:app-server-transport-unit-tests 65
//codex-rs/app-server/tests/common:common-unit-tests 26
//codex-rs/app-server:app-server-all-test-windows-cross 2835
//codex-rs/app-server:app-server-unit-tests 399
//codex-rs/app-server:codex-app-server-bin-unit-tests 48
//codex-rs/app-server:codex-app-server-test-notify-capture-bin-unit-tests 1
//codex-rs/app-server:exec-server-bin-unit-tests 1
//codex-rs/app-server:test_notify_capture-bin-unit-tests 1
//codex-rs/apply-patch:apply-patch-all-test-windows-cross 50
//codex-rs/apply-patch:apply-patch-unit-tests 48
//codex-rs/apply-patch:apply_patch-bin-unit-tests 24
//codex-rs/arg0:arg0-unit-tests 24
//codex-rs/backend-client:backend-client-unit-tests 41
//codex-rs/chatgpt:chatgpt-all-test-windows-cross 26
//codex-rs/chatgpt:chatgpt-unit-tests 27
//codex-rs/cli:cli-app_server-test-windows-cross 3
//codex-rs/cli:cli-app_server_daemon-test-windows-cross 1
//codex-rs/cli:cli-cloud_auth-test-windows-cross 47
//codex-rs/cli:cli-cloud_config-test-windows-cross 3
//codex-rs/cli:cli-daemon_startup-test-windows-cross 4
//codex-rs/cli:cli-daemon_telemetry-test-windows-cross 1
//codex-rs/cli:cli-debug_clear_memories-test-windows-cross 4
//codex-rs/cli:cli-debug_models-test-windows-cross 2
//codex-rs/cli:cli-delete-test-windows-cross 2
//codex-rs/cli:cli-doctor_enterprise_network-test-windows-cross 3
//codex-rs/cli:cli-doctor_path_safety-test-windows-cross 47
//codex-rs/cli:cli-exec_server-test-windows-cross 39
//codex-rs/cli:cli-exec_server_websocket_auth-test-windows-cross 4
//codex-rs/cli:cli-execpolicy-test-windows-cross 2
//codex-rs/cli:cli-features-test-windows-cross 3
//codex-rs/cli:cli-login-test-windows-cross 4
//codex-rs/cli:cli-marketplace_add-test-windows-cross 2
//codex-rs/cli:cli-marketplace_remove-test-windows-cross 1
//codex-rs/cli:cli-marketplace_upgrade-test-windows-cross 2
//codex-rs/cli:cli-mcp_add_remove-test-windows-cross 3
//codex-rs/cli:cli-mcp_list-test-windows-cross 2
//codex-rs/cli:cli-mcp_login-test-windows-cross 2
//codex-rs/cli:cli-plugin_cli-test-windows-cross 7
//codex-rs/cli:cli-queue-test-windows-cross 1
//codex-rs/cli:cli-sandbox_cloud_config-test-windows-cross 48
//codex-rs/cli:cli-sandbox_network_proxy-test-windows-cross 1
//codex-rs/cli:cli-sandbox_tty-test-windows-cross 1
//codex-rs/cli:cli-unit-tests 2
//codex-rs/cli:cli-update-test-windows-cross 47
//codex-rs/cli:cli-worktree-test-windows-cross 12
//codex-rs/cli:codex-bin-unit-tests 60
//codex-rs/cli:logs_client-bin-unit-tests 1
//codex-rs/cloud-config:cloud-config-unit-tests 47
//codex-rs/cloud-tasks-client:cloud-tasks-client-unit-tests 35
//codex-rs/cloud-tasks-mock-client:cloud-tasks-mock-client-unit-tests 59
//codex-rs/cloud-tasks:cloud-tasks-env_filter-test-windows-cross 1
//codex-rs/cloud-tasks:cloud-tasks-unit-tests 1
//codex-rs/code-mode-host:code-mode-host-grpc-test-windows-cross 28
//codex-rs/code-mode-host:code-mode-host-grpc_notifications-test-windows-cross 25
//codex-rs/code-mode-host:code-mode-host-grpc_tcp-test-windows-cross 1
//codex-rs/code-mode-host:code-mode-host-grpc_timing-test-windows-cross 7
//codex-rs/code-mode-host:code-mode-host-stdio-test-windows-cross 11
//codex-rs/code-mode-host:code-mode-host-unit-tests 2
//codex-rs/code-mode-host:codex-code-mode-host-bin-unit-tests 1
//codex-rs/code-mode-protocol:code-mode-protocol-unit-tests 62
//codex-rs/code-mode-runtime:code-mode-runtime-array_sort-test-windows-cross 24
//codex-rs/code-mode-runtime:code-mode-runtime-jit-test-windows-cross 1
//codex-rs/code-mode-runtime:code-mode-runtime-unit-tests 7
//codex-rs/code-mode:code-mode-unit-tests 49
//codex-rs/codex-api:codex-api-clients-test-windows-cross 75
//codex-rs/codex-api:codex-api-models_integration-test-windows-cross 66
//codex-rs/codex-api:codex-api-realtime_websocket_e2e-test-windows-cross 63
//codex-rs/codex-api:codex-api-realtime_websocket_tls-test-windows-cross 66
//codex-rs/codex-api:codex-api-sse_end_to_end-test-windows-cross 48
//codex-rs/codex-api:codex-api-unit-tests 60
//codex-rs/codex-home:codex-home-unit-tests 13
//codex-rs/codex-mcp:codex-mcp-unit-tests 61
//codex-rs/config-schema:codex-write-config-schema-bin-unit-tests 48
//codex-rs/config:config-unit-tests 75
//codex-rs/connectors:connectors-unit-tests 39
//codex-rs/context-fragments:context-fragments-unit-tests 59
//codex-rs/core-api:core-api-unit-tests 1
//codex-rs/core-plugins:core-plugins-unit-tests 20
//codex-rs/core/tests/common:common-unit-tests 48
//codex-rs/core:core-all-test-windows-cross 3162
//codex-rs/core:core-mcp_trace_propagation-test-windows-cross 2
//codex-rs/core:core-responses_headers-test-windows-cross 5
//codex-rs/core:core-unit-tests 251
//codex-rs/exec-server-protocol:exec-server-protocol-unit-tests 48
//codex-rs/exec-server/tests/support:support-unit-tests 48
//codex-rs/exec-server:exec-server-accepted_websocket-test-windows-cross 1
//codex-rs/exec-server:exec-server-capability_discovery-test-windows-cross 1
//codex-rs/exec-server:exec-server-chatgpt_cloudflare_affinity-test-windows-cross 1
//codex-rs/exec-server:exec-server-deferred_environment-test-windows-cross 1
//codex-rs/exec-server:exec-server-environment-test-windows-cross 10
//codex-rs/exec-server:exec-server-environment_config-test-windows-cross 1
//codex-rs/exec-server:exec-server-exec_process-test-windows-cross 1
//codex-rs/exec-server:exec-server-file_stream-test-windows-cross 1
//codex-rs/exec-server:exec-server-file_system_unix-test-windows-cross 1
//codex-rs/exec-server:exec-server-file_system_windows-test-windows-cross 11
//codex-rs/exec-server:exec-server-forward-test-windows-cross 10
//codex-rs/exec-server:exec-server-health-test-windows-cross 1
//codex-rs/exec-server:exec-server-http_client-test-windows-cross 2
//codex-rs/exec-server:exec-server-http_request-test-windows-cross 1
//codex-rs/exec-server:exec-server-http_request_logging-test-windows-cross 3
//codex-rs/exec-server:exec-server-initialize-test-windows-cross 1
//codex-rs/exec-server:exec-server-macos_fs_spawn-test-windows-cross 1
//codex-rs/exec-server:exec-server-process-test-windows-cross 4
//codex-rs/exec-server:exec-server-relay-test-windows-cross 8
//codex-rs/exec-server:exec-server-selected_capability_roots-test-windows-cross 1
//codex-rs/exec-server:exec-server-unit-tests 116
//codex-rs/exec-server:exec-server-websocket-test-windows-cross 1
//codex-rs/exec:codex-exec-bin-unit-tests 1
//codex-rs/exec:exec-all-test-windows-cross 331
//codex-rs/exec:exec-event_processor_with_json_output-test-windows-cross 1
//codex-rs/exec:exec-unit-tests 47
//codex-rs/message-board:message-board-local_board-test-windows-cross 46
//codex-rs/ext/agent-message-board:agent-message-board-unit-tests 30
//codex-rs/ext/agent:agent-agent_service-test-windows-cross 3
//codex-rs/ext/agent:agent-unit-tests 1
//codex-rs/ext/connectors:connectors-unit-tests 47
//codex-rs/ext/extension-api:extension-api-capabilities-test-windows-cross 14
//codex-rs/ext/extension-api:extension-api-registry-test-windows-cross 31
//codex-rs/ext/extension-api:extension-api-state-test-windows-cross 57
//codex-rs/ext/extension-api:extension-api-unit-tests 35
//codex-rs/ext/git-attribution:git-attribution-unit-tests 30
//codex-rs/ext/goal:goal-accounting-test-windows-cross 1
//codex-rs/ext/goal:goal-goal_extension_backend-test-windows-cross 9
//codex-rs/ext/goal:goal-steering-test-windows-cross 1
//codex-rs/ext/goal:goal-unit-tests 47
//codex-rs/ext/guardian-reviewer:guardian-reviewer-unit-tests 36
//codex-rs/ext/guardian-v2:guardian-v2-unit-tests 50
//codex-rs/ext/history-notes:history-notes-history_notes_extension-test-windows-cross 1
//codex-rs/ext/history-notes:history-notes-image_model_input-test-windows-cross 2
//codex-rs/ext/history-notes:history-notes-unit-tests 1
//codex-rs/ext/image-generation:image-generation-unit-tests 47
//codex-rs/ext/mcp:mcp-hosted_apps_mcp-test-windows-cross 26
//codex-rs/ext/mcp:mcp-plugin_mcp-test-windows-cross 5
//codex-rs/ext/mcp:mcp-unit-tests 48
//codex-rs/ext/memories:memories-unit-tests 28
//codex-rs/ext/queue:queue-queue_service-test-windows-cross 9
//codex-rs/ext/queue:queue-unit-tests 25
//codex-rs/ext/skills:skills-executor_file_system_authority-test-windows-cross 36
//codex-rs/ext/skills:skills-skills_extension-test-windows-cross 7
//codex-rs/ext/skills:skills-unit-tests 8
//codex-rs/ext/web-search:web-search-unit-tests 1
//codex-rs/external-agent-migration:external-agent-migration-unit-tests 4
//codex-rs/features:features-unit-tests 47
//codex-rs/feedback:feedback-unit-tests 77
//codex-rs/file-system:file-system-unit-tests 48
//codex-rs/git-utils:git-utils-unit-tests 83
//codex-rs/guardian-context:guardian-context-cache_prefix-test-windows-cross 66
//codex-rs/guardian-context:guardian-context-unit-tests 67
//codex-rs/history:history-unit-tests 59
//codex-rs/hooks:hooks-unit-tests 16
//codex-rs/hooks:write_hooks_schema_fixtures-bin-unit-tests 48
//codex-rs/lmstudio:lmstudio-unit-tests 1
//codex-rs/login:login-all-test-windows-cross 5
//codex-rs/login:login-unit-tests 320
//codex-rs/memories/read:read-unit-tests 62
//codex-rs/memories/write:write-unit-tests 20
//codex-rs/message-history:message-history-unit-tests 74
//codex-rs/model-provider-info:model-provider-info-unit-tests 63
//codex-rs/model-provider:model-provider-unit-tests 64
//codex-rs/models-manager:models-manager-unit-tests 35
//codex-rs/mxc-sandbox:mxc-sandbox-unit-tests 36
//codex-rs/network-proxy:codex-network-proxy-bin-unit-tests 48
//codex-rs/network-proxy:network-proxy-unit-tests 85
//codex-rs/network-proxy:network-proxy-windows_stable_ingress-test-windows-cross 37
//codex-rs/ollama:ollama-unit-tests 1
//codex-rs/otel:otel-tests-test-windows-cross 17
//codex-rs/otel:otel-unit-tests 48
//codex-rs/plugin:plugin-unit-tests 74
//codex-rs/prompts:prompts-unit-tests 62
//codex-rs/protocol:protocol-unit-tests 67
//codex-rs/response-debug-context:response-debug-context-unit-tests 66
//codex-rs/rmcp-client:rmcp-client-foreign_stdio_cwd-test-windows-cross 48
//codex-rs/rmcp-client:rmcp-client-mcp_2026_discovery-test-windows-cross 4
//codex-rs/rmcp-client:rmcp-client-mcp_2026_message_limits-test-windows-cross 4
//codex-rs/rmcp-client:rmcp-client-mcp_2026_mrtr-test-windows-cross 2
//codex-rs/rmcp-client:rmcp-client-mcp_2026_oauth_discovery-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-mcp_2026_sse_discovery-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-mcp_2026_stdio-test-windows-cross 39
//codex-rs/rmcp-client:rmcp-client-mcp_2026_stdio_discovery-test-windows-cross 2
//codex-rs/rmcp-client:rmcp-client-mcp_events-test-windows-cross 2
//codex-rs/rmcp-client:rmcp-client-process_group_cleanup-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-resources-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-stdio_descriptor_boundary-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-stdio_message_limits-test-windows-cross 3
//codex-rs/rmcp-client:rmcp-client-stdio_stderr_cleanup-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-streamable_http_oauth_startup-test-windows-cross 6
//codex-rs/rmcp-client:rmcp-client-streamable_http_oauth_store_pinning-test-windows-cross 38
//codex-rs/rmcp-client:rmcp-client-streamable_http_oauth_tool_call-test-windows-cross 2
//codex-rs/rmcp-client:rmcp-client-streamable_http_recovery-test-windows-cross 51
//codex-rs/rmcp-client:rmcp-client-streamable_http_remote-test-windows-cross 3
//codex-rs/rmcp-client:rmcp-client-streamable_http_test_support-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-streamable_http_user_agent-test-windows-cross 1
//codex-rs/rmcp-client:rmcp-client-unit-tests 50
//codex-rs/rmcp-client:rmcp_test_server-bin-unit-tests 39
//codex-rs/rmcp-client:test_mcp_2026_discovery_stdio_server-bin-unit-tests 43
//codex-rs/rmcp-client:test_mcp_2026_stdio_server-bin-unit-tests 25
//codex-rs/rmcp-client:test_stdio_server-bin-unit-tests 41
//codex-rs/rmcp-client:test_streamable_http_server-bin-unit-tests 40
//codex-rs/rollout-trace:rollout-trace-unit-tests 76
//codex-rs/rollout:rollout-unit-tests 56
//codex-rs/sandboxing:sandboxing-unit-tests 74
//codex-rs/secrets:secrets-unit-tests 57
//codex-rs/shell-command:shell-command-unit-tests 60
//codex-rs/skills:skills-unit-tests 59
//codex-rs/state:state-unit-tests 242
//codex-rs/test-binary-support:test-binary-support-unit-tests 48
//codex-rs/thread-manager-sample:codex-thread-manager-sample-bin-unit-tests 47
//codex-rs/thread-store:thread-store-unit-tests 95
//codex-rs/tools:tools-json_schema_policy_fixtures-test-windows-cross 34
//codex-rs/tools:tools-unit-tests 37
//codex-rs/tui:codex-tui-bin-unit-tests 2
//codex-rs/tui:md-events-bin-unit-tests 1
//codex-rs/tui:tui-all-test-windows-cross 36
//codex-rs/tui:tui-manager_dependency_regression-test-windows-cross 2
//codex-rs/tui:tui-test_backend-test-windows-cross 25
//codex-rs/tui:tui-unit-tests 1003
//codex-rs/utils/approval-presets:approval-presets-unit-tests 66
//codex-rs/utils/audio:audio-unit-tests 76
//codex-rs/utils/cli:cli-unit-tests 64
//codex-rs/utils/git-discovery:git-discovery-unit-tests 59
//codex-rs/utils/oss:oss-unit-tests 1
//codex-rs/utils/output-truncation:output-truncation-unit-tests 60
//codex-rs/utils/plugins:plugins-unit-tests 36
//codex-rs/utils/sandbox-summary:sandbox-summary-unit-tests 66
//codex-rs/windows-sandbox-rs:codex-command-runner-bin-unit-tests 1
//codex-rs/windows-sandbox-rs:codex-windows-managed-deny-probe-bin-unit-tests 1
//codex-rs/windows-sandbox-rs:codex-windows-sandbox-setup-bin-unit-tests 1
//codex-rs/windows-sandbox-rs:windows-sandbox-rs-helper_manifest-test-windows-cross 1
//codex-rs/windows-sandbox-rs:windows-sandbox-rs-unit-tests 23
//codex-rs/windows-sandbox-service:codex-windows-sandbox-service-bin-unit-tests 46
//codex-rs/windows-sandbox-service:windows-sandbox-service-unit-tests 12
//codex-rs/worktree:worktree-settings-test-windows-cross 59
//codex-rs/worktree:worktree-unit-tests 76
//codex-rs/worktree:worktree-worktree-test-windows-cross 92
1 # Windows Bazel duration weights; columns: target<TAB>seconds.
2 # Seeded from 24 successful public openai/codex Windows job logs across six main
3 # runs, September 21-23, 2026. Public GitHub Actions run IDs:
4 # 35638529858, 35665540272, 35694732932, 35912411800, 35919297566, 35924169500.
5 # To refresh, take the median summed inner-run time (N * average) from clean,
6 # uncached PASSED summaries, excluding partial cache hits and FLAKY results.
7 # Round up to positive integer seconds. These weights exclude build/download time.
8 # Every queried target is assigned; missing weights default to 1 and stale entries are ignored.
9 //codex-rs/agent-graph-store:agent-graph-store-unit-tests 76
10 //codex-rs/agent-identity:agent-identity-unit-tests 66
11 //codex-rs/agent-roles:agent-roles-unit-tests 48
12 //codex-rs/analytics:analytics-unit-tests 29
13 //codex-rs/app-server-client:app-server-client-unit-tests 51
14 //codex-rs/app-server-daemon:app-server-daemon-unit-tests 4
15 //codex-rs/app-server-protocol:app-server-protocol-unit-tests 19
16 //codex-rs/app-server-test-client:app-server-test-client-unit-tests 25
17 //codex-rs/app-server-test-client:codex-app-server-test-client-bin-unit-tests 1
18 //codex-rs/app-server-transport:app-server-transport-unit-tests 65
19 //codex-rs/app-server/tests/common:common-unit-tests 26
20 //codex-rs/app-server:app-server-all-test-windows-cross 2835
21 //codex-rs/app-server:app-server-unit-tests 399
22 //codex-rs/app-server:codex-app-server-bin-unit-tests 48
23 //codex-rs/app-server:codex-app-server-test-notify-capture-bin-unit-tests 1
24 //codex-rs/app-server:exec-server-bin-unit-tests 1
25 //codex-rs/app-server:test_notify_capture-bin-unit-tests 1
26 //codex-rs/apply-patch:apply-patch-all-test-windows-cross 50
27 //codex-rs/apply-patch:apply-patch-unit-tests 48
28 //codex-rs/apply-patch:apply_patch-bin-unit-tests 24
29 //codex-rs/arg0:arg0-unit-tests 24
30 //codex-rs/backend-client:backend-client-unit-tests 41
31 //codex-rs/chatgpt:chatgpt-all-test-windows-cross 26
32 //codex-rs/chatgpt:chatgpt-unit-tests 27
33 //codex-rs/cli:cli-app_server-test-windows-cross 3
34 //codex-rs/cli:cli-app_server_daemon-test-windows-cross 1
35 //codex-rs/cli:cli-cloud_auth-test-windows-cross 47
36 //codex-rs/cli:cli-cloud_config-test-windows-cross 3
37 //codex-rs/cli:cli-daemon_startup-test-windows-cross 4
38 //codex-rs/cli:cli-daemon_telemetry-test-windows-cross 1
39 //codex-rs/cli:cli-debug_clear_memories-test-windows-cross 4
40 //codex-rs/cli:cli-debug_models-test-windows-cross 2
41 //codex-rs/cli:cli-delete-test-windows-cross 2
42 //codex-rs/cli:cli-doctor_enterprise_network-test-windows-cross 3
43 //codex-rs/cli:cli-doctor_path_safety-test-windows-cross 47
44 //codex-rs/cli:cli-exec_server-test-windows-cross 39
45 //codex-rs/cli:cli-exec_server_websocket_auth-test-windows-cross 4
46 //codex-rs/cli:cli-execpolicy-test-windows-cross 2
47 //codex-rs/cli:cli-features-test-windows-cross 3
48 //codex-rs/cli:cli-login-test-windows-cross 4
49 //codex-rs/cli:cli-marketplace_add-test-windows-cross 2
50 //codex-rs/cli:cli-marketplace_remove-test-windows-cross 1
51 //codex-rs/cli:cli-marketplace_upgrade-test-windows-cross 2
52 //codex-rs/cli:cli-mcp_add_remove-test-windows-cross 3
53 //codex-rs/cli:cli-mcp_list-test-windows-cross 2
54 //codex-rs/cli:cli-mcp_login-test-windows-cross 2
55 //codex-rs/cli:cli-plugin_cli-test-windows-cross 7
56 //codex-rs/cli:cli-queue-test-windows-cross 1
57 //codex-rs/cli:cli-sandbox_cloud_config-test-windows-cross 48
58 //codex-rs/cli:cli-sandbox_network_proxy-test-windows-cross 1
59 //codex-rs/cli:cli-sandbox_tty-test-windows-cross 1
60 //codex-rs/cli:cli-unit-tests 2
61 //codex-rs/cli:cli-update-test-windows-cross 47
62 //codex-rs/cli:cli-worktree-test-windows-cross 12
63 //codex-rs/cli:codex-bin-unit-tests 60
64 //codex-rs/cli:logs_client-bin-unit-tests 1
65 //codex-rs/cloud-config:cloud-config-unit-tests 47
66 //codex-rs/cloud-tasks-client:cloud-tasks-client-unit-tests 35
67 //codex-rs/cloud-tasks-mock-client:cloud-tasks-mock-client-unit-tests 59
68 //codex-rs/cloud-tasks:cloud-tasks-env_filter-test-windows-cross 1
69 //codex-rs/cloud-tasks:cloud-tasks-unit-tests 1
70 //codex-rs/code-mode-host:code-mode-host-grpc-test-windows-cross 28
71 //codex-rs/code-mode-host:code-mode-host-grpc_notifications-test-windows-cross 25
72 //codex-rs/code-mode-host:code-mode-host-grpc_tcp-test-windows-cross 1
73 //codex-rs/code-mode-host:code-mode-host-grpc_timing-test-windows-cross 7
74 //codex-rs/code-mode-host:code-mode-host-stdio-test-windows-cross 11
75 //codex-rs/code-mode-host:code-mode-host-unit-tests 2
76 //codex-rs/code-mode-host:codex-code-mode-host-bin-unit-tests 1
77 //codex-rs/code-mode-protocol:code-mode-protocol-unit-tests 62
78 //codex-rs/code-mode-runtime:code-mode-runtime-array_sort-test-windows-cross 24
79 //codex-rs/code-mode-runtime:code-mode-runtime-jit-test-windows-cross 1
80 //codex-rs/code-mode-runtime:code-mode-runtime-unit-tests 7
81 //codex-rs/code-mode:code-mode-unit-tests 49
82 //codex-rs/codex-api:codex-api-clients-test-windows-cross 75
83 //codex-rs/codex-api:codex-api-models_integration-test-windows-cross 66
84 //codex-rs/codex-api:codex-api-realtime_websocket_e2e-test-windows-cross 63
85 //codex-rs/codex-api:codex-api-realtime_websocket_tls-test-windows-cross 66
86 //codex-rs/codex-api:codex-api-sse_end_to_end-test-windows-cross 48
87 //codex-rs/codex-api:codex-api-unit-tests 60
88 //codex-rs/codex-home:codex-home-unit-tests 13
89 //codex-rs/codex-mcp:codex-mcp-unit-tests 61
90 //codex-rs/config-schema:codex-write-config-schema-bin-unit-tests 48
91 //codex-rs/config:config-unit-tests 75
92 //codex-rs/connectors:connectors-unit-tests 39
93 //codex-rs/context-fragments:context-fragments-unit-tests 59
94 //codex-rs/core-api:core-api-unit-tests 1
95 //codex-rs/core-plugins:core-plugins-unit-tests 20
96 //codex-rs/core/tests/common:common-unit-tests 48
97 //codex-rs/core:core-all-test-windows-cross 3162
98 //codex-rs/core:core-mcp_trace_propagation-test-windows-cross 2
99 //codex-rs/core:core-responses_headers-test-windows-cross 5
100 //codex-rs/core:core-unit-tests 251
101 //codex-rs/exec-server-protocol:exec-server-protocol-unit-tests 48
102 //codex-rs/exec-server/tests/support:support-unit-tests 48
103 //codex-rs/exec-server:exec-server-accepted_websocket-test-windows-cross 1
104 //codex-rs/exec-server:exec-server-capability_discovery-test-windows-cross 1
105 //codex-rs/exec-server:exec-server-chatgpt_cloudflare_affinity-test-windows-cross 1
106 //codex-rs/exec-server:exec-server-deferred_environment-test-windows-cross 1
107 //codex-rs/exec-server:exec-server-environment-test-windows-cross 10
108 //codex-rs/exec-server:exec-server-environment_config-test-windows-cross 1
109 //codex-rs/exec-server:exec-server-exec_process-test-windows-cross 1
110 //codex-rs/exec-server:exec-server-file_stream-test-windows-cross 1
111 //codex-rs/exec-server:exec-server-file_system_unix-test-windows-cross 1
112 //codex-rs/exec-server:exec-server-file_system_windows-test-windows-cross 11
113 //codex-rs/exec-server:exec-server-forward-test-windows-cross 10
114 //codex-rs/exec-server:exec-server-health-test-windows-cross 1
115 //codex-rs/exec-server:exec-server-http_client-test-windows-cross 2
116 //codex-rs/exec-server:exec-server-http_request-test-windows-cross 1
117 //codex-rs/exec-server:exec-server-http_request_logging-test-windows-cross 3
118 //codex-rs/exec-server:exec-server-initialize-test-windows-cross 1
119 //codex-rs/exec-server:exec-server-macos_fs_spawn-test-windows-cross 1
120 //codex-rs/exec-server:exec-server-process-test-windows-cross 4
121 //codex-rs/exec-server:exec-server-relay-test-windows-cross 8
122 //codex-rs/exec-server:exec-server-selected_capability_roots-test-windows-cross 1
123 //codex-rs/exec-server:exec-server-unit-tests 116
124 //codex-rs/exec-server:exec-server-websocket-test-windows-cross 1
125 //codex-rs/exec:codex-exec-bin-unit-tests 1
126 //codex-rs/exec:exec-all-test-windows-cross 331
127 //codex-rs/exec:exec-event_processor_with_json_output-test-windows-cross 1
128 //codex-rs/exec:exec-unit-tests 47
129 //codex-rs/message-board:message-board-local_board-test-windows-cross 46
130 //codex-rs/ext/agent-message-board:agent-message-board-unit-tests 30
131 //codex-rs/ext/agent:agent-agent_service-test-windows-cross 3
132 //codex-rs/ext/agent:agent-unit-tests 1
133 //codex-rs/ext/connectors:connectors-unit-tests 47
134 //codex-rs/ext/extension-api:extension-api-capabilities-test-windows-cross 14
135 //codex-rs/ext/extension-api:extension-api-registry-test-windows-cross 31
136 //codex-rs/ext/extension-api:extension-api-state-test-windows-cross 57
137 //codex-rs/ext/extension-api:extension-api-unit-tests 35
138 //codex-rs/ext/git-attribution:git-attribution-unit-tests 30
139 //codex-rs/ext/goal:goal-accounting-test-windows-cross 1
140 //codex-rs/ext/goal:goal-goal_extension_backend-test-windows-cross 9
141 //codex-rs/ext/goal:goal-steering-test-windows-cross 1
142 //codex-rs/ext/goal:goal-unit-tests 47
143 //codex-rs/ext/guardian-reviewer:guardian-reviewer-unit-tests 36
144 //codex-rs/ext/guardian-v2:guardian-v2-unit-tests 50
145 //codex-rs/ext/history-notes:history-notes-history_notes_extension-test-windows-cross 1
146 //codex-rs/ext/history-notes:history-notes-image_model_input-test-windows-cross 2
147 //codex-rs/ext/history-notes:history-notes-unit-tests 1
148 //codex-rs/ext/image-generation:image-generation-unit-tests 47
149 //codex-rs/ext/mcp:mcp-hosted_apps_mcp-test-windows-cross 26
150 //codex-rs/ext/mcp:mcp-plugin_mcp-test-windows-cross 5
151 //codex-rs/ext/mcp:mcp-unit-tests 48
152 //codex-rs/ext/memories:memories-unit-tests 28
153 //codex-rs/ext/queue:queue-queue_service-test-windows-cross 9
154 //codex-rs/ext/queue:queue-unit-tests 25
155 //codex-rs/ext/skills:skills-executor_file_system_authority-test-windows-cross 36
156 //codex-rs/ext/skills:skills-skills_extension-test-windows-cross 7
157 //codex-rs/ext/skills:skills-unit-tests 8
158 //codex-rs/ext/web-search:web-search-unit-tests 1
159 //codex-rs/external-agent-migration:external-agent-migration-unit-tests 4
160 //codex-rs/features:features-unit-tests 47
161 //codex-rs/feedback:feedback-unit-tests 77
162 //codex-rs/file-system:file-system-unit-tests 48
163 //codex-rs/git-utils:git-utils-unit-tests 83
164 //codex-rs/guardian-context:guardian-context-cache_prefix-test-windows-cross 66
165 //codex-rs/guardian-context:guardian-context-unit-tests 67
166 //codex-rs/history:history-unit-tests 59
167 //codex-rs/hooks:hooks-unit-tests 16
168 //codex-rs/hooks:write_hooks_schema_fixtures-bin-unit-tests 48
169 //codex-rs/lmstudio:lmstudio-unit-tests 1
170 //codex-rs/login:login-all-test-windows-cross 5
171 //codex-rs/login:login-unit-tests 320
172 //codex-rs/memories/read:read-unit-tests 62
173 //codex-rs/memories/write:write-unit-tests 20
174 //codex-rs/message-history:message-history-unit-tests 74
175 //codex-rs/model-provider-info:model-provider-info-unit-tests 63
176 //codex-rs/model-provider:model-provider-unit-tests 64
177 //codex-rs/models-manager:models-manager-unit-tests 35
178 //codex-rs/mxc-sandbox:mxc-sandbox-unit-tests 36
179 //codex-rs/network-proxy:codex-network-proxy-bin-unit-tests 48
180 //codex-rs/network-proxy:network-proxy-unit-tests 85
181 //codex-rs/network-proxy:network-proxy-windows_stable_ingress-test-windows-cross 37
182 //codex-rs/ollama:ollama-unit-tests 1
183 //codex-rs/otel:otel-tests-test-windows-cross 17
184 //codex-rs/otel:otel-unit-tests 48
185 //codex-rs/plugin:plugin-unit-tests 74
186 //codex-rs/prompts:prompts-unit-tests 62
187 //codex-rs/protocol:protocol-unit-tests 67
188 //codex-rs/response-debug-context:response-debug-context-unit-tests 66
189 //codex-rs/rmcp-client:rmcp-client-foreign_stdio_cwd-test-windows-cross 48
190 //codex-rs/rmcp-client:rmcp-client-mcp_2026_discovery-test-windows-cross 4
191 //codex-rs/rmcp-client:rmcp-client-mcp_2026_message_limits-test-windows-cross 4
192 //codex-rs/rmcp-client:rmcp-client-mcp_2026_mrtr-test-windows-cross 2
193 //codex-rs/rmcp-client:rmcp-client-mcp_2026_oauth_discovery-test-windows-cross 1
194 //codex-rs/rmcp-client:rmcp-client-mcp_2026_sse_discovery-test-windows-cross 1
195 //codex-rs/rmcp-client:rmcp-client-mcp_2026_stdio-test-windows-cross 39
196 //codex-rs/rmcp-client:rmcp-client-mcp_2026_stdio_discovery-test-windows-cross 2
197 //codex-rs/rmcp-client:rmcp-client-mcp_events-test-windows-cross 2
198 //codex-rs/rmcp-client:rmcp-client-process_group_cleanup-test-windows-cross 1
199 //codex-rs/rmcp-client:rmcp-client-resources-test-windows-cross 1
200 //codex-rs/rmcp-client:rmcp-client-stdio_descriptor_boundary-test-windows-cross 1
201 //codex-rs/rmcp-client:rmcp-client-stdio_message_limits-test-windows-cross 3
202 //codex-rs/rmcp-client:rmcp-client-stdio_stderr_cleanup-test-windows-cross 1
203 //codex-rs/rmcp-client:rmcp-client-streamable_http_oauth_startup-test-windows-cross 6
204 //codex-rs/rmcp-client:rmcp-client-streamable_http_oauth_store_pinning-test-windows-cross 38
205 //codex-rs/rmcp-client:rmcp-client-streamable_http_oauth_tool_call-test-windows-cross 2
206 //codex-rs/rmcp-client:rmcp-client-streamable_http_recovery-test-windows-cross 51
207 //codex-rs/rmcp-client:rmcp-client-streamable_http_remote-test-windows-cross 3
208 //codex-rs/rmcp-client:rmcp-client-streamable_http_test_support-test-windows-cross 1
209 //codex-rs/rmcp-client:rmcp-client-streamable_http_user_agent-test-windows-cross 1
210 //codex-rs/rmcp-client:rmcp-client-unit-tests 50
211 //codex-rs/rmcp-client:rmcp_test_server-bin-unit-tests 39
212 //codex-rs/rmcp-client:test_mcp_2026_discovery_stdio_server-bin-unit-tests 43
213 //codex-rs/rmcp-client:test_mcp_2026_stdio_server-bin-unit-tests 25
214 //codex-rs/rmcp-client:test_stdio_server-bin-unit-tests 41
215 //codex-rs/rmcp-client:test_streamable_http_server-bin-unit-tests 40
216 //codex-rs/rollout-trace:rollout-trace-unit-tests 76
217 //codex-rs/rollout:rollout-unit-tests 56
218 //codex-rs/sandboxing:sandboxing-unit-tests 74
219 //codex-rs/secrets:secrets-unit-tests 57
220 //codex-rs/shell-command:shell-command-unit-tests 60
221 //codex-rs/skills:skills-unit-tests 59
222 //codex-rs/state:state-unit-tests 242
223 //codex-rs/test-binary-support:test-binary-support-unit-tests 48
224 //codex-rs/thread-manager-sample:codex-thread-manager-sample-bin-unit-tests 47
225 //codex-rs/thread-store:thread-store-unit-tests 95
226 //codex-rs/tools:tools-json_schema_policy_fixtures-test-windows-cross 34
227 //codex-rs/tools:tools-unit-tests 37
228 //codex-rs/tui:codex-tui-bin-unit-tests 2
229 //codex-rs/tui:md-events-bin-unit-tests 1
230 //codex-rs/tui:tui-all-test-windows-cross 36
231 //codex-rs/tui:tui-manager_dependency_regression-test-windows-cross 2
232 //codex-rs/tui:tui-test_backend-test-windows-cross 25
233 //codex-rs/tui:tui-unit-tests 1003
234 //codex-rs/utils/approval-presets:approval-presets-unit-tests 66
235 //codex-rs/utils/audio:audio-unit-tests 76
236 //codex-rs/utils/cli:cli-unit-tests 64
237 //codex-rs/utils/git-discovery:git-discovery-unit-tests 59
238 //codex-rs/utils/oss:oss-unit-tests 1
239 //codex-rs/utils/output-truncation:output-truncation-unit-tests 60
240 //codex-rs/utils/plugins:plugins-unit-tests 36
241 //codex-rs/utils/sandbox-summary:sandbox-summary-unit-tests 66
242 //codex-rs/windows-sandbox-rs:codex-command-runner-bin-unit-tests 1
243 //codex-rs/windows-sandbox-rs:codex-windows-managed-deny-probe-bin-unit-tests 1
244 //codex-rs/windows-sandbox-rs:codex-windows-sandbox-setup-bin-unit-tests 1
245 //codex-rs/windows-sandbox-rs:windows-sandbox-rs-helper_manifest-test-windows-cross 1
246 //codex-rs/windows-sandbox-rs:windows-sandbox-rs-unit-tests 23
247 //codex-rs/windows-sandbox-service:codex-windows-sandbox-service-bin-unit-tests 46
248 //codex-rs/windows-sandbox-service:windows-sandbox-service-unit-tests 12
249 //codex-rs/worktree:worktree-settings-test-windows-cross 59
250 //codex-rs/worktree:worktree-unit-tests 76
251 //codex-rs/worktree:worktree-worktree-test-windows-cross 92
+4 -4
View File
@@ -178,7 +178,7 @@ jobs:
- name: Prepare native Windows audio dependencies
if: runner.os == 'Windows'
uses: ./third_party/voice/cargo-ci/windows-setup
uses: ./.github/actions/setup-bazel-windows
with:
target: x86_64-pc-windows-msvc
@@ -282,7 +282,7 @@ jobs:
- name: Prepare native Windows audio dependencies
if: runner.os == 'Windows'
uses: ./third_party/voice/cargo-ci/windows-setup
uses: ./.github/actions/setup-bazel-windows
with:
target: x86_64-pc-windows-msvc
@@ -379,7 +379,7 @@ jobs:
- name: Prepare native Windows audio dependencies
if: runner.os == 'Windows'
uses: ./third_party/voice/cargo-ci/windows-setup
uses: ./.github/actions/setup-bazel-windows
with:
target: x86_64-pc-windows-msvc
@@ -480,7 +480,7 @@ jobs:
- name: Prepare native Windows audio dependencies
if: runner.os == 'Windows'
uses: ./third_party/voice/cargo-ci/windows-setup
uses: ./.github/actions/setup-bazel-windows
with:
target: x86_64-pc-windows-msvc
-723
View File
@@ -1,723 +0,0 @@
name: rust-release-windows
on:
workflow_call:
env:
WINDOWS_BINARIES: "codex codex-code-mode-host codex-exec-server codex-responses-api-proxy codex-windows-sandbox-setup codex-windows-sandbox-service codex-command-runner codex-app-server"
jobs:
build-windows-binaries:
name: Build Windows binaries - ${{ matrix.runner }} - ${{ matrix.target }} - ${{ matrix.bundle }} - ${{ matrix.build-system }}
# Release Cargo artifacts only while Bazel releases are disabled.
runs-on: ${{ matrix.runs_on }}
environment:
name: bazel
deployment: false
# Temporary increase from 90 minutes while Cargo and Bazel build paths coexist.
# Reassess after the transition using Bazel release build timings.
timeout-minutes: 120
permissions:
contents: read
defaults:
run:
working-directory: codex-rs
env:
# Preserve Cargo names while teams opt into the additional Bazel artifacts.
ARTIFACT_SUFFIX: ${{ matrix.build-system == 'bazel' && '-bazel' || '' }}
strategy:
fail-fast: false
matrix:
build-system: [cargo] # Bazel releases are disabled while the BuildBuddy key is revoked.
target:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc
bundle: [primary, helpers, app-server]
include:
- runner: windows-x64
target: x86_64-pc-windows-msvc
bundle: primary
binaries: "codex codex-code-mode-host codex-exec-server codex-responses-api-proxy"
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-x64
- runner: windows-arm64
target: aarch64-pc-windows-msvc
bundle: primary
binaries: "codex codex-code-mode-host codex-exec-server codex-responses-api-proxy"
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-arm64
- runner: windows-x64
target: x86_64-pc-windows-msvc
bundle: helpers
binaries: "codex-windows-sandbox-setup codex-windows-sandbox-service codex-command-runner"
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-x64
- runner: windows-arm64
target: aarch64-pc-windows-msvc
bundle: helpers
binaries: "codex-windows-sandbox-setup codex-windows-sandbox-service codex-command-runner"
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-arm64
- runner: windows-x64
target: x86_64-pc-windows-msvc
bundle: app-server
binaries: "codex-app-server codex-code-mode-host codex-exec-server"
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-x64
- runner: windows-arm64
target: aarch64-pc-windows-msvc
bundle: app-server
binaries: "codex-app-server codex-code-mode-host codex-exec-server"
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-arm64
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
if: matrix.build-system == 'cargo'
- name: Print runner specs (Windows)
shell: powershell
run: |
$computer = Get-CimInstance Win32_ComputerSystem
$cpu = Get-CimInstance Win32_Processor | Select-Object -First 1
$ramGiB = [math]::Round($computer.TotalPhysicalMemory / 1GB, 1)
Write-Host "Runner: $env:RUNNER_NAME"
Write-Host "OS: $([System.Environment]::OSVersion.VersionString)"
Write-Host "CPU: $($cpu.Name)"
Write-Host "Logical CPUs: $($computer.NumberOfLogicalProcessors)"
Write-Host "Physical CPUs: $($computer.NumberOfProcessors)"
Write-Host "Total RAM: $ramGiB GiB"
Write-Host "Disk usage:"
Get-PSDrive -PSProvider FileSystem | Format-Table -AutoSize Name, @{Name='Size(GB)';Expression={[math]::Round(($_.Used + $_.Free) / 1GB, 1)}}, @{Name='Free(GB)';Expression={[math]::Round($_.Free / 1GB, 1)}}
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
with:
targets: ${{ matrix.build-system == 'cargo' && matrix.target || '' }}
- name: Prepare Bazel release build
if: ${{ matrix.build-system == 'bazel' }}
uses: ./.github/actions/prepare-bazel-ci
with:
target: ${{ matrix.target }}
cache-scope: bazel-release-${{ matrix.bundle }}
- name: Configure rusty_v8 artifact overrides and verify checksums
if: matrix.build-system == 'cargo'
uses: ./.github/actions/setup-rusty-v8
with:
target: ${{ matrix.target }}
- name: Configure MSVC environment
uses: ./.github/actions/setup-msvc-env
with:
target: ${{ matrix.target }}
- name: Build Bazel release binaries and symbols
if: ${{ matrix.build-system == 'bazel' }}
uses: ./.github/actions/build-bazel-release
with:
target: ${{ matrix.target }}
bundle: ${{ matrix.bundle }}
release-dir: ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release
- name: Cargo build (Windows binaries)
if: ${{ matrix.build-system == 'cargo' }}
shell: bash
run: |
target="${{ matrix.target }}"
if [[ "$target" == "x86_64-pc-windows-msvc" ]]; then
export LIBSQLITE3_FLAGS=SQLITE_DISABLE_INTRINSIC
fi
build_args=()
for binary in ${{ matrix.binaries }}; do
build_args+=(--bin "$binary")
done
STABLE_GIT_COMMIT="$(git rev-parse HEAD)"
export STABLE_GIT_COMMIT
cargo build --target "$target" --release --timings "${build_args[@]}"
- name: Stage Windows binaries
shell: bash
run: |
release_dir="$CARGO_TARGET_DIR/${{ matrix.target }}/release"
output_dir="$release_dir/staged-${{ matrix.bundle }}"
mkdir -p "$output_dir"
for binary in ${{ matrix.binaries }}; do
pdb_name="${binary//-/_}"
pdb_path="$release_dir/${pdb_name}.pdb"
if [[ ! -f "$pdb_path" ]]; then
pdb_path="$release_dir/${binary}.pdb"
fi
if [[ ! -f "$pdb_path" ]]; then
echo "PDB for $binary not found at $release_dir/${pdb_name}.pdb or $release_dir/${binary}.pdb" >&2
exit 1
fi
cp "$release_dir/${binary}.exe" "$output_dir/${binary}.exe"
cp "$pdb_path" "$output_dir/${binary}.pdb"
done
- name: Upload Windows binaries
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: windows-binaries-${{ matrix.target }}-${{ matrix.bundle }}${{ env.ARTIFACT_SUFFIX }}
path: |
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release/staged-${{ matrix.bundle }}/*
build-windows-voice:
name: Build Windows voice - ${{ matrix.target }}
runs-on: ${{ matrix.runs_on }}
environment:
name: bazel
deployment: false
timeout-minutes: 120
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
arch: x86_64
python_arch: x64
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-x64
- target: aarch64-pc-windows-msvc
arch: aarch64
python_arch: arm64
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-arm64
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
architecture: ${{ matrix.python_arch }}
- name: Prepare Bazel CI
uses: ./.github/actions/prepare-bazel-ci
with:
target: ${{ matrix.target }}
cache-scope: release-voice-windows
- uses: ./.github/actions/setup-msvc-env
with:
target: ${{ matrix.target }}
- name: Refresh Bazel PATH for the selected MSVC target
shell: pwsh
run: ./.github/scripts/compute-bazel-windows-path.ps1
- name: Download pinned Windows build inputs
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$manifest = Get-Content -Raw .github/scripts/voice-cygwin-snapshot.json | ConvertFrom-Json
$pin = $manifest.archive
$source = $manifest.sourceArchive
$directory = Join-Path $env:RUNNER_TEMP "voice-cygwin-snapshot"
New-Item -ItemType Directory -Path $directory | Out-Null
gh release download $pin.tag --repo "${{ github.repository }}" --pattern $pin.name --pattern $source.name --dir $directory
if ($LASTEXITCODE -ne 0) { throw "Cannot obtain the public Cygwin inputs and source" }
$sourceFile = Join-Path $directory $source.name
if ((Get-Item $sourceFile).Length -ne $source.bytes -or
(Get-FileHash $sourceFile -Algorithm SHA256).Hash.ToLowerInvariant() -ne $source.sha256) {
throw "Public Cygwin source archive mismatch"
}
"VOICE_CYGWIN_ARCHIVE=$(Join-Path $directory $pin.name)" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
- name: Verify and install pinned public build tools
shell: pwsh
run: |
& ./.github/scripts/setup-voice-windows.ps1 -Target "${{ matrix.target }}" -SnapshotArchive $env:VOICE_CYGWIN_ARCHIVE
if (-not $env:SystemRoot) { throw "Windows SystemRoot is required for native audio actions" }
"VOICE_WINDOWS_SYSTEM_ROOT=$env:SystemRoot" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
$hostArch = $env:PROCESSOR_ARCHITEW6432
if (-not $hostArch) { $hostArch = $env:PROCESSOR_ARCHITECTURE }
if (-not $hostArch) { throw "Windows host architecture is required" }
"VOICE_WINDOWS_HOST_ARCH=$hostArch" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build same-commit native runtime and helper
shell: bash
env:
ARCH: ${{ matrix.arch }}
VOICE_ARCH: ${{ matrix.arch }}
# Use local Bazel while BuildBuddy credentials are unavailable.
run: |
(cd codex-rs && cargo update --workspace)
python .github/scripts/watch_voice_bazel.py "$(cygpath -w "$BASH")" ./.github/scripts/run-bazel-ci.sh \
--remote-download-toplevel \
--print-failed-action-summary \
--windows-msvc-host-platform \
-- \
test --config=release \
--platforms=//:local_windows_msvc \
--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows,@local_config_cc//:cc-toolchain-arm64_windows,//third_party/voice:windows_pkg_config_toolchain,//third_party/voice:windows_cmake_toolchain \
--repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 \
--repo_env=BAZEL_MSVC_RUNTIME_VISUAL_STUDIO_EULA=1 \
--inject_repository="voice_windows_tools=$VOICE_WINDOWS_BAZEL_REPOSITORY" \
--//third_party/voice:windows_installed_tools=@voice_windows_tools//:tools \
--action_env="SystemRoot=$VOICE_WINDOWS_SYSTEM_ROOT" \
--host_action_env="SystemRoot=$VOICE_WINDOWS_SYSTEM_ROOT" \
--action_env="PROCESSOR_ARCHITECTURE=$VOICE_WINDOWS_HOST_ARCH" \
--host_action_env="PROCESSOR_ARCHITECTURE=$VOICE_WINDOWS_HOST_ARCH" \
--output_groups=default,receipt,sdk \
--workspace_status_command=./scripts/workspace-status.cmd \
--build_metadata=COMMIT_SHA="$GITHUB_SHA" \
-- \
"//third_party/voice:native_runtime_windows_$ARCH" \
@rules_rust//cargo/private/cargo_build_script_runner:test \
//codex-rs/voice-host:codex-voice-host
- name: Stage verified voice build output
shell: bash
env:
TARGET: ${{ matrix.target }}
ARCH: ${{ matrix.arch }}
run: |
set -euo pipefail
runtime="bazel-bin/third_party/voice/native_runtime_windows_${ARCH}"
PYTHONPATH=third_party/voice python - "$runtime" "$TARGET" <<'PY'
from pathlib import Path
import sys
from package_runtime import runtime_files
runtime_files(Path(sys.argv[1]).resolve(strict=True), sys.argv[2])
PY
output="voice-unsigned/${TARGET}"
mkdir -p "$output"
cp -R "$runtime" "$output/runtime"
cp bazel-bin/codex-rs/voice-host/codex-voice-host.exe "$output/codex-voice-host.exe"
chmod -R u+w "$output"
tar -C "$output" -czf "voice-unsigned-${TARGET}.tar.gz" runtime codex-voice-host.exe
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: voice-${{ matrix.target }}-unsigned
path: voice-unsigned-${{ matrix.target }}.tar.gz
if-no-files-found: error
build-windows-symbols:
needs:
- build-windows-binaries
name: Build Windows symbols - ${{ matrix.target }} - ${{ matrix.build-system }}
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
defaults:
run:
working-directory: codex-rs
env:
ARTIFACT_SUFFIX: ${{ matrix.build-system == 'bazel' && '-bazel' || '' }}
strategy:
fail-fast: false
matrix:
build-system: [cargo] # Bazel releases are disabled while the BuildBuddy key is revoked.
target:
- aarch64-pc-windows-msvc
- x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
- name: Download prebuilt Windows binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: windows-binaries-${{ matrix.target }}-{primary,helpers,app-server}${{ env.ARTIFACT_SUFFIX }}
merge-multiple: true
path: ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release
- name: Build symbols archive
shell: bash
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/archive-release-symbols-and-strip-binaries.sh" \
--target "${{ matrix.target }}" \
--artifact-name "${{ matrix.target }}" \
--release-dir "${CARGO_TARGET_DIR}/${{ matrix.target }}/release" \
--archive-dir "symbols-dist/${{ matrix.target }}" \
--binaries "${WINDOWS_BINARIES}"
- name: Suffix Bazel artifact filenames
if: ${{ matrix.build-system == 'bazel' }}
shell: bash
run: |
set -euo pipefail
for artifact in "symbols-dist/${{ matrix.target }}"/*; do
name="${artifact##*/}"
stem="${name%%.*}"
mv "$artifact" "${artifact%/*}/${stem}-bazel${name#"$stem"}"
done
- name: Upload symbols archive
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.target }}-symbols${{ env.ARTIFACT_SUFFIX }}
path: codex-rs/symbols-dist/${{ matrix.target }}/*
if-no-files-found: error
build-windows:
needs:
- build-windows-binaries
- build-windows-voice
name: Build - ${{ matrix.runner }} - ${{ matrix.target }} - ${{ matrix.build-system }}
runs-on: ${{ matrix.runs_on }}
environment:
name: azure-artifact-signing
deployment: false
timeout-minutes: 120
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: codex-rs
env:
ARTIFACT_SUFFIX: ${{ matrix.build-system == 'bazel' && '-bazel' || '' }}
strategy:
fail-fast: false
matrix:
build-system: [cargo] # Bazel releases are disabled while the BuildBuddy key is revoked.
target:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc
include:
- runner: windows-x64
target: x86_64-pc-windows-msvc
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-x64
- runner: windows-x64
target: aarch64-pc-windows-msvc
runs_on:
group: ${{ github.event.repository.name }}-runners
labels: ${{ github.event.repository.name }}-windows-x64
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
- name: Download prebuilt Windows primary binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: windows-binaries-${{ matrix.target }}-primary${{ env.ARTIFACT_SUFFIX }}
path: ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release
- name: Download prebuilt Windows helper binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: windows-binaries-${{ matrix.target }}-helpers${{ env.ARTIFACT_SUFFIX }}
path: ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release
- name: Download prebuilt Windows app-server binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: windows-binaries-${{ matrix.target }}-app-server${{ env.ARTIFACT_SUFFIX }}
path: ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release
- name: Verify binaries
shell: bash
run: |
set -euo pipefail
for binary in ${WINDOWS_BINARIES}; do
ls -lh "$CARGO_TARGET_DIR/${{ matrix.target }}/release/${binary}.exe"
done
- name: Sign Windows release files with Azure Trusted Signing
uses: ./.github/actions/windows-code-sign
with:
target: ${{ matrix.target }}
binaries: ${{ env.WINDOWS_BINARIES }}
# The installer is architecture-independent; sign it only in the x64 job.
additional-files: ${{ matrix.target == 'x86_64-pc-windows-msvc' && format('{0}/scripts/install/install.ps1', github.workspace) || '' }}
client-id: ${{ secrets.AZURE_ARTIFACT_SIGNING_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_ARTIFACT_SIGNING_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_ARTIFACT_SIGNING_SUBSCRIPTION_ID }}
endpoint: ${{ secrets.AZURE_ARTIFACT_SIGNING_ENDPOINT }}
account-name: ${{ secrets.AZURE_ARTIFACT_SIGNING_ACCOUNT_NAME }}
certificate-profile-name: ${{ secrets.AZURE_ARTIFACT_SIGNING_CERTIFICATE_PROFILE_NAME }}
- name: Download matching native voice build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: voice-${{ matrix.target }}-unsigned
path: ${{ runner.temp }}/unsigned-voice
- name: Stage voice files for signing
id: voice_files
shell: bash
run: |
set -euo pipefail
target="${{ matrix.target }}"
unsigned="${RUNNER_TEMP}/unsigned-voice/extracted"
signed="${GITHUB_WORKSPACE}/signed-voice/${target}"
mkdir -p "$unsigned" "$signed"
tar -xzf "$(cygpath -u "${RUNNER_TEMP}/unsigned-voice/voice-unsigned-${target}.tar.gz")" -C "$(cygpath -u "$unsigned")"
python "${GITHUB_WORKSPACE}/third_party/voice/release_runtime.py" stage \
--source "$unsigned/runtime" --target "$target" --output "$signed/runtime"
cp "$unsigned/codex-voice-host.exe" "$signed/codex-voice-host.exe"
chmod -R u+w "$signed"
{
echo 'files<<EOF'
echo "$signed/codex-voice-host.exe"
find "$signed/runtime/bin" -name '*.dll' -type f -print
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Sign Windows voice helper and native DLLs
uses: azure/trusted-signing-action@1d365fec12862c4aa68fcac418143d73f0cea293 # v0.5.11
with:
endpoint: ${{ secrets.AZURE_ARTIFACT_SIGNING_ENDPOINT }}
trusted-signing-account-name: ${{ secrets.AZURE_ARTIFACT_SIGNING_ACCOUNT_NAME }}
certificate-profile-name: ${{ secrets.AZURE_ARTIFACT_SIGNING_CERTIFICATE_PROFILE_NAME }}
exclude-environment-credential: true
exclude-workload-identity-credential: true
exclude-managed-identity-credential: true
exclude-shared-token-cache-credential: true
exclude-visual-studio-credential: true
exclude-visual-studio-code-credential: true
exclude-azure-cli-credential: false
exclude-azure-powershell-credential: true
exclude-azure-developer-cli-credential: true
exclude-interactive-browser-credential: true
cache-dependencies: false
files: ${{ steps.voice_files.outputs.files }}
- uses: ./.github/actions/setup-msvc-env
with:
target: ${{ matrix.target }}
- name: Seal and verify signed voice output
shell: pwsh
run: |
$target = "${{ matrix.target }}"
$signed = Join-Path $env:GITHUB_WORKSPACE "signed-voice/$target"
python (Join-Path $env:GITHUB_WORKSPACE 'third_party/voice/windows_crt.py') --root (Join-Path $signed 'runtime') --target $target --helper (Join-Path $signed 'codex-voice-host.exe')
if ($LASTEXITCODE -ne 0) { throw 'Cannot stage verified Microsoft CRT' }
$files = @(Join-Path $signed "codex-voice-host.exe") + @(
Get-ChildItem (Join-Path $signed "runtime/bin") -Filter *.dll -File |
ForEach-Object FullName
)
if ($files.Count -lt 8) { throw "Voice DLL closure is incomplete" }
foreach ($file in $files) {
$signature = Get-AuthenticodeSignature $file
if ($signature.Status -ne 'Valid') { throw "Unsigned voice file: $file ($($signature.Status))" }
}
python (Join-Path $env:GITHUB_WORKSPACE 'third_party/voice/release_runtime.py') seal --target $target --output (Join-Path $signed 'runtime')
if ($LASTEXITCODE -ne 0) { throw 'Cannot seal signed voice runtime' }
"VOICE_RELEASE_DIR=$signed" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
- name: Stage artifacts
shell: bash
run: |
dest="dist/${{ matrix.target }}"
mkdir -p "$dest"
for binary in ${WINDOWS_BINARIES}; do
cp "$CARGO_TARGET_DIR/${{ matrix.target }}/release/${binary}.exe" \
"$dest/${binary}-${{ matrix.target }}.exe"
done
- name: Build Codex package archives
shell: bash
run: |
set -euo pipefail
target="${{ matrix.target }}"
archive_script="${GITHUB_WORKSPACE}/.github/scripts/build-codex-package-archive.sh"
voice_args=(--voice-release-dir "$VOICE_RELEASE_DIR")
voice_args+=(--release-version "${GITHUB_REF_NAME#rust-v}")
bash "$archive_script" \
--target "$target" --bundle primary \
--entrypoint-dir "$CARGO_TARGET_DIR/$target/release" \
--archive-dir "dist/$target" "${voice_args[@]}"
bash "$archive_script" \
--target "$target" --bundle app-server \
--entrypoint-dir "$CARGO_TARGET_DIR/$target/release" \
--archive-dir "dist/$target"
- name: Verify packaged executor signatures and bytes
shell: pwsh
run: |
$target = "${{ matrix.target }}"
$source = Join-Path $env:CARGO_TARGET_DIR "$target/release/codex-exec-server.exe"
foreach ($stem in @("codex-package", "codex-app-server-package")) {
$package = Join-Path $env:RUNNER_TEMP "verify-executor-$stem-$target"
New-Item -ItemType Directory -Path $package | Out-Null
tar -xzf "dist/$target/$stem-$target.tar.gz" -C $package
if ($LASTEXITCODE -ne 0) { throw "Cannot extract executor package" }
$binary = Join-Path $package "bin/codex-exec-server.exe"
if ((Get-FileHash $binary).Hash -ne (Get-FileHash $source).Hash) {
throw "Packaged executor differs from the signed input"
}
$signature = Get-AuthenticodeSignature $binary
if ($signature.Status -ne "Valid" -or $null -eq $signature.TimeStamperCertificate) {
throw "Invalid or untimestamped executor signature"
}
}
- name: Verify packaged Windows voice closure
shell: pwsh
run: |
$target = "${{ matrix.target }}"
$package = Join-Path $env:RUNNER_TEMP "verify-voice-archive-$target"
New-Item -ItemType Directory -Path $package | Out-Null
tar -xzf "dist/$target/codex-package-$target.tar.gz" -C $package
if ($LASTEXITCODE -ne 0) { throw "Cannot extract the final Windows package" }
$voice = Join-Path $package 'codex-resources/voice'
$helper = Join-Path $voice 'bin/codex-voice-host.exe'
if (-not (Test-Path $helper) -or -not (Test-Path (Join-Path $voice 'bin/gstreamer-1.0-0.dll'))) {
throw 'Signed Windows voice files are missing from the canonical package'
}
$signature = Get-AuthenticodeSignature $helper
if ($signature.Status -ne 'Valid') { throw "Packaged helper signature: $($signature.Status)" }
python -c 'import sys; from pathlib import Path; sys.path.insert(0, sys.argv[3]); from package_runtime import runtime_files; runtime_files(Path(sys.argv[1]), sys.argv[2], public_release=True)' $voice $target (Join-Path $env:GITHUB_WORKSPACE 'third_party/voice')
if ($LASTEXITCODE -ne 0) { throw 'Packaged runtime receipt verification failed' }
- name: Set up Python release tools
if: ${{ matrix.build-system == 'cargo' }}
uses: ./.github/actions/setup-python-release-tools
with:
group: runtime
- name: Build Python runtime wheel
if: ${{ matrix.build-system == 'cargo' }}
shell: bash
run: |
set -euo pipefail
case "${{ matrix.target }}" in
aarch64-pc-windows-msvc)
platform_tag="win_arm64"
;;
x86_64-pc-windows-msvc)
platform_tag="win_amd64"
;;
*)
echo "No Python runtime wheel platform tag for ${{ matrix.target }}"
exit 1
;;
esac
# The wheel's Windows support floor predates the native voice
# runtime's verified device/VC++ prerequisites. Keep it voice-free.
wheel_package="${RUNNER_TEMP}/codex-package-${{ matrix.target }}"
python - "$wheel_package" <<'PY'
import sys
from pathlib import Path
assert not (Path(sys.argv[1]) / "codex-resources" / "voice").exists()
PY
stage_dir="${RUNNER_TEMP}/openai-codex-cli-bin-${{ matrix.target }}"
wheel_dir="${GITHUB_WORKSPACE}/python-runtime-dist/${{ matrix.target }}"
python "${GITHUB_WORKSPACE}/sdk/python/scripts/update_sdk_artifacts.py" \
stage-runtime \
"$stage_dir" \
"$wheel_package" \
--codex-version "${GITHUB_REF_NAME}" \
--platform-tag "$platform_tag"
uv build --offline --no-build-isolation --no-create-gitignore \
--python "${RUNNER_TEMP}/python-runtime-build-venv" --wheel --out-dir "$wheel_dir" "$stage_dir"
- name: Upload Python runtime wheel
if: ${{ matrix.build-system == 'cargo' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: python-runtime-wheel-${{ matrix.target }}
path: python-runtime-dist/${{ matrix.target }}/*.whl
if-no-files-found: error
- name: Compress artifacts
shell: bash
run: |
# Path that contains the uncompressed binaries for the current
# ${{ matrix.target }}
dest="dist/${{ matrix.target }}"
repo_root=$PWD
target="${{ matrix.target }}"
export dest repo_root target
# For compatibility with environments that lack the `zstd` tool we
# additionally create a `.tar.gz` and `.zip` for every Windows binary.
# The end result is:
# codex-<target>.zst
# codex-<target>.tar.gz
# codex-<target>.zip
# Variables in the single-quoted script expand in the child shell.
# shellcheck disable=SC2016
# Start larger binaries first so both workers stay busy.
find "$dest" -maxdepth 1 -type f -printf '%s %p\0' |
sort -z -nr |
cut -z -d ' ' -f 2- |
xargs -0 -n1 -P2 bash -c '
set -euo pipefail
f=$1
base="$(basename "$f")"
# Skip files that are already archives (should not happen, but be
# safe).
if [[ "$base" == *.tar.gz || "$base" == *.tar.zst || "$base" == *.zip || "$base" == *.dmg ]]; then
exit 0
fi
# Do not try to compress signature bundles.
if [[ "$base" == *.sigstore ]]; then
exit 0
fi
# Create per-binary tar.gz
tar -C "$dest" -czf "$dest/${base}.tar.gz" "$base"
# Create zip archive for Windows binaries.
# Must run from inside the dest dir so 7z does not embed the
# directory path inside the zip.
if [[ "$base" == "codex-${target}.exe" ]]; then
# Preserve WinGet executable paths while including the signed
# runtime, resources, and package metadata from the canonical tar.
bundle_dir="$(mktemp -d)"
tar -xzf "$dest/codex-package-${target}.tar.gz" -C "$bundle_dir"
python "${GITHUB_WORKSPACE}/scripts/build_winget_package.py" "$(cygpath -w "$bundle_dir")"
(cd "$bundle_dir" && 7z a "$repo_root/$dest/${base}.zip" .)
rm -rf "$bundle_dir"
else
(cd "$dest" && 7z a "${base}.zip" "$base")
fi
# Keep raw executables and produce .zst alongside them.
"${GITHUB_WORKSPACE}/.github/workflows/zstd" -T0 -19 "$dest/$base"
' _
- name: Verify and stage signed PowerShell installer
if: matrix.build-system == 'cargo' && matrix.target == 'x86_64-pc-windows-msvc'
shell: powershell
run: |
$installer = Join-Path $env:GITHUB_WORKSPACE 'scripts/install/install.ps1'
$signature = Get-AuthenticodeSignature $installer
if ($signature.Status -ne 'Valid' -or $null -eq $signature.TimeStamperCertificate) {
throw "Installer signature is invalid or missing a timestamp: $($signature.Status)"
}
# Stage after compression so the installer remains a plain script.
Copy-Item $installer 'dist/${{ matrix.target }}/install.ps1'
- name: Suffix Bazel artifact filenames
if: ${{ matrix.build-system == 'bazel' }}
shell: bash
run: |
set -euo pipefail
for artifact in "dist/${{ matrix.target }}"/*; do
name="${artifact##*/}"
stem="${name%%.*}"
mv "$artifact" "${artifact%/*}/${stem}-bazel${name#"$stem"}"
done
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.target }}${{ env.ARTIFACT_SUFFIX }}
path: |
codex-rs/dist/${{ matrix.target }}/*
+2 -33
View File
@@ -208,6 +208,7 @@ jobs:
name: Install musl build tools
env:
TARGET: ${{ matrix.target }}
CODEX_MUSL_RELEASE_LINK_FLAGS: "1"
run: bash "${GITHUB_WORKSPACE}/.github/scripts/install-musl-build-tools.sh"
- if: ${{ matrix.build-system == 'cargo' && contains(matrix.target, 'linux') }}
@@ -1768,39 +1769,7 @@ jobs:
RELEASE_NOTES: ${{ steps.release_notes.outputs.path }}
MAKE_LATEST: ${{ steps.release_name.outputs.make_latest }}
PRERELEASE: ${{ steps.release_name.outputs.prerelease }}
run: |
set -euo pipefail
# Look up this tag, including drafts, without listing release history.
# API errors must fail the step rather than look like an absent release.
# shellcheck disable=SC2016
exists="$(gh api graphql \
-f query='query($owner:String!,$repo:String!,$tag:String!){repository(owner:$owner,name:$repo){release(tagName:$tag){databaseId}}}' \
-f owner="$GITHUB_REPOSITORY_OWNER" \
-f repo="${GITHUB_REPOSITORY#*/}" \
-f tag="$GITHUB_REF_NAME" \
--jq '.data.repository.release != null')"
release_args=(
--repo "$GITHUB_REPOSITORY"
--title "$RELEASE_NAME"
--notes-file "$RELEASE_NOTES"
--prerelease="$PRERELEASE"
)
if [[ "$exists" == false ]]; then
# Prereleases must be created directly to keep prereleased events.
draft=true
if [[ "$PRERELEASE" == true ]]; then
draft=false
fi
gh release create "$GITHUB_REF_NAME" "${release_args[@]}" \
--draft="$draft" --verify-tag --latest=false
fi
mapfile -d '' assets < <(find dist -type f -print0 | sort -z)
gh release upload "$GITHUB_REF_NAME" "${assets[@]}" \
--repo "$GITHUB_REPOSITORY" --clobber
gh release edit "$GITHUB_REF_NAME" "${release_args[@]}" \
--draft=false --latest="$MAKE_LATEST"
run: bash .github/scripts/publish-github-release.sh
publish-r2-assets:
name: publish-r2-assets
+68
View File
@@ -0,0 +1,68 @@
name: Xcoder Linux
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: xcoder-linux-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
name: Build and test Linux x86_64
runs-on: ubuntu-24.04
timeout-minutes: 120
env:
CARGO_BUILD_JOBS: '1'
# Published builds keep the optimized profile; local builds use `local`.
XCODER_CARGO_PROFILE: release
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up the locked Ziran toolchain
id: ziran
uses: ziranlang/ziran/.github/actions/setup@d2db9d35feaf2a3278dc7bed571022b0e0323247
with:
fetch: 'true'
packages: build-essential pkg-config libssl-dev libcap-dev libbz2-dev libzstd-dev zlib1g-dev bubblewrap
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- name: Enable private Linux test namespaces
run: |
sudo sysctl -w kernel.unprivileged_userns_clone=1
if sysctl kernel.apparmor_restrict_unprivileged_userns >/dev/null 2>&1; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
- name: Cache Cargo downloads and compiled dependencies
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
build/cargo-home/registry
build/cargo-home/git
codex-rs/target
key: xcoder-linux-${{ runner.arch }}-${{ hashFiles('codex-rs/Cargo.lock', 'codex-rs/rust-toolchain.toml', 'ziran.lock') }}
restore-keys: xcoder-linux-${{ runner.arch }}-
- name: Build and run the complete offline local suite
run: make test
- name: Package the tested Linux build and its native compiler
env:
ZIRAN_TOOLCHAIN: ${{ steps.ziran.outputs.root }}
run: python3 scripts/package-linux.py --toolchain "$ZIRAN_TOOLCHAIN"
- name: Test the relocated download
run: python3 tests/linux_package_test.py
- name: Upload Linux download
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: xcoder-linux-x86_64
path: |
build/xcoder-linux-x86_64.tar.gz
build/xcoder-linux-x86_64.tar.gz.sha256
if-no-files-found: error
retention-days: 30
+2
View File
@@ -1,4 +1,6 @@
# deps
ziran.local.toml
backup/
# Node.js dependencies
node_modules
.pnpm-store
+58
View File
@@ -2,4 +2,62 @@ The changelog can be found on the [releases page](https://github.com/openai/code
## Unreleased
- Local builds are faster. `make` builds a `local` profile (no cross-crate LTO, 16 codegen units, incremental, no debug info) whose final link spreads over many cores and needs a fraction of the memory; published releases keep the optimized `release` profile (`XCODER_CARGO_PROFILE=release`, set in CI).
- `codex-protocol`, which nearly every crate depends on, no longer waits for the network proxy to compile: the policy values it shares with the proxy live in a small `codex-network-policy` crate. The proxy was the slowest crate in the build (about 140 s), so its compile time now overlaps the rest.
- Line diffs, unified diff text and unified-diff parsing come from the Ziran `diff` package (`native/diff.zi`, `codex-utils-text-diff`) instead of `similar` and `diffy`; the turn diff, `apply_patch` results, the git baseline and the TUI diff view use it. Output matches `similar` byte for byte and parsing matches `diffy` on generated and damaged patches. The 100 ms diff deadline is now a deterministic work budget.
- The private git baseline repository is written and read with the Ziran `git` package instead of `gix`, and `SanitizedGitUrl` removes remote credentials with the package's port of gix-url's rules. `gix` and `gix-url` (about 40 crates) are no longer in the build, only in tests: the `git` CLI checks the objects (`git fsck --strict`), and gix-url is the oracle for 200,000 generated remotes.
- Builds no longer recompile most of the workspace every time: the Ziran build scripts watched the optional `ziran.local.toml`, and Cargo reruns a script on every build while a watched file is missing. The override is now watched only while it exists; touch `ziran.toml` after adding one.
- Make builds no longer cap themselves at 2 GiB of RAM in their own `xcoder-compilation.scope`: a release build that needs more spent hours in swap. They still run at nice 19 and the lowest I/O priority; memory limits come from the surrounding build queue. `XCODER_BUILD_SCOPE` is gone.
- The TUI header, `/status`, the session banner of `xcoder exec`, analytics and turn metadata show the Codex version Xcoder tracks (at least 0.169.0, following the newest upstream release) instead of `v0.0.0`; `xcoder --version` still shows Xcoder's own number.
- Windows support is removed. Gone: the Windows sandbox crates (restricted-token, elevated and MXC backends, their setup service and `codex sandbox windows`/`uninstall`), PowerShell and `cmd` shell support (including the tree-sitter PowerShell grammar), Windows-only code paths, the `[windows]` config and managed requirements, Windows hook commands and managed hook directories, Windows computer-use app rules, the Windows sandbox app-server requests and TUI prompts, the Windows standalone updater, and the Windows CI and installer scripts. Old config keys for these features are ignored.
- `apply_patch` recognizes its heredoc form (`apply_patch <<'EOF' ... EOF`, optionally after `cd <path> &&`) with Ziran instead of a tree-sitter query; tree-sitter is now only a test dependency of apply-patch. Heredoc bodies end at the exact delimiter line, as in Bash, so a patch line such as `EOFX` no longer cuts the patch short.
- Dangerous-command detection finds the commands in a shell script with Ziran (`native/shell.zi`): every command in lists, pipelines, subshells, groups, if/while/until/for/case and function bodies, `$(...)`, backticks, process substitutions, double quotes and unquoted heredoc bodies. It never misses a dangerous command tree-sitter found in a script Bash would run (40,000 generated scripts, 1,005 real ones), still ignores scripts Bash rejects, and also catches dangerous commands in real scripts tree-sitter could not parse.
- The check that a shell script is only plain commands joined by `&&`, `||`, `;`, `|` and newlines (the proof exec policy and the safe-command lists rely on) runs in Ziran (`native/shell.zi`) instead of walking a tree-sitter parse. It is never looser than tree-sitter: on 50,000 generated scripts it accepts nothing tree-sitter rejects and returns the same words, and on 1,005 real agent commands the two agree exactly.
- Streaming an `apply_patch` call no longer clones and reformats the whole patch for every few characters the model sends: the progress snapshot is rebuilt only when a delta completes a line, and the patch parser reads deltas line by line instead of one character at a time.
- Rules files (`.rules` exec policies) are parsed in Ziran (`native/execpolicy.zi`) instead of by a Starlark interpreter. The declarative subset they use still works: `prefix_rule`, `network_rule` and `host_executable` calls, `NAME = value` assignments, strings with Starlark escapes, lists, tuples, `None`/`True`/`False`, names and `+`. Functions, loops, conditions, `load` and f-strings are reported as unsupported with their line. The Starlark interpreter and about 60 crates it pulled in are gone.
- `apply_patch` applies an update in Ziran from start to end: it splits the file into line offsets, finds every hunk, and writes the new contents once, keeping each line's ending, instead of copying every line into a string several times. A 20-hunk update of a 50,000-line file takes 3.2 ms instead of 7.7 ms; results and error messages match the Rust code on 3,000 generated patches.
- `apply_patch` finds where each hunk goes with a Ziran matcher (`native/apply_patch.zi`) that borrows the file's lines instead of copying them. Answers are identical to the Rust matcher it replaces (checked against it on thousands of generated cases); on a 50,000-line file the whitespace- and punctuation-tolerant searches and searches that find nothing are 4-5x faster, exact matches cost about 0.4 ms more. `make benchmark-apply-patch` measures it.
- Parallel tool cells no longer fail at random with "Text file busy": starting a freshly compiled cell retries while another thread's fork still holds the file.
- The upstream Codex version check runs on its own thread, so a slow network never delays Xcoder exiting; the offline local tests turn it off.
- GPT-6.2-Sol (`gpt-6.2-sol`) is in the bundled model table, first, so it is the default when no model is configured even if the live catalog cannot be fetched. The entry is the provider's own (500,000-token context, efforts low to ultra, freeform `apply_patch`, code-mode-only tools, the `ultrafast` service tier, audio input). Before, a session whose catalog request timed out (the request has 5 s, including DNS) started on GPT-6.1-Sol, or ran GPT-6.2-Sol with fallback metadata and the warning "Model metadata for `gpt-6.2-sol` not found".
- The `new-model` skill (`skills/new-model/SKILL.md`) lists the steps for adopting a new model, with the checks that save time: logins with quota and DNS speed first, builds only through `make`, real turns started as soon as the binary exists. `scripts/model-turns.py` runs the 12 real turns (a plain answer, a shell call and a patch edit at each effort). `scripts/install-xcoder-remote.sh omega|delta` installs the locally installed build on Omega or Delta, renaming each file into place.
## 0.1.0 — 2026-11-14
First Xcoder release: Codex with native Ziran tool execution, for Linux x86_64.
- Installing replaces the previous binaries in place; the installer no longer keeps copies of them.
- Shell commands that run before the session's shell snapshot is written also put Xcoder's `apply_patch` ahead of a login profile's `PATH`; only snapshot restores replayed it before.
- Tool cells no longer fail with "unexpected end of file" when they exit: the callback channels a cell leaves unused now close quietly.
- The version Xcoder reports to the Codex service follows the newest upstream Codex release, not Xcoder's own version: at least 0.169.0, and newer once GitHub's latest `openai/codex` release says so (checked in the background at most every 20 hours, cached in `CODEX_HOME/xcoder-upstream-version.json`; `XCODER_UPSTREAM_VERSION_CHECK=0` turns the check off). The model catalog, the User-Agent and the `version` header all use it, so newer models such as GPT-6.1-Sol are listed and accepted; while requests said `0.0.0`, the service hid GPT-6.1-Sol and refused it.
- `xcoder --version` shows Xcoder's own release number.
- Remove parts Xcoder never uses under Harmony: the `cloud`, `tcp-tunnel`, `responses-api-proxy`, `exec-server` and `debug app-server` subcommands with their seven crates, the Ollama and LM Studio providers, and the AWS SDK behind Amazon Bedrock sign-in. `--oss` now stops at startup with an explanation instead of probing for local servers, and Bedrock selection reports that it is unavailable. About 22,000 lines and the AWS SDK dependency tree are gone.
- An idle Xcoder session gives its memory back. After two minutes without work (`XCODER_IDLE_RELEASE_SECONDS`; `0` turns it off) a watcher written in Ziran returns the allocator's free pages, moves private memory to swap and unmaps unmodified program pages. The session stays intact and pages back what its next event touches. `make benchmark-memory` measures a long offline session before and after.
- The TUI's replay copy of a finished command keeps only the start and end of output above 16 KiB; the live cell still holds the full output. Every command's output was held twice for the life of the session.
- Identify the running Xcoder CLI process as `xcode` on Linux, including when
compatibility launch paths retain their existing filenames.
- Shell commands run Xcoder's own `apply_patch`, even when a login profile resets `PATH` or puts another `apply_patch` first. A profile copy had dropped each added file's first line and written the rest twice.
- New standalone installations expose the `xcoder` command without adding a `codex` alias.
- Download tested Linux x86_64 Xcoder builds, including the native compiler, from the repository's Xcoder Linux workflow.
- Render Mermaid diagrams through the standalone Ziran `mermaid` package; the Rust crate is only its adapter, and the original renderer's snapshots and public-API tests run against it.
- Use the exact streamed custom tool input when a final snapshot disagrees with its deltas; reject mismatched completions and incomplete streams.
- Replace the TUI fuzzy matcher with a Ziran native implementation that streams the haystack and caches only the lowered needle.
- Bound GNU allocator arena retention while preserving owner settings; keep custom-cell compilation to one worker and support long private runtime paths.
- Execute ordinary tool plans through the precompiled Ziran executor and cache custom Zi2c cells; add matched offline JavaScript/native benchmarks.
- Xcoder executes tool programs natively from Ziran, with tool approvals, cancellation and saved session values.
- Certify installation only after the complete local test suite passes for the exact packaged executables; test pending parallel calls and recovery after callback errors.
- Fix missing command lifecycle events when unified exec cannot create a process, preserving approval rejection and sandbox retry behavior. Thanks @Marvinthebored ([#44557](https://github.com/openai/codex/issues/44557)).
+114 -89
View File
@@ -4,21 +4,34 @@ bazel_dep(name = "bazel_lib", version = "3.2.2")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "platforms", version = "1.0.0")
# Expose rules_rs's existing dependency for the openssl-sys replacement's SBOM.
bazel_dep(name = "package_metadata", version = "0.0.7")
# Expose the public protobuf rules already used transitively by rules_rs.
bazel_dep(name = "protobuf", version = "34.0.bcr.1", repo_name = "com_google_protobuf")
# Backport protobuf#31266 (849e1cbf91af): MSVC also needs the ARM64 SEH workaround.
single_version_override(
module_name = "protobuf",
patch_strip = 1,
patches = ["//patches:protobuf_windows_arm64_seh.patch"],
)
bazel_dep(name = "llvm", version = "0.8.11")
bazel_dep(name = "windows_support", version = "0.2.0")
bazel_dep(name = "with_cfg.bzl", version = "0.12.0")
# Patch hermetic LLVM for Codex's custom libc++ and Windows gnullvm runtime
# needs that have not landed upstream.
single_version_override(
# Merged target-scoped C++ standard-library opt-outs for V8's private libc++.
# https://github.com/hermeticbuild/hermetic-llvm/pull/903
# Includes explicit MSVC CRT startup-library selection for dependency-provided main.
# https://github.com/hermeticbuild/hermetic-llvm/pull/914
archive_override(
module_name = "llvm",
integrity = "sha256-KTjljFEA8dmXkOoVz6Wv3yqkMfqrbS5iDv/ef4GYsu0=",
patch_strip = 1,
patches = [
"//patches:llvm_rusty_v8_custom_libcxx.patch",
"//patches:llvm_windows_arm64_powl.patch",
"//patches:llvm_windows_mingw_compat.patch",
],
patches = ["//patches:llvm_mingw_import_warnings.patch"],
strip_prefix = "hermetic-llvm-d27493f0386c9d4d28f7b12630cb91b0cdfd20f1",
urls = ["https://github.com/hermeticbuild/hermetic-llvm/archive/d27493f0386c9d4d28f7b12630cb91b0cdfd20f1.tar.gz"],
)
# Preserve case-only SDK aliases when native Windows repository setup feeds
@@ -145,23 +158,10 @@ use_repo(osx, "macos_sdk")
# Needed to disable xcode...
bazel_dep(name = "apple_support", version = "2.1.0")
bazel_dep(name = "rules_cc", version = "0.2.18")
# Windows voice jobs explicitly select the installed MSVC C toolchains.
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
use_repo(cc_configure, "local_config_cc")
single_version_override(
module_name = "rules_cc",
patch_strip = 1,
patches = [
"//patches:rules_cc_windows_native_llvm.patch",
],
)
bazel_dep(name = "rules_cc", version = "0.2.25")
bazel_dep(name = "rules_platform", version = "0.1.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "aws-lc", version = "5.1.0.bcr.1")
bazel_dep(name = "aws-lc", version = "5.1.0.bcr.3")
bazel_dep(name = "rules_rs", version = "0.0.96")
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
single_version_override(
@@ -204,35 +204,31 @@ use_repo(pip, "schema_python")
register_toolchains("@rules_foreign_cc//toolchains:built_make_toolchain")
foreign_cc_tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools")
use_repo(foreign_cc_tools, "cmake-3.31.8-windows-x86_64", "pkgconfig_src")
use_repo(foreign_cc_tools, "cmake-3.31.8-windows-x86_64", "ninja_1.13.0_win", "pkgconfig_src")
single_version_override(
register_toolchains("//third_party/voice:windows_ninja_toolchain")
archive_override(
module_name = "rules_rs",
integrity = "sha256-b8sUj9EvM72+so/q4uRH91ed7QwOO8EoGbdL8NyBjE4=",
patch_strip = 1,
patches = [
"//patches:rules_rs_bindgen_v0_0_4.patch",
"//patches:rules_rs_build_script_deps_annotation.patch",
"//patches:rules_rs_rust_debug_modes.patch",
"//patches:rules_rs_windows_msvc_linker.patch",
"//patches:rules_rs_workspace_package_version.patch",
"//patches:rules_rs_zlib_snapshot_urls.patch",
],
version = "0.0.96",
strip_prefix = "rules_rs-7a05511772a8a85db5382ff7536bf2f1e6a8dde3",
urls = ["https://github.com/hermeticbuild/rules_rs/archive/7a05511772a8a85db5382ff7536bf2f1e6a8dde3.tar.gz"],
)
rules_rust = use_extension("@rules_rs//rs:rules_rust.bzl", "rules_rust")
rules_rust.patch(
patches = [
# Carry the OpenAI setup fix that makes build-script tools available
# through their runfiles after the rules_rs upgrade.
"//patches:rules_rust_build_script_tools_transition.patch",
# Opt-in release profile compatibility for native Cargo build scripts.
"//patches:rules_rust_release_build_script_profile.patch",
# Prefer Rust's direct linker for Windows/MSVC and keep hermetic
# LLVM's non-.lib runtime artifacts compatible with it.
"//patches:rules_rust_windows_msvc_direct_link_args.patch",
# Skip transient native-Windows linker outputs while consolidating
# dependency search paths.
"//patches:rules_rust_windows_process_wrapper_skip_temp_outputs.patch",
# Refreshed upstream PR #92; forwarding comes from merged #102.
"//patches:rules_rust_declared_msvc_linker.patch",
# Spill wrapper arguments to a params file to avoid Windows command-line limits.
"//patches:rules_rust_process_wrapper_param_file.patch",
"//patches:rules_rust_windows_execroot_separators.patch",
@@ -329,7 +325,7 @@ toolchains.toolchain(
)
use_repo(toolchains, "default_rust_toolchains")
register_toolchains("@default_rust_toolchains//:all")
register_toolchains("@default_rust_toolchains//...")
register_toolchains("@rust_toolchains//:all")
@@ -385,6 +381,11 @@ crate.from_cargo(
bazel_dep(name = "zstd", version = "1.5.7.bcr.2")
crate.annotation(
# Debug builds must also embed assets instead of reading the worker's source tree.
crate = "rust-embed",
crate_features = ["debug-embed"],
)
crate.annotation(
# Keep Windows proxy authentication aligned with codex-rs/.cargo/config.toml.
build_script_env = {"CFLAGS": "-DCURL_ENABLE_NTLM"},
@@ -394,13 +395,26 @@ crate.annotation(
# Daemon tests repeatedly hash large CLI binaries, even in fastbuild mode.
# Optimize the native backends as well as the Rust implementation.
build_script_env = {"OPT_LEVEL": "3"},
# The Windows lint toolchain cannot reliably materialize blake3's native x86 assembly archives.
crate = "blake3",
crate_features_select = {
"x86_64-pc-windows-gnullvm": ["pure"],
},
rustc_flags = ["-Copt-level=3"],
)
crate.annotation_select(
# Avoid native x86 assembly tools unavailable when cross-compiling Windows.
crate = "blake3",
crate_features = ["pure"],
triples = [
"x86_64-pc-windows-gnullvm",
"x86_64-pc-windows-msvc",
],
)
# Backport notify-rs/notify@a9c51183: wake idle Windows watchers on events and control requests.
crate.annotation(
crate = "notify",
patch_args = ["-p1"],
patches = ["//patches:notify_windows_idle.patch"],
version = "8.2.0",
)
# Match the CodeModeHost response-compression benchmark's zstd level.
crate.annotation(
@@ -492,25 +506,6 @@ bazel_dep(name = "openssl", version = "3.5.4.bcr.0")
inject_repo(crate, "xz")
crate.annotation(
build_script_data = [
"@openssl//:gen_dir",
],
# Build scripts compile in Bazel's exec configuration, so target-specific
# optional build deps are otherwise dropped for the musl release platforms.
build_script_deps = [
"@crates//:openssl-src-300.6.1+3.6.3",
],
build_script_env = {
"OPENSSL_DIR": "$(execpath @openssl//:gen_dir)",
"OPENSSL_NO_VENDOR": "1",
"OPENSSL_STATIC": "1",
},
crate = "openssl-sys",
data = ["@openssl//:gen_dir"],
gen_build_script = "on",
)
inject_repo(crate, "openssl")
crate.annotation(
@@ -539,6 +534,22 @@ crate.annotation(
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Cargo keeps vendored OpenSSL for musl; Bazel already supplies its own OpenSSL.
# Replace this crate's generated build, not Cargo's feature resolution.
http_archive(
name = "openssl_sys_bazel",
build_file = "//third_party/openssl:openssl_sys.BUILD.bazel",
sha256 = "19c413d6ec9ebaf5e1c829d355cb3e9f783778d700f135be0921d52fce3c60ae",
strip_prefix = "openssl-sys-0.9.118",
type = "tar.gz",
urls = ["https://static.crates.io/crates/openssl-sys/openssl-sys-0.9.118.crate"],
)
override_repo(
crate,
**{"crates__openssl-sys-0.9.118": "openssl_sys_bazel"}
)
codex_release_archive = use_repo_rule("//bazel/extensions:codex_release_archive.bzl", "codex_release_archive")
codex_release_archive(
@@ -557,6 +568,14 @@ new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.
include("//bazel/modules:wine.MODULE.bazel")
# Run V8's Windows snapshot generator natively or with the executor's Wine.
bazel_dep(name = "rules_wine", version = "0.1.3")
wine = use_extension("@rules_wine//wine/extension:wine.bzl", "wine")
use_repo(wine, "wine_toolchains")
register_toolchains("@wine_toolchains//:all")
voice_sources = use_extension("//third_party/voice:extensions.bzl", "voice_sources")
use_repo(
voice_sources,
@@ -600,25 +619,29 @@ crate.annotation(
"RUSTY_V8_SRC_BINDING_PATH": "$(execpath @v8_targets//:rusty_v8_binding_for_target)",
},
crate = "v8",
# Keep the Rust feature aligned with the sandbox archive/binding pairs.
crate_features_select = {
"aarch64-apple-darwin": ["v8_enable_sandbox"],
"aarch64-pc-windows-gnullvm": ["v8_enable_sandbox"],
"aarch64-pc-windows-msvc": ["v8_enable_sandbox"],
"aarch64-unknown-linux-gnu": ["v8_enable_sandbox"],
"aarch64-unknown-linux-musl": ["v8_enable_sandbox"],
"x86_64-apple-darwin": ["v8_enable_sandbox"],
"x86_64-pc-windows-gnullvm": ["v8_enable_sandbox"],
"x86_64-pc-windows-msvc": ["v8_enable_sandbox"],
"x86_64-unknown-linux-gnu": ["v8_enable_sandbox"],
"x86_64-unknown-linux-musl": ["v8_enable_sandbox"],
},
gen_build_script = "on",
patch_args = ["-p1"],
patches = [
"//patches:rusty_v8_prebuilt_out_dir.patch",
],
)
crate.annotation_select(
# Keep the Rust feature aligned with the sandbox archive/binding pairs.
crate = "v8",
crate_features = ["v8_enable_sandbox"],
triples = [
"aarch64-apple-darwin",
"aarch64-pc-windows-gnullvm",
"aarch64-pc-windows-msvc",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"x86_64-apple-darwin",
"x86_64-pc-windows-gnullvm",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
],
)
inject_repo(crate, "v8_targets")
@@ -626,11 +649,17 @@ llvm = use_extension("@llvm//extensions:llvm.bzl", "llvm")
use_repo(llvm, "llvm-project")
crate.annotation(
# Disable SQLite intrinsics that can crash at startup on older x64 Windows CPUs.
build_script_env_select = {
"x86_64-pc-windows-msvc": '{"LIBSQLITE3_FLAGS": "SQLITE_DISABLE_INTRINSIC"}',
},
additive_build_file = "//third_party/sqlite:libsqlite3_sys.BUILD.bazel",
crate = "libsqlite3-sys",
extra_aliased_targets = {
"libsqlite3_sys_bindings": "sqlite3/bindgen_bundled_version.rs",
"libsqlite3_sys_headers": "sqlite3_headers",
"libsqlite3_sys_source": "sqlite3/sqlite3.c",
},
gen_build_script = "off",
repositories = ["crates"],
version = "0.39.1",
deps = ["//third_party/sqlite:libsqlite3_sys_build_info"],
)
crate.annotation(
# Provide the hermetic SDK path so the build script doesn't try to invoke an unhermetic `xcrun --show-sdk-path`.
@@ -671,6 +700,12 @@ crate.annotation(
"@rules_foreign_cc//toolchains:current_ninja_toolchain",
],
crate = "opusic-sys",
patch_args = ["-p1"],
patches = [
"//patches:opusic_sys_install_headers.patch",
# Presuming NEON must include its implementations without requiring RTCD.
"//patches:opusic-sys_presume_neon.patch",
],
)
# The musl CLI's allocator needs declared native tools and consistent header flags.
@@ -833,6 +868,7 @@ engine_repository(
"//patches:v8_source_portability.patch",
"//patches:v8_array_sort_elements_kind.patch",
"//third_party/v8:v8_defs.patch",
"//third_party/v8:v8_windows_snapshot_wine.patch",
],
strip_prefix = "v8-15.2.124.1",
urls = ["https://github.com/v8/v8/archive/refs/tags/15.2.124.1.tar.gz"],
@@ -851,17 +887,6 @@ pip.parse(
)
use_repo(pip, "v8_python_deps")
native_windows_llvm = use_repo_rule("//third_party/v8:native_windows.bzl", "native_windows_llvm")
native_windows_llvm(name = "v8_native_windows_llvm")
native_windows_cc = use_repo_rule("//third_party/v8:native_windows.bzl", "native_windows_cc")
native_windows_cc(
name = "v8_native_windows_cc",
native_llvm = "@v8_native_windows_llvm//:BUILD.bazel",
)
v8_dependencies = use_extension("//third_party/v8:dependencies.bzl", "dependencies")
use_repo(
v8_dependencies,
+57 -50
View File
@@ -24,11 +24,10 @@
"https://bcr.bazel.build/modules/apple_support/1.24.1/MODULE.bazel": "f46e8ddad60aef170ee92b2f3d00ef66c147ceafea68b6877cb45bd91737f5f8",
"https://bcr.bazel.build/modules/apple_support/1.24.2/MODULE.bazel": "0e62471818affb9f0b26f128831d5c40b074d32e6dda5a0d3852847215a41ca4",
"https://bcr.bazel.build/modules/apple_support/2.1.0/MODULE.bazel": "b15c125dabed01b6803c129cd384de4997759f02f8ec90dc5136bcf6dfc5086a",
"https://bcr.bazel.build/modules/apple_support/2.1.0/source.json": "78064cfefe18dee4faaf51893661e0d403784f3efe88671d727cdcdc67ed8fb3",
"https://bcr.bazel.build/modules/aspect_tools_telemetry/0.3.3/MODULE.bazel": "37c764292861c2f70314efa9846bb6dbb44fc0308903b3285da6528305450183",
"https://bcr.bazel.build/modules/aspect_tools_telemetry/0.3.3/source.json": "605086bbc197743a0d360f7ddc550a1d4dfa0441bc807236e17170f636153348",
"https://bcr.bazel.build/modules/aws-lc/5.1.0.bcr.1/MODULE.bazel": "82300781422804ec45397555891b583bbaa21b97b5a8815e928e81089b7432bc",
"https://bcr.bazel.build/modules/aws-lc/5.1.0.bcr.1/source.json": "7d88fc6db323947a11d1638fe95185e9c733c337a1d1e7b50cdcf487e29ce56e",
"https://bcr.bazel.build/modules/apple_support/2.8.0/MODULE.bazel": "c45f5176057092afba0be6c48a9ea02101666802f8be536947e099e94757f8ed",
"https://bcr.bazel.build/modules/apple_support/2.8.0/source.json": "b7f6d87669c206adaa7d82cc44733349c63e341b80a0e049496ebd91d78c3472",
"https://bcr.bazel.build/modules/aws-lc/5.1.0.bcr.3/MODULE.bazel": "1a37c90d62306e5e4e910797a4ca0fc3baa9757f59c4bc0a9eec986575a994c4",
"https://bcr.bazel.build/modules/aws-lc/5.1.0.bcr.3/source.json": "7eb91be8193ac2c2770887ede60eeaa16434c8efa01afd76c9bb2096904f8b5d",
"https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd",
"https://bcr.bazel.build/modules/bazel_features/1.10.0/MODULE.bazel": "f75e8807570484a99be90abcd52b5e1f390362c258bcb73106f4544957a48101",
"https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8",
@@ -50,7 +49,6 @@
"https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080",
"https://bcr.bazel.build/modules/bazel_features/1.43.0/MODULE.bazel": "defa2226f06ba20550d6548c3a2ea2a7929634437a52973869c20c225450eb91",
"https://bcr.bazel.build/modules/bazel_features/1.45.0/MODULE.bazel": "7daec6d87ab0703417486d4cb948af0b06f55d4d7c08cbb5978c80e79b538edf",
"https://bcr.bazel.build/modules/bazel_features/1.47.0/MODULE.bazel": "e34df3cb35b1684cfa69923a61ae3803595babd3942cd306a488d51400886b30",
"https://bcr.bazel.build/modules/bazel_features/1.50.0/MODULE.bazel": "2083ef9c7a469f520890483ccf8e0189d6e71e2117e7752e15e6554433d5ae3e",
"https://bcr.bazel.build/modules/bazel_features/1.50.0/source.json": "e0ee3debde2789ff56e4452e612d126925ba9ab64d4bde79c67f099d2902df9b",
"https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b",
@@ -63,6 +61,7 @@
"https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686",
"https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a",
"https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5",
"https://bcr.bazel.build/modules/bazel_skylib/1.4.0/MODULE.bazel": "2ab127ef8d56a739a99bb2ce00ec4c7d1ecc7977d4370c0ca6efd0d8f03d6d99",
"https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d",
"https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651",
"https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138",
@@ -73,7 +72,8 @@
"https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6",
"https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67",
"https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7",
"https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0",
"https://bcr.bazel.build/modules/bazel_skylib/1.9.2/MODULE.bazel": "8c51259b0f4481475586dbfede7591e57b75702e637f840f6138eec80c34b270",
"https://bcr.bazel.build/modules/bazel_skylib/1.9.2/source.json": "41cbde7546542dee2f26e3f10bf1c4ac57909943194b7ac48cc5238a01893aa8",
"https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f",
"https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd",
"https://bcr.bazel.build/modules/bzip2/1.0.8.bcr.3/MODULE.bazel": "29ecf4babfd3c762be00d7573c288c083672ab60e79c833ff7f49ee662e54471",
@@ -88,21 +88,26 @@
"https://bcr.bazel.build/modules/googletest/1.17.0.bcr.2/MODULE.bazel": "827f54f492a3ce549c940106d73de332c2b30cebd0c20c0bc5d786aba7f116cb",
"https://bcr.bazel.build/modules/googletest/1.17.0.bcr.2/source.json": "3664514073a819992320ffbce5825e4238459df344d8b01748af2208f8d2e1eb",
"https://bcr.bazel.build/modules/googletest/1.17.0/MODULE.bazel": "dbec758171594a705933a29fcf69293d2468c49ec1f2ebca65c36f504d72df46",
"https://bcr.bazel.build/modules/hermetic_launcher/0.0.17/MODULE.bazel": "afa67883ae04001c93578f80c39e5ec9231ae670978bc380778baf66e1936ad5",
"https://bcr.bazel.build/modules/hermetic_launcher/0.0.17/source.json": "46ee01ccb275e46f59a3c070f91be52eb113405efe577a99365dd69f168713ef",
"https://bcr.bazel.build/modules/hermetic_launcher/0.0.8/MODULE.bazel": "3be7b0faca6f1e69e89197999e0b01ce058c42f3e764ef028466f7e0ff77c761",
"https://bcr.bazel.build/modules/hermetic_launcher/0.0.8/source.json": "8403718636114198fca6ea04b437fa001ac7167b4d485102defb0a6f7d11bc08",
"https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075",
"https://bcr.bazel.build/modules/jsoncpp/1.9.6/MODULE.bazel": "2f8d20d3b7d54143213c4dfc3d98225c42de7d666011528dc8fe91591e2e17b0",
"https://bcr.bazel.build/modules/jsoncpp/1.9.6/source.json": "a04756d367a2126c3541682864ecec52f92cdee80a35735a3cb249ce015ca000",
"https://bcr.bazel.build/modules/libcap/2.27.bcr.1/MODULE.bazel": "7c034d7a4d92b2293294934377f5d1cbc88119710a11079fa8142120f6f08768",
"https://bcr.bazel.build/modules/libcap/2.27.bcr.1/source.json": "3b116cbdbd25a68ffb587b672205f6d353a4c19a35452e480d58fc89531e0a10",
"https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902",
"https://bcr.bazel.build/modules/llvm/0.8.11/MODULE.bazel": "0f8c30b74be64f0e91764e925d0f562c70e8d85b6cea912f724d6b3753d6a33f",
"https://bcr.bazel.build/modules/llvm/0.8.11/source.json": "b40edb2bb2ed271bf613b396d245cb473c42fb057a2b26a3bc7d7e8bfcf6aa71",
"https://bcr.bazel.build/modules/llvm/0.8.9/MODULE.bazel": "9e35ff5bcac996f9edc1b44b8f8baa58c7855e742c5608b07d925dcdbe642100",
"https://bcr.bazel.build/modules/libxml2/2.15.3/MODULE.bazel": "a6bffafd8aa8b0c13eaa4bf25d55be188ec8548549395f03e98c39bab264adaa",
"https://bcr.bazel.build/modules/libxml2/2.15.3/source.json": "fd7c420cb14981416c9fadd0db555bd1e249355e0e5b63b2ce15b92996b5fbfb",
"https://bcr.bazel.build/modules/mimalloc/3.5.3/MODULE.bazel": "d4555726ceff5240bef25b0ec38b1c80c68337eec2b4b5df20cf611df1383e6a",
"https://bcr.bazel.build/modules/mimalloc/3.5.3/source.json": "e94e4baf53f881236b86b16c436c6ab4a338b37135e370154802a7111c0dda28",
"https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.2/MODULE.bazel": "5c5596def463aeee17e5a4848a50f02f0cf4a351fc2f0dcc4444f1d87d2d3b08",
"https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.2/source.json": "2b8823c08a9b22f5d516619e437059e449159e7472bffba256cced8ba74643b5",
"https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74",
"https://bcr.bazel.build/modules/openssl/3.5.4.bcr.0/MODULE.bazel": "0f6b8f20b192b9ff0781406256150bcd46f19e66d807dcb0c540548439d6fc35",
"https://bcr.bazel.build/modules/openssl/3.5.4.bcr.0/source.json": "543ed7627cc18e6460b9c1ae4a1b6b1debc5a5e0aca878b00f7531c7186b73da",
"https://bcr.bazel.build/modules/package_metadata/0.0.3/MODULE.bazel": "77890552ecea9e284b5424c9de827a58099348763a4359e975c359a83d4faa83",
"https://bcr.bazel.build/modules/package_metadata/0.0.6/MODULE.bazel": "341dab6f417197494517d54c8e557c0baee1de7aec83543a4fbefe57900acb7e",
"https://bcr.bazel.build/modules/package_metadata/0.0.7/MODULE.bazel": "7adb03933fc8401f495800cf4eafcff0edc6da0ff55c7db223ef69d19f689486",
"https://bcr.bazel.build/modules/package_metadata/0.0.7/source.json": "50639625e937b56115012674c797cca7a05a96b4878c87d803c13dc2b31de8a0",
"https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5",
@@ -162,11 +167,12 @@
"https://bcr.bazel.build/modules/rules_cc/0.2.16/MODULE.bazel": "9242fa89f950c6ef7702801ab53922e99c69b02310c39fb6e62b2bd30df2a1d4",
"https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84",
"https://bcr.bazel.build/modules/rules_cc/0.2.18/MODULE.bazel": "4460ec36adc8f722a6a2a4ac9374cb91f2acebadaa93fc37966129afb3dece87",
"https://bcr.bazel.build/modules/rules_cc/0.2.19/MODULE.bazel": "d5e0f05b63273281a16654eb6b1a8742a75ec153ac8b4f0419949d6e401e46f0",
"https://bcr.bazel.build/modules/rules_cc/0.2.20/MODULE.bazel": "f5c07bce5ddcb99be21a0812ff5aadb439e688b7449c6542152363b2fd859c1a",
"https://bcr.bazel.build/modules/rules_cc/0.2.20/source.json": "1155433dc6b8161bc339ce94095b337ed95feb1f048b014e10b62339d4b4239c",
"https://bcr.bazel.build/modules/rules_cc/0.2.25/MODULE.bazel": "4a3d4f3606d3b3190be495dbc497acca552807d1d5540661ef0d1658472882e3",
"https://bcr.bazel.build/modules/rules_cc/0.2.25/source.json": "8df28a9a97b878fe45f0a4f4adf019869dda51a60ee2f6e15a0c79656a25058d",
"https://bcr.bazel.build/modules/rules_cc/0.2.4/MODULE.bazel": "1ff1223dfd24f3ecf8f028446d4a27608aa43c3f41e346d22838a4223980b8cc",
"https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642",
"https://bcr.bazel.build/modules/rules_cc/0.2.9/MODULE.bazel": "34263f1dca62ea664265438cef714d7db124c03e1ed55ebb4f1dc860164308d1",
"https://bcr.bazel.build/modules/rules_foreign_cc/0.15.1/MODULE.bazel": "c2c60d26c79fda484acb95cdbec46e89d6b28b4845cb277160ce1e0c8622bb88",
"https://bcr.bazel.build/modules/rules_foreign_cc/0.15.1/source.json": "a161811a63ba8a859086da3b7ff3ad04f2e9c255d7727b41087103fc0eb22f55",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",
@@ -224,19 +230,21 @@
"https://bcr.bazel.build/modules/rules_python/1.6.0/MODULE.bazel": "7e04ad8f8d5bea40451cf80b1bd8262552aa73f841415d20db96b7241bd027d8",
"https://bcr.bazel.build/modules/rules_python/1.6.3/MODULE.bazel": "a7b80c42cb3de5ee2a5fa1abc119684593704fcd2fec83165ebe615dec76574f",
"https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8",
"https://bcr.bazel.build/modules/rules_python/1.8.0/MODULE.bazel": "c151c025dbcc93d8f62ab68ecc313c9176a868a0e6386981bf2a12aec77cbe7b",
"https://bcr.bazel.build/modules/rules_python/2.4.2/MODULE.bazel": "fde4307b6765b6f261c40a2c08140a5d10e3aa9b6c12e23bb57d31b7ce124c29",
"https://bcr.bazel.build/modules/rules_python/2.4.2/source.json": "225828a44c27fa97ba8a594e6fd3b752061779f052d40c4bb5d6b45f2ded567b",
"https://bcr.bazel.build/modules/rules_rs/0.0.96/MODULE.bazel": "678fdcee5a9847611276770eab47190dda04a41973b7bf6037e50a3f98e49e09",
"https://bcr.bazel.build/modules/rules_rs/0.0.96/source.json": "2b52d3d209324bd4aaa4896aa0e8b28d0123856b4ade32ebd7bf24b4fded6f12",
"https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c",
"https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b",
"https://bcr.bazel.build/modules/rules_shell/0.4.1/MODULE.bazel": "00e501db01bbf4e3e1dd1595959092c2fadf2087b2852d3f553b5370f5633592",
"https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b",
"https://bcr.bazel.build/modules/rules_shell/0.6.1/source.json": "20ec05cd5e592055e214b2da8ccb283c7f2a421ea0dc2acbf1aa792e11c03d0c",
"https://bcr.bazel.build/modules/rules_shell/0.8.0/MODULE.bazel": "f6a89f1d6a669a26f28fe814503857055d76306b79cfc11d12399af08d0b80ae",
"https://bcr.bazel.build/modules/rules_shell/0.8.0/source.json": "eb53cc815bc503c6683c5fe12d943f98883f81fc22f51403ec8a95610cba4195",
"https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca",
"https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046",
"https://bcr.bazel.build/modules/rules_swift/2.4.0/MODULE.bazel": "1639617eb1ede28d774d967a738b4a68b0accb40650beadb57c21846beab5efd",
"https://bcr.bazel.build/modules/rules_swift/3.1.2/MODULE.bazel": "72c8f5cf9d26427cee6c76c8e3853eb46ce6b0412a081b2b6db6e8ad56267400",
"https://bcr.bazel.build/modules/rules_wine/0.1.3/MODULE.bazel": "c4de7ea3fc70de78acf12afa9edc368de3678c924e6f7eb82d1c881d7f8b1265",
"https://bcr.bazel.build/modules/rules_wine/0.1.3/source.json": "c1a966ed7f4ab06355ce116ccb74685acc0d02d5463b46cb01f0c67cb0787600",
"https://bcr.bazel.build/modules/sed/4.9.bcr.3/MODULE.bazel": "3aca45895b85b6ef65366cc12a45217ba6870f8931d2d62e09c99c772d9736ab",
"https://bcr.bazel.build/modules/sed/4.9.bcr.3/source.json": "31c0cf4c135ed3fa58298cd7bcfd4301c54ea4cf59d7c4e2ea0a180ce68eb34f",
"https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8",
@@ -257,37 +265,19 @@
"https://bcr.bazel.build/modules/with_cfg.bzl/0.12.0/source.json": "3f3fbaeafecaf629877ad152a2c9def21f8d330d91aa94c5dc75bbb98c10b8b8",
"https://bcr.bazel.build/modules/xz/5.4.5.bcr.8/MODULE.bazel": "e48a69bd54053c2ec5fffc2a29fb70122afd3e83ab6c07068f63bc6553fa57cc",
"https://bcr.bazel.build/modules/xz/5.4.5.bcr.8/source.json": "bd7e928ccd63505b44f4784f7bbf12cc11f9ff23bf3ca12ff2c91cd74846099e",
"https://bcr.bazel.build/modules/zlib-ng/2.3.3.bcr.2/MODULE.bazel": "86130924115bf8dfc4aba286fb49a2ec8d32430a21771db9ccf5381acf0d10cc",
"https://bcr.bazel.build/modules/zlib-ng/2.3.3.bcr.2/source.json": "7aa4112eb2fbb99757e97cf0b7a4e2bdb3464b2b3cfb351bc807ffcb34bd349f",
"https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.8/MODULE.bazel": "772c674bb78a0342b8caf32ab5c25085c493ca4ff08398208dcbe4375fe9f776",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.8/source.json": "cf377d76800dfc3d3b71e9dd4a8c53a62837cbce37cc4f25e6207b15fc1e8f2b",
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198",
"https://bcr.bazel.build/modules/zstd/1.5.7.bcr.1/MODULE.bazel": "c5977176dd8555be7a9d598512ae0cae11831259c06f00a5e5e0037d5db4e3f5",
"https://bcr.bazel.build/modules/zstd/1.5.7.bcr.2/MODULE.bazel": "d20bf700aacefca7c09840baa4bae9b347ddb31bd9125f4e592998f80b980cd7",
"https://bcr.bazel.build/modules/zstd/1.5.7.bcr.2/source.json": "19cf972e5efc777e24008b90c2d819a4c814d33d1326c62d736ed97544817bf0"
},
"selectedYankedVersions": {},
"moduleExtensions": {
"@@aspect_tools_telemetry+//:extension.bzl%telemetry": {
"general": {
"bzlTransitiveDigest": "cl5A2O84vDL6Tt+Qga8FCj1DUDGqn+e7ly5rZ+4xvcc=",
"usagesDigest": "Miy0EWu0H7wJMzfdekpzuz3TBOzJz0l6aNIq2pL6k2g=",
"recordedInputs": [
"REPO_MAPPING:aspect_tools_telemetry+,bazel_lib bazel_lib+",
"REPO_MAPPING:aspect_tools_telemetry+,bazel_skylib bazel_skylib+"
],
"generatedRepoSpecs": {
"aspect_tools_telemetry_report": {
"repoRuleId": "@@aspect_tools_telemetry+//:extension.bzl%tel_repository",
"attributes": {
"deps": {
"rules_rs": "0.0.96",
"aspect_tools_telemetry": "0.3.3"
}
}
}
}
}
},
"@@protobuf+//python/dist:system_python.bzl%system_python_extension": {
"general": {
"bzlTransitiveDigest": "pmsA+awieucfllLc2n7k8xEoPp0i5LF9Hw6mGX0cqSQ=",
@@ -413,7 +403,7 @@
"@@windows_support+//windows:extensions.bzl%msvc_runtime": {
"general": {
"bzlTransitiveDigest": "hSBf9aCBJn12Lq4IKLqoUFuySmukaarmyjhYNGlHMX0=",
"usagesDigest": "XZ1DGFYwC06tBdgHxuZLhTfFlPFVKjmYmiBfiY2xe3c=",
"usagesDigest": "Wycz6MuhJkgFnFKT74nNjAB8lDNj/DZxNJp+NLqkIII=",
"recordedInputs": [
"REPO_MAPPING:windows_support+,bazel_tools bazel_tools"
],
@@ -444,7 +434,7 @@
"@@windows_support+//windows:extensions.bzl%windows_sdk": {
"general": {
"bzlTransitiveDigest": "hSBf9aCBJn12Lq4IKLqoUFuySmukaarmyjhYNGlHMX0=",
"usagesDigest": "M5xde76Im8TfiBsVtKQIavNOkqfp1QsjwJD4fVrrtFs=",
"usagesDigest": "fTIVqkpB+CwNlT/+OWVe6OAlNwEQixGYGJ+y+TLh3cM=",
"recordedInputs": [
"REPO_MAPPING:windows_support+,bazel_tools bazel_tools"
],
@@ -1239,8 +1229,8 @@
"der-parser_10.0.0": "{\"dependencies\":[{\"name\":\"asn1-rs\",\"req\":\"^0.7\"},{\"name\":\"bitvec\",\"optional\":true,\"req\":\"^1.0\"},{\"name\":\"cookie-factory\",\"optional\":true,\"req\":\"^0.3.0\"},{\"default_features\":false,\"name\":\"displaydoc\",\"req\":\"^0.2\"},{\"kind\":\"dev\",\"name\":\"hex-literal\",\"req\":\"^0.4\"},{\"name\":\"nom\",\"req\":\"^7.0\"},{\"name\":\"num-bigint\",\"optional\":true,\"req\":\"^0.4\"},{\"name\":\"num-traits\",\"req\":\"^0.2\"},{\"kind\":\"dev\",\"name\":\"pretty_assertions\",\"req\":\"^1.0\"},{\"name\":\"rusticata-macros\",\"req\":\"^4.0\"},{\"kind\":\"dev\",\"name\":\"test-case\",\"req\":\"^3.0\"}],\"features\":{\"as_bitvec\":[\"bitvec\"],\"bigint\":[\"num-bigint\"],\"default\":[\"std\"],\"serialize\":[\"std\",\"cookie-factory\"],\"std\":[],\"unstable\":[]}}",
"der-parser_9.0.0": "{\"dependencies\":[{\"name\":\"asn1-rs\",\"req\":\"^0.6\"},{\"name\":\"cookie-factory\",\"optional\":true,\"req\":\"^0.3.0\"},{\"default_features\":false,\"name\":\"displaydoc\",\"req\":\"^0.2\"},{\"kind\":\"dev\",\"name\":\"hex-literal\",\"req\":\"^0.4\"},{\"name\":\"nom\",\"req\":\"^7.0\"},{\"name\":\"num-bigint\",\"optional\":true,\"req\":\"^0.4\"},{\"name\":\"num-traits\",\"req\":\"^0.2\"},{\"kind\":\"dev\",\"name\":\"pretty_assertions\",\"req\":\"^1.0\"},{\"name\":\"rusticata-macros\",\"req\":\"^4.0\"},{\"kind\":\"dev\",\"name\":\"test-case\",\"req\":\"^3.0\"}],\"features\":{\"bigint\":[\"num-bigint\"],\"default\":[\"std\"],\"serialize\":[\"std\",\"cookie-factory\"],\"std\":[],\"unstable\":[]}}",
"der_0.7.10": "{\"dependencies\":[{\"features\":[\"derive\"],\"name\":\"arbitrary\",\"optional\":true,\"req\":\"^1.3\"},{\"default_features\":false,\"name\":\"bytes\",\"optional\":true,\"req\":\"^1\"},{\"name\":\"const-oid\",\"optional\":true,\"req\":\"^0.9.2\"},{\"name\":\"der_derive\",\"optional\":true,\"req\":\"^0.7.2\"},{\"name\":\"flagset\",\"optional\":true,\"req\":\"^0.4.3\"},{\"kind\":\"dev\",\"name\":\"hex-literal\",\"req\":\"^0.4.1\"},{\"features\":[\"alloc\"],\"name\":\"pem-rfc7468\",\"optional\":true,\"req\":\"^0.7\"},{\"kind\":\"dev\",\"name\":\"proptest\",\"req\":\"^1\"},{\"default_features\":false,\"name\":\"time\",\"optional\":true,\"req\":\"^0.3.4\"},{\"default_features\":false,\"name\":\"zeroize\",\"optional\":true,\"req\":\"^1.5\"}],\"features\":{\"alloc\":[\"zeroize?/alloc\"],\"arbitrary\":[\"dep:arbitrary\",\"const-oid?/arbitrary\",\"std\"],\"bytes\":[\"dep:bytes\",\"alloc\"],\"derive\":[\"dep:der_derive\"],\"oid\":[\"dep:const-oid\"],\"pem\":[\"dep:pem-rfc7468\",\"alloc\",\"zeroize\"],\"real\":[],\"std\":[\"alloc\"]}}",
"deranged_0.5.5": "{\"dependencies\":[{\"name\":\"deranged-macros\",\"optional\":true,\"req\":\"=0.3.0\"},{\"default_features\":false,\"name\":\"num-traits\",\"optional\":true,\"req\":\"^0.2.15\"},{\"default_features\":false,\"name\":\"powerfmt\",\"optional\":true,\"req\":\"^0.2.0\"},{\"default_features\":false,\"name\":\"quickcheck\",\"optional\":true,\"req\":\"^1.0.3\"},{\"default_features\":false,\"name\":\"rand08\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"kind\":\"dev\",\"name\":\"rand08\",\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"default_features\":false,\"name\":\"rand09\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.9.0\"},{\"kind\":\"dev\",\"name\":\"rand09\",\"package\":\"rand\",\"req\":\"^0.9.0\"},{\"default_features\":false,\"name\":\"serde_core\",\"optional\":true,\"req\":\"^1.0.220\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.86\"}],\"features\":{\"alloc\":[],\"default\":[],\"macros\":[\"dep:deranged-macros\"],\"num\":[\"dep:num-traits\"],\"powerfmt\":[\"dep:powerfmt\"],\"quickcheck\":[\"dep:quickcheck\",\"alloc\"],\"rand\":[\"rand08\",\"rand09\"],\"rand08\":[\"dep:rand08\"],\"rand09\":[\"dep:rand09\"],\"serde\":[\"dep:serde_core\"]}}",
"deranged_0.5.8": "{\"dependencies\":[{\"name\":\"deranged-macros\",\"optional\":true,\"req\":\"=0.3.0\"},{\"default_features\":false,\"name\":\"num-traits\",\"optional\":true,\"req\":\"^0.2.15\"},{\"default_features\":false,\"name\":\"powerfmt\",\"optional\":true,\"req\":\"^0.2.0\"},{\"default_features\":false,\"name\":\"quickcheck\",\"optional\":true,\"req\":\"^1.0.3\"},{\"default_features\":false,\"name\":\"rand010\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.10.0\"},{\"kind\":\"dev\",\"name\":\"rand010\",\"package\":\"rand\",\"req\":\"^0.10.0\"},{\"default_features\":false,\"name\":\"rand08\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"kind\":\"dev\",\"name\":\"rand08\",\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"default_features\":false,\"name\":\"rand09\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.9.0\"},{\"kind\":\"dev\",\"name\":\"rand09\",\"package\":\"rand\",\"req\":\"^0.9.0\"},{\"default_features\":false,\"name\":\"serde_core\",\"optional\":true,\"req\":\"^1.0.220\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.86\"}],\"features\":{\"alloc\":[],\"default\":[],\"macros\":[\"dep:deranged-macros\"],\"num\":[\"dep:num-traits\"],\"powerfmt\":[\"dep:powerfmt\"],\"quickcheck\":[\"dep:quickcheck\",\"alloc\"],\"rand\":[\"rand08\",\"rand09\",\"rand010\"],\"rand010\":[\"dep:rand010\"],\"rand08\":[\"dep:rand08\"],\"rand09\":[\"dep:rand09\"],\"serde\":[\"dep:serde_core\"]}}",
"deranged_0.5.9": "{\"dependencies\":[{\"name\":\"deranged-macros\",\"optional\":true,\"req\":\"=0.3.1\"},{\"default_features\":false,\"name\":\"num-traits\",\"optional\":true,\"req\":\"^0.2.15\"},{\"default_features\":false,\"name\":\"powerfmt\",\"optional\":true,\"req\":\"^0.2.0\"},{\"default_features\":false,\"name\":\"quickcheck\",\"optional\":true,\"req\":\"^1.0.3\"},{\"default_features\":false,\"name\":\"rand010\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.10.0\"},{\"kind\":\"dev\",\"name\":\"rand010\",\"package\":\"rand\",\"req\":\"^0.10.0\"},{\"default_features\":false,\"name\":\"rand08\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"kind\":\"dev\",\"name\":\"rand08\",\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"default_features\":false,\"name\":\"rand09\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.9.0\"},{\"kind\":\"dev\",\"name\":\"rand09\",\"package\":\"rand\",\"req\":\"^0.9.0\"},{\"default_features\":false,\"name\":\"serde_core\",\"optional\":true,\"req\":\"^1.0.220\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.86\"},{\"kind\":\"dev\",\"name\":\"serde_test2\",\"req\":\"^2.0.0\"}],\"features\":{\"alloc\":[],\"default\":[],\"macros\":[\"dep:deranged-macros\"],\"num\":[\"dep:num-traits\"],\"powerfmt\":[\"dep:powerfmt\"],\"quickcheck\":[\"dep:quickcheck\",\"alloc\"],\"rand\":[\"rand08\",\"rand09\",\"rand010\"],\"rand010\":[\"dep:rand010\"],\"rand08\":[\"dep:rand08\"],\"rand09\":[\"dep:rand09\"],\"serde\":[\"dep:serde_core\"]}}",
"derivative_2.2.0": "{\"dependencies\":[{\"name\":\"proc-macro2\",\"req\":\"^1.0\"},{\"name\":\"quote\",\"req\":\"^1.0\"},{\"features\":[\"visit\",\"extra-traits\"],\"name\":\"syn\",\"req\":\"^1.0.3\"},{\"kind\":\"dev\",\"name\":\"trybuild\",\"req\":\"^1.0.18, < 1.0.23\"}],\"features\":{\"use_core\":[]}}",
"derive_more-impl_1.0.0": "{\"dependencies\":[{\"name\":\"convert_case\",\"optional\":true,\"req\":\"^0.6\"},{\"kind\":\"dev\",\"name\":\"itertools\",\"req\":\"^0.13.0\"},{\"name\":\"proc-macro2\",\"req\":\"^1.0\"},{\"name\":\"quote\",\"req\":\"^1.0\"},{\"kind\":\"build\",\"name\":\"rustc_version\",\"optional\":true,\"req\":\"^0.4\"},{\"name\":\"syn\",\"req\":\"^2.0.45\"},{\"name\":\"unicode-xid\",\"optional\":true,\"req\":\"^0.2.2\"}],\"features\":{\"add\":[],\"add_assign\":[],\"as_ref\":[\"syn/extra-traits\",\"syn/visit\"],\"constructor\":[],\"debug\":[\"syn/extra-traits\",\"dep:unicode-xid\"],\"default\":[],\"deref\":[],\"deref_mut\":[],\"display\":[\"syn/extra-traits\",\"dep:unicode-xid\"],\"error\":[\"syn/extra-traits\"],\"from\":[\"syn/extra-traits\"],\"from_str\":[],\"full\":[\"add\",\"add_assign\",\"as_ref\",\"constructor\",\"debug\",\"deref\",\"deref_mut\",\"display\",\"error\",\"from\",\"from_str\",\"index\",\"index_mut\",\"into\",\"into_iterator\",\"is_variant\",\"mul\",\"mul_assign\",\"not\",\"sum\",\"try_from\",\"try_into\",\"try_unwrap\",\"unwrap\"],\"index\":[],\"index_mut\":[],\"into\":[\"syn/extra-traits\"],\"into_iterator\":[],\"is_variant\":[\"dep:convert_case\"],\"mul\":[\"syn/extra-traits\"],\"mul_assign\":[\"syn/extra-traits\"],\"not\":[\"syn/extra-traits\"],\"sum\":[],\"testing-helpers\":[\"dep:rustc_version\"],\"try_from\":[],\"try_into\":[\"syn/extra-traits\"],\"try_unwrap\":[\"dep:convert_case\"],\"unwrap\":[\"dep:convert_case\"]}}",
"derive_more-impl_2.1.1": "{\"dependencies\":[{\"name\":\"convert_case\",\"optional\":true,\"req\":\"^0.10\"},{\"kind\":\"dev\",\"name\":\"itertools\",\"req\":\"^0.14.0\"},{\"name\":\"proc-macro2\",\"req\":\"^1.0\"},{\"name\":\"quote\",\"req\":\"^1.0\"},{\"kind\":\"build\",\"name\":\"rustc_version\",\"req\":\"^0.4\"},{\"name\":\"syn\",\"req\":\"^2.0.45\"},{\"name\":\"unicode-xid\",\"optional\":true,\"req\":\"^0.2.2\"}],\"features\":{\"add\":[\"syn/extra-traits\",\"syn/visit\"],\"add_assign\":[\"syn/extra-traits\",\"syn/visit\"],\"as_ref\":[\"syn/extra-traits\",\"syn/visit\"],\"constructor\":[],\"debug\":[\"syn/extra-traits\",\"dep:unicode-xid\"],\"default\":[],\"deref\":[],\"deref_mut\":[],\"display\":[\"syn/extra-traits\",\"dep:unicode-xid\",\"dep:convert_case\"],\"eq\":[\"syn/extra-traits\",\"syn/visit\"],\"error\":[\"syn/extra-traits\"],\"from\":[\"syn/extra-traits\"],\"from_str\":[\"syn/full\",\"syn/visit\",\"dep:convert_case\"],\"full\":[\"add\",\"add_assign\",\"as_ref\",\"constructor\",\"debug\",\"deref\",\"deref_mut\",\"display\",\"eq\",\"error\",\"from\",\"from_str\",\"index\",\"index_mut\",\"into\",\"into_iterator\",\"is_variant\",\"mul\",\"mul_assign\",\"not\",\"sum\",\"try_from\",\"try_into\",\"try_unwrap\",\"unwrap\"],\"index\":[],\"index_mut\":[],\"into\":[\"syn/extra-traits\",\"syn/visit-mut\"],\"into_iterator\":[],\"is_variant\":[\"dep:convert_case\"],\"mul\":[\"syn/extra-traits\",\"syn/visit\"],\"mul_assign\":[\"syn/extra-traits\",\"syn/visit\"],\"not\":[\"syn/extra-traits\"],\"sum\":[],\"testing-helpers\":[\"syn/full\"],\"try_from\":[],\"try_into\":[\"syn/extra-traits\",\"syn/full\",\"syn/visit-mut\"],\"try_unwrap\":[\"dep:convert_case\"],\"unwrap\":[\"dep:convert_case\"]}}",
@@ -1392,10 +1382,23 @@
"git+https://github.com/modelcontextprotocol/rust-sdk?rev=98a54789b80110ad210495c4ad845c89e1980471#98a54789b80110ad210495c4ad845c89e1980471_rmcp-macros": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"darling\",\"optional\":false,\"req\":\"0.24\"},{\"name\":\"proc-macro2\",\"req\":\"1\"},{\"name\":\"quote\",\"req\":\"1\"},{\"name\":\"serde_json\",\"req\":\"1.0\"},{\"default_features\":true,\"features\":[\"full\"],\"name\":\"syn\",\"optional\":false,\"req\":\"3\"}],\"features\":{\"local\":[]},\"strip_prefix\":\"./crates/rmcp-macros\"}",
"git+https://github.com/openai-oss-forks/crossterm?rev=ed1cdab335221515706178d68495bba2aed1924f#ed1cdab335221515706178d68495bba2aed1924f_crossterm": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"base64\",\"optional\":true,\"req\":\"0.23\"},{\"default_features\":true,\"features\":[],\"name\":\"bitflags\",\"optional\":false,\"req\":\"2.9\"},{\"default_features\":true,\"features\":[\"is_variant\"],\"name\":\"derive_more\",\"optional\":true,\"req\":\"2.0.0\"},{\"default_features\":true,\"features\":[],\"name\":\"document-features\",\"optional\":true,\"req\":\"0.2.11\"},{\"default_features\":false,\"features\":[],\"name\":\"futures-core\",\"optional\":true,\"req\":\"0.3.31\"},{\"name\":\"parking_lot\",\"req\":\"0.12.1\"},{\"default_features\":true,\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"1.0.103\"},{\"default_features\":true,\"features\":[],\"name\":\"filedescriptor\",\"optional\":true,\"req\":\"0.8\",\"target\":\"cfg(unix)\"},{\"default_features\":false,\"features\":[],\"name\":\"libc\",\"optional\":true,\"req\":\"0.2.168\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[\"os-poll\"],\"name\":\"mio\",\"optional\":true,\"req\":\"1.0.1\",\"target\":\"cfg(unix)\"},{\"default_features\":false,\"features\":[\"std\",\"stdio\",\"termios\"],\"name\":\"rustix\",\"optional\":false,\"req\":\"1\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[],\"name\":\"signal-hook\",\"optional\":true,\"req\":\"0.3.17\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[\"support-v1_0\"],\"name\":\"signal-hook-mio\",\"optional\":true,\"req\":\"0.2.4\",\"target\":\"cfg(unix)\"},{\"default_features\":true,\"features\":[],\"name\":\"crossterm_winapi\",\"optional\":true,\"req\":\"0.9.1\",\"target\":\"cfg(windows)\"},{\"default_features\":true,\"features\":[\"winuser\",\"winerror\"],\"name\":\"winapi\",\"optional\":true,\"req\":\"0.3.9\",\"target\":\"cfg(windows)\"}],\"features\":{\"bracketed-paste\":[],\"default\":[\"bracketed-paste\",\"derive-more\",\"events\",\"windows\"],\"derive-more\":[\"dep:derive_more\"],\"document-features\":[\"dep:document-features\"],\"event-stream\":[\"dep:futures-core\",\"events\"],\"events\":[\"dep:mio\",\"dep:signal-hook\",\"dep:signal-hook-mio\"],\"osc52\":[\"dep:base64\"],\"serde\":[\"dep:serde\",\"bitflags/serde\"],\"use-dev-tty\":[\"filedescriptor\",\"rustix/process\"],\"windows\":[\"dep:winapi\",\"dep:crossterm_winapi\"]},\"strip_prefix\":\"\"}",
"git+https://github.com/openai-oss-forks/rusty_v8.git?rev=90a65f887a0c0f048f3784afbcb320b373c8a2e0#90a65f887a0c0f048f3784afbcb320b373c8a2e0_v8": "{\"dependencies\":[{\"name\":\"bitflags\",\"req\":\"2.5\"},{\"name\":\"paste\",\"req\":\"1.0\"},{\"default_features\":true,\"features\":[\"zoneinfo64\"],\"name\":\"temporal_capi\",\"optional\":false,\"req\":\"0.2.3\"},{\"kind\":\"build\",\"name\":\"bindgen\",\"req\":\"0.72\"},{\"kind\":\"build\",\"name\":\"fslock\",\"req\":\"0.2\"},{\"kind\":\"build\",\"name\":\"gzip-header\",\"req\":\"1.0.0\"},{\"kind\":\"build\",\"name\":\"home\",\"req\":\"0\"},{\"kind\":\"build\",\"name\":\"miniz_oxide\",\"req\":\"0.8.8\"},{\"kind\":\"build\",\"name\":\"which\",\"req\":\"6\"}],\"features\":{\"default\":[\"use_custom_libcxx\"],\"simdutf\":[],\"use_custom_libcxx\":[],\"v8_enable_pointer_compression\":[],\"v8_enable_sandbox\":[\"v8_enable_pointer_compression\"],\"v8_enable_v8_checks\":[]},\"strip_prefix\":\"\"}",
"git+https://github.com/openai-oss-forks/tokio-tungstenite?rev=0e5b2d73aa18dd9f0a50ee9ff199d5aef7594186#0e5b2d73aa18dd9f0a50ee9ff199d5aef7594186_tokio-tungstenite": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"sink\",\"std\"],\"name\":\"futures-util\",\"optional\":false,\"req\":\"0.3.28\"},{\"name\":\"log\",\"req\":\"0.4.17\"},{\"default_features\":true,\"features\":[],\"name\":\"native-tls-crate\",\"optional\":true,\"package\":\"native-tls\",\"req\":\"0.2.11\"},{\"default_features\":false,\"features\":[],\"name\":\"rustls\",\"optional\":true,\"req\":\"0.23.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-native-certs\",\"optional\":true,\"req\":\"0.8.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-pki-types\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":false,\"features\":[\"io-util\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1.0.0\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-native-tls\",\"optional\":true,\"req\":\"0.3.1\"},{\"default_features\":false,\"features\":[],\"name\":\"tokio-rustls\",\"optional\":true,\"req\":\"0.26.0\"},{\"default_features\":false,\"features\":[],\"name\":\"tungstenite\",\"optional\":false},{\"default_features\":true,\"features\":[],\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"0.26.0\"}],\"features\":{\"__rustls-tls\":[\"rustls\",\"rustls-pki-types\",\"tokio-rustls\",\"stream\",\"tungstenite/__rustls-tls\",\"handshake\"],\"connect\":[\"stream\",\"tokio/net\",\"tokio/time\",\"handshake\"],\"default\":[\"connect\",\"handshake\"],\"handshake\":[\"tungstenite/handshake\"],\"native-tls\":[\"native-tls-crate\",\"tokio-native-tls\",\"stream\",\"tungstenite/native-tls\",\"handshake\"],\"native-tls-vendored\":[\"native-tls\",\"native-tls-crate/vendored\",\"tungstenite/native-tls-vendored\"],\"proxy\":[\"tungstenite/proxy\",\"tokio/net\",\"handshake\"],\"rustls-tls-native-roots\":[\"__rustls-tls\",\"rustls-native-certs\"],\"rustls-tls-webpki-roots\":[\"__rustls-tls\",\"webpki-roots\"],\"stream\":[],\"url\":[\"tungstenite/url\"]},\"strip_prefix\":\"\"}",
"git+https://github.com/openai-oss-forks/tungstenite-rs?rev=4fffad30fe373adbdcffab9545e9e9bf4f2fc19f#4fffad30fe373adbdcffab9545e9e9bf4f2fc19f_tungstenite": "{\"dependencies\":[{\"name\":\"bytes\",\"req\":\"1.9.0\"},{\"default_features\":true,\"features\":[],\"name\":\"data-encoding\",\"optional\":true,\"req\":\"2\"},{\"default_features\":false,\"features\":[\"zlib-rs\"],\"name\":\"flate2\",\"optional\":true,\"req\":\"1.1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"headers\",\"optional\":true,\"req\":\"0.4.0\"},{\"default_features\":true,\"features\":[],\"name\":\"http\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"httparse\",\"optional\":true,\"req\":\"1.3.4\"},{\"name\":\"log\",\"req\":\"0.4.8\"},{\"default_features\":true,\"features\":[],\"name\":\"native-tls-crate\",\"optional\":true,\"package\":\"native-tls\",\"req\":\"0.2.3\"},{\"name\":\"rand\",\"req\":\"0.9.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"rustls\",\"optional\":true,\"req\":\"0.23.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-native-certs\",\"optional\":true,\"req\":\"0.8.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-pki-types\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"sha1\",\"optional\":true,\"req\":\"0.10\"},{\"name\":\"thiserror\",\"req\":\"2.0.7\"},{\"default_features\":true,\"features\":[],\"name\":\"url\",\"optional\":true,\"req\":\"2.1.0\"},{\"name\":\"utf-8\",\"req\":\"0.7.5\"},{\"default_features\":true,\"features\":[],\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"0.26\"}],\"features\":{\"__rustls-tls\":[\"rustls\",\"rustls-pki-types\"],\"default\":[\"handshake\"],\"deflate\":[\"headers\",\"flate2\"],\"handshake\":[\"data-encoding\",\"headers\",\"httparse\",\"sha1\"],\"headers\":[\"http\",\"dep:headers\"],\"native-tls\":[\"native-tls-crate\"],\"native-tls-vendored\":[\"native-tls\",\"native-tls-crate/vendored\"],\"proxy\":[\"handshake\"],\"rustls-tls-native-roots\":[\"__rustls-tls\",\"rustls-native-certs\"],\"rustls-tls-webpki-roots\":[\"__rustls-tls\",\"webpki-roots\"],\"url\":[\"dep:url\"]},\"strip_prefix\":\"\"}",
"git+https://github.com/openai-oss-forks/tokio-tungstenite?rev=7447c427513cfe685f236e1ac0513c4ea3dd9c0b#7447c427513cfe685f236e1ac0513c4ea3dd9c0b_tokio-tungstenite": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"sink\",\"std\"],\"name\":\"futures-util\",\"optional\":false,\"req\":\"0.3.28\"},{\"name\":\"log\",\"req\":\"0.4.17\"},{\"default_features\":true,\"features\":[],\"name\":\"native-tls-crate\",\"optional\":true,\"package\":\"native-tls\",\"req\":\"0.2.11\"},{\"default_features\":false,\"features\":[],\"name\":\"rustls\",\"optional\":true,\"req\":\"0.23.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-native-certs\",\"optional\":true,\"req\":\"0.8.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-pki-types\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":false,\"features\":[\"io-util\"],\"name\":\"tokio\",\"optional\":false,\"req\":\"1.0.0\"},{\"default_features\":true,\"features\":[],\"name\":\"tokio-native-tls\",\"optional\":true,\"req\":\"0.3.1\"},{\"default_features\":false,\"features\":[],\"name\":\"tokio-rustls\",\"optional\":true,\"req\":\"0.26.0\"},{\"default_features\":false,\"features\":[],\"name\":\"tungstenite\",\"optional\":false},{\"default_features\":true,\"features\":[],\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"0.26.0\"}],\"features\":{\"__rustls-tls\":[\"rustls\",\"rustls-pki-types\",\"tokio-rustls\",\"stream\",\"tungstenite/__rustls-tls\",\"handshake\"],\"connect\":[\"stream\",\"tokio/net\",\"tokio/time\",\"handshake\"],\"default\":[\"connect\",\"handshake\"],\"handshake\":[\"tungstenite/handshake\"],\"native-tls\":[\"native-tls-crate\",\"tokio-native-tls\",\"stream\",\"tungstenite/native-tls\",\"handshake\"],\"native-tls-vendored\":[\"native-tls\",\"native-tls-crate/vendored\",\"tungstenite/native-tls-vendored\"],\"proxy\":[\"tungstenite/proxy\",\"tokio/net\",\"handshake\"],\"rustls-tls-native-roots\":[\"__rustls-tls\",\"rustls-native-certs\"],\"rustls-tls-webpki-roots\":[\"__rustls-tls\",\"webpki-roots\"],\"stream\":[],\"url\":[\"tungstenite/url\"]},\"strip_prefix\":\"\"}",
"git+https://github.com/openai-oss-forks/tungstenite-rs?rev=bc589d684755a8c02da0fc7e58d0861cbfc306f1#bc589d684755a8c02da0fc7e58d0861cbfc306f1_tungstenite": "{\"dependencies\":[{\"name\":\"bytes\",\"req\":\"1.9.0\"},{\"default_features\":true,\"features\":[],\"name\":\"data-encoding\",\"optional\":true,\"req\":\"2\"},{\"default_features\":false,\"features\":[\"zlib-rs\"],\"name\":\"flate2\",\"optional\":true,\"req\":\"1.1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"headers\",\"optional\":true,\"req\":\"0.4.0\"},{\"default_features\":true,\"features\":[],\"name\":\"http\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"httparse\",\"optional\":true,\"req\":\"1.3.4\"},{\"name\":\"log\",\"req\":\"0.4.8\"},{\"default_features\":true,\"features\":[],\"name\":\"native-tls-crate\",\"optional\":true,\"package\":\"native-tls\",\"req\":\"0.2.3\"},{\"name\":\"rand\",\"req\":\"0.9.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"rustls\",\"optional\":true,\"req\":\"0.23.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-native-certs\",\"optional\":true,\"req\":\"0.8.0\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-pki-types\",\"optional\":true,\"req\":\"1.0\"},{\"default_features\":true,\"features\":[],\"name\":\"sha1\",\"optional\":true,\"req\":\"0.10\"},{\"name\":\"thiserror\",\"req\":\"2.0.7\"},{\"default_features\":true,\"features\":[],\"name\":\"url\",\"optional\":true,\"req\":\"2.1.0\"},{\"name\":\"utf-8\",\"req\":\"0.7.5\"},{\"default_features\":true,\"features\":[],\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"0.26\"}],\"features\":{\"__rustls-tls\":[\"rustls\",\"rustls-pki-types\"],\"default\":[\"handshake\"],\"deflate\":[\"headers\",\"flate2\"],\"handshake\":[\"data-encoding\",\"headers\",\"httparse\",\"sha1\"],\"headers\":[\"http\",\"dep:headers\"],\"native-tls\":[\"native-tls-crate\"],\"native-tls-vendored\":[\"native-tls\",\"native-tls-crate/vendored\"],\"proxy\":[\"handshake\"],\"rustls-tls-native-roots\":[\"__rustls-tls\",\"rustls-native-certs\"],\"rustls-tls-webpki-roots\":[\"__rustls-tls\",\"webpki-roots\"],\"url\":[\"dep:url\"]},\"strip_prefix\":\"\"}",
"git+https://github.com/rust-lang/rust-clippy?rev=21baba9c10c5d179915cae82e6247bc2337872fb#21baba9c10c5d179915cae82e6247bc2337872fb_clippy_utils": "{\"dependencies\":[{\"default_features\":false,\"features\":[],\"name\":\"arrayvec\",\"optional\":false,\"req\":\"0.7\"},{\"name\":\"itertools\",\"req\":\"0.15\"},{\"name\":\"rustc_apfloat\",\"req\":\"0.2.0\"}],\"features\":{},\"strip_prefix\":\"clippy_utils\"}",
"git+https://github.com/transact-rs/sqlx?rev=10462fa4414c6c7f1ed1d39bb31678e3b726878c#10462fa4414c6c7f1ed1d39bb31678e3b726878c_sqlx-core": "{\"dependencies\":[{\"default_features\":true,\"features\":[],\"name\":\"async-fs\",\"optional\":true,\"req\":\"2.1\"},{\"default_features\":false,\"features\":[\"async-io\"],\"name\":\"async-global-executor\",\"optional\":true,\"req\":\"3.1\"},{\"default_features\":true,\"features\":[],\"name\":\"async-io\",\"optional\":true,\"req\":\"2.4.1\"},{\"default_features\":true,\"features\":[],\"name\":\"async-std\",\"optional\":true,\"req\":\"1.13\"},{\"default_features\":true,\"features\":[],\"name\":\"async-task\",\"optional\":true,\"req\":\"4.7.1\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"base64\",\"optional\":false,\"req\":\"0.22.1\"},{\"name\":\"bigdecimal\",\"optional\":true,\"req\":\"0.4.0\"},{\"name\":\"bit-vec\",\"optional\":true,\"req\":\"0.8\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"bstr\",\"optional\":true,\"req\":\"1.0.1\"},{\"name\":\"bytes\",\"req\":\"1.2.0\"},{\"name\":\"cfg-if\",\"req\":\"1.0.0\"},{\"default_features\":false,\"features\":[\"std\",\"clock\"],\"name\":\"chrono\",\"optional\":true,\"req\":\"0.4.34\"},{\"default_features\":true,\"features\":[],\"name\":\"crc\",\"optional\":true,\"req\":\"3\"},{\"name\":\"crossbeam-queue\",\"req\":\"0.3.2\"},{\"name\":\"either\",\"req\":\"1.6.1\"},{\"name\":\"event-listener\",\"req\":\"5.2.0\"},{\"default_features\":false,\"features\":[],\"name\":\"futures-core\",\"optional\":false,\"req\":\"0.3.32\"},{\"name\":\"futures-intrusive\",\"req\":\"0.5.0\"},{\"name\":\"futures-io\",\"req\":\"0.3.32\"},{\"default_features\":false,\"features\":[\"alloc\",\"sink\",\"io\"],\"name\":\"futures-util\",\"optional\":false,\"req\":\"0.3.32\"},{\"name\":\"hashbrown\",\"req\":\"0.16.0\"},{\"name\":\"hashlink\",\"req\":\"0.11.0\"},{\"name\":\"indexmap\",\"req\":\"2.0\"},{\"name\":\"ipnet\",\"optional\":true,\"req\":\"2.3.0\"},{\"name\":\"ipnetwork\",\"optional\":true,\"req\":\"0.21.1\"},{\"default_features\":false,\"features\":[],\"name\":\"log\",\"optional\":false,\"req\":\"0.4.18\"},{\"name\":\"mac_address\",\"optional\":true,\"req\":\"1.1.5\"},{\"default_features\":false,\"features\":[],\"name\":\"memchr\",\"optional\":false,\"req\":\"2.5.0\"},{\"default_features\":true,\"features\":[],\"name\":\"native-tls\",\"optional\":true,\"req\":\"0.2.10\"},{\"name\":\"percent-encoding\",\"req\":\"2.3.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"rust_decimal\",\"optional\":true,\"req\":\"1.36.0\"},{\"default_features\":false,\"features\":[\"std\",\"tls12\"],\"name\":\"rustls\",\"optional\":true,\"req\":\"0.23.24\"},{\"default_features\":true,\"features\":[],\"name\":\"rustls-native-certs\",\"optional\":true,\"req\":\"0.8.0\"},{\"default_features\":true,\"features\":[\"derive\",\"rc\"],\"name\":\"serde\",\"optional\":true,\"req\":\"1.0.219\"},{\"default_features\":true,\"features\":[\"raw_value\"],\"name\":\"serde_json\",\"optional\":true,\"req\":\"1.0.142\"},{\"default_features\":false,\"features\":[],\"name\":\"sha2\",\"optional\":true,\"req\":\"0.11.0\"},{\"name\":\"smallvec\",\"req\":\"1.13.1\"},{\"default_features\":false,\"features\":[],\"name\":\"smol\",\"optional\":true,\"req\":\"2.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"thiserror\",\"optional\":false,\"req\":\"2.0.18\"},{\"default_features\":true,\"features\":[\"formatting\",\"parsing\",\"macros\"],\"name\":\"time\",\"optional\":true,\"req\":\"0.3.48\"},{\"default_features\":false,\"features\":[\"time\",\"net\",\"sync\",\"fs\",\"io-util\",\"rt\"],\"name\":\"tokio\",\"optional\":true,\"req\":\"1.25.0\"},{\"default_features\":true,\"features\":[\"fs\"],\"name\":\"tokio-stream\",\"optional\":true,\"req\":\"0.1.8\"},{\"default_features\":true,\"features\":[],\"name\":\"toml\",\"optional\":true,\"req\":\"0.8.16\"},{\"default_features\":true,\"features\":[\"log\"],\"name\":\"tracing\",\"optional\":false,\"req\":\"0.1.37\"},{\"default_features\":true,\"features\":[],\"name\":\"url\",\"optional\":false,\"req\":\"2.2.2\"},{\"name\":\"uuid\",\"optional\":true,\"req\":\"1.12.1\"},{\"default_features\":true,\"features\":[],\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"1\"}],\"features\":{\"_rt-async-global-executor\":[\"async-global-executor\",\"_rt-async-io\",\"_rt-async-task\"],\"_rt-async-io\":[\"async-io\",\"async-fs\"],\"_rt-async-std\":[\"async-std\",\"_rt-async-io\"],\"_rt-async-task\":[\"async-task\"],\"_rt-smol\":[\"smol\",\"_rt-async-io\",\"_rt-async-task\"],\"_rt-tokio\":[\"tokio\",\"tokio-stream\"],\"_tls-native-tls\":[\"native-tls\"],\"_tls-none\":[],\"_tls-rustls\":[\"rustls\"],\"_tls-rustls-aws-lc-rs\":[\"_tls-rustls\",\"rustls/aws-lc-rs\",\"webpki-roots\"],\"_tls-rustls-ring-native-roots\":[\"_tls-rustls\",\"rustls/ring\",\"rustls-native-certs\"],\"_tls-rustls-ring-webpki\":[\"_tls-rustls\",\"rustls/ring\",\"webpki-roots\"],\"_unstable-doc\":[\"sqlx-toml\"],\"any\":[],\Line truncated
"git+https://github.com/transact-rs/sqlx?rev=10462fa4414c6c7f1ed1d39bb31678e3b726878c#10462fa4414c6c7f1ed1d39bb31678e3b726878c_sqlx-sqlite": "{\"dependencies\":[{\"name\":\"atoi\",\"req\":\"2.0\"},{\"default_features\":false,\"features\":[\"std\",\"clock\"],\"name\":\"chrono\",\"optional\":true,\"req\":\"0.4.34\"},{\"default_features\":false,\"features\":[\"async\"],\"name\":\"flume\",\"optional\":false,\"req\":\"0.12.0\"},{\"name\":\"form_urlencoded\",\"req\":\"1.2.2\"},{\"default_features\":false,\"features\":[\"sink\",\"alloc\",\"std\"],\"name\":\"futures-channel\",\"optional\":false,\"req\":\"0.3.32\"},{\"default_features\":false,\"features\":[],\"name\":\"futures-core\",\"optional\":false,\"req\":\"0.3.32\"},{\"default_features\":true,\"features\":[],\"name\":\"futures-executor\",\"optional\":false,\"req\":\"0.3.32\"},{\"name\":\"futures-intrusive\",\"req\":\"0.5.0\"},{\"default_features\":false,\"features\":[\"alloc\",\"sink\"],\"name\":\"futures-util\",\"optional\":false,\"req\":\"0.3.32\"},{\"default_features\":false,\"features\":[\"pkg-config\",\"vcpkg\"],\"name\":\"libsqlite3-sys\",\"optional\":false,\"req\":\">=0.30.1, <0.40.0\"},{\"name\":\"log\",\"req\":\"0.4.18\"},{\"name\":\"percent-encoding\",\"req\":\"2.3.0\"},{\"default_features\":true,\"features\":[],\"name\":\"regex\",\"optional\":true,\"req\":\"1.6.0\"},{\"default_features\":true,\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"1.0.219\"},{\"default_features\":true,\"features\":[],\"name\":\"sqlx-core\",\"optional\":false,\"req\":\"=0.9.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"thiserror\",\"optional\":false,\"req\":\"2.0.18\"},{\"default_features\":true,\"features\":[\"formatting\",\"parsing\",\"macros\"],\"name\":\"time\",\"optional\":true,\"req\":\"0.3.48\"},{\"default_features\":true,\"features\":[\"log\"],\"name\":\"tracing\",\"optional\":false,\"req\":\"0.1.37\"},{\"default_features\":true,\"features\":[],\"name\":\"url\",\"optional\":false,\"req\":\"2.2.2\"},{\"name\":\"uuid\",\"optional\":true,\"req\":\"1.12.1\"}],\"features\":{\"_unstable-all-sqlite-features\":[\"deserialize\",\"load-extension\",\"preupdate-hook\",\"unlock-notify\"],\"_unstable-all-types\":[\"json\",\"chrono\",\"time\",\"uuid\"],\"_unstable-docs\":[\"bundled\",\"any\",\"_unstable-all-types\",\"_unstable-all-sqlite-features\"],\"any\":[\"sqlx-core/any\"],\"bigdecimal\":[],\"bundled\":[\"libsqlite3-sys/bundled\"],\"chrono\":[\"dep:chrono\",\"sqlx-core/chrono\"],\"deserialize\":[],\"json\":[\"sqlx-core/json\",\"serde\"],\"load-extension\":[],\"migrate\":[\"sqlx-core/migrate\"],\"offline\":[\"sqlx-core/offline\",\"serde\"],\"preupdate-hook\":[\"libsqlite3-sys/preupdate_hook\"],\"regexp\":[\"dep:regex\"],\"rust_decimal\":[],\"sqlx-toml\":[\"sqlx-core/sqlx-toml\"],\"time\":[\"dep:time\",\"sqlx-core/time\"],\"unbundled\":[\"libsqlite3-sys/buildtime_bindgen\"],\"unlock-notify\":[\"libsqlite3-sys/unlock_notify\"],\"uuid\":[\"dep:uuid\",\"sqlx-core/uuid\"]},\"strip_prefix\":\"sqlx-sqlite\"}",
"git2_0.21.0": "{\"dependencies\":[{\"name\":\"bitflags\",\"req\":\"^2.1.0\"},{\"features\":[\"derive\"],\"kind\":\"dev\",\"name\":\"clap\",\"req\":\"^4.4.13\"},{\"name\":\"libc\",\"req\":\"^0.2\"},{\"name\":\"libgit2-sys\",\"req\":\"^0.18.4\"},{\"name\":\"log\",\"req\":\"^0.4.8\"},{\"name\":\"openssl-probe\",\"optional\":true,\"req\":\"^0.1\",\"target\":\"cfg(all(unix, not(target_os = \\\"macos\\\")))\"},{\"name\":\"openssl-sys\",\"optional\":true,\"req\":\"^0.9.45\",\"target\":\"cfg(all(unix, not(target_os = \\\"macos\\\")))\"},{\"kind\":\"dev\",\"name\":\"tempfile\",\"req\":\"^3.1.0\"},{\"features\":[\"formatting\"],\"kind\":\"dev\",\"name\":\"time\",\"req\":\"^0.3.47\"},{\"name\":\"url\",\"optional\":true,\"req\":\"^2.5.4\"},{\"kind\":\"dev\",\"name\":\"url\",\"req\":\"^2.5.4\"}],\"features\":{\"cred\":[\"dep:url\"],\"default\":[],\"https\":[\"libgit2-sys/https\",\"openssl-sys\",\"openssl-probe\",\"cred\"],\"ssh\":[\"libgit2-sys/ssh\",\"cred\"],\"unstable\":[],\"unstable-sha256\":[\"libgit2-sys/unstable-sha256\"],\"vendored-libgit2\":[\"libgit2-sys/vendored\"],\"vendored-openssl\":[\"openssl-sys/vendored\",\"libgit2-sys/vendored-openssl\"],\"zlib-ng-compat\":[\"libgit2-sys/zlib-ng-compat\"]}}",
"git_archive_integrity:https://codeload.github.com/dzbarsky/rules_rust/tar.gz/b56cbaa8465e74127f1ea216f813cd377295ad81": "sha256-3b30DbjfaF32fDJg3+Wc9/+ksZOpMk4Qs1m76JgdueA=",
"git_archive_integrity:https://codeload.github.com/helix-editor/nucleo/tar.gz/4253de9faabb4e5c6d81d946a5e35a90f87347ee": "sha256-0WdqwzqCxZA//t5oznPJ2SRmaqihArtkmo+5JqemHOE=",
"git_archive_integrity:https://codeload.github.com/hyperium/h3/tar.gz/e07e69412876f7e26f026bd75a48b2704d8c8283": "sha256-O52KnRCEH+J/uGyXoGvs4UEfywrPrcDKhXtjZdTl0po=",
"git_archive_integrity:https://codeload.github.com/microsoft/mxc/tar.gz/b21120168d70befe12356411423266bfef168446": "sha256-y1jhNgvGsVfkERZ48U4StdlXS9UIoCzKUUphwvu6+m8=",
"git_archive_integrity:https://codeload.github.com/modelcontextprotocol/rust-sdk/tar.gz/98a54789b80110ad210495c4ad845c89e1980471": "sha256-u1NcSLjm/O48vcV54D6qYiUrp0n/IW7+GZ2DcSLJ/lI=",
"git_archive_integrity:https://codeload.github.com/openai-oss-forks/crossterm/tar.gz/ed1cdab335221515706178d68495bba2aed1924f": "sha256-NTDNN30IByL2McZWbl7bSESri+j0sYXWvkoru6VZFTE=",
"git_archive_integrity:https://codeload.github.com/openai-oss-forks/rusty_v8/tar.gz/90a65f887a0c0f048f3784afbcb320b373c8a2e0": "sha256-sLGI0fHYUavXgzeBiiihXoTxQ7CCzpZpdukgZhdoQ3M=",
"git_archive_integrity:https://codeload.github.com/openai-oss-forks/tokio-tungstenite/tar.gz/7447c427513cfe685f236e1ac0513c4ea3dd9c0b": "sha256-RqW7OJVRvLIWfDNmNfxOcxrYW1dy5M6LrBwvXdCqfLw=",
"git_archive_integrity:https://codeload.github.com/openai-oss-forks/tungstenite-rs/tar.gz/bc589d684755a8c02da0fc7e58d0861cbfc306f1": "sha256-1wR/jnCUwIJevFAotK6wvvee02nkOj4lCzLhdV29c18=",
"git_archive_integrity:https://codeload.github.com/rust-lang/rust-clippy/tar.gz/21baba9c10c5d179915cae82e6247bc2337872fb": "sha256-hoAjPoWso23OSqakAcd6ghJRUEZp1CiOnHQPZpRNFS4=",
"git_archive_integrity:https://codeload.github.com/transact-rs/sqlx/tar.gz/10462fa4414c6c7f1ed1d39bb31678e3b726878c": "sha256-jFe976E+ztpfve0rVarAyR59YIlWuCD4HS7GstpgFN4=",
"gix-actor_0.44.0": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"std\",\"unicode\"],\"name\":\"bstr\",\"req\":\"^1.12.0\"},{\"name\":\"document-features\",\"optional\":true,\"req\":\"^0.2.0\"},{\"name\":\"gix-date\",\"req\":\"^0.18.0\"},{\"features\":[\"bstr\"],\"name\":\"gix-error\",\"req\":\"^0.5.0\"},{\"kind\":\"dev\",\"name\":\"insta\",\"req\":\"^1.46.3\"},{\"kind\":\"dev\",\"name\":\"pretty_assertions\",\"req\":\"^1.0.0\"},{\"default_features\":false,\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.114\"}],\"features\":{\"serde\":[\"dep:serde\",\"bstr/serde\",\"gix-date/serde\"]}}",
"gix-attributes_0.37.0": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"std\",\"unicode\"],\"name\":\"bstr\",\"req\":\"^1.12.0\"},{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.8.2\"},{\"name\":\"document-features\",\"optional\":true,\"req\":\"^0.2.1\"},{\"features\":[\"bstr\"],\"name\":\"gix-error\",\"req\":\"^0.5.0\"},{\"name\":\"gix-glob\",\"req\":\"^0.29.0\"},{\"name\":\"gix-parallel\",\"req\":\"^0.50.0\"},{\"name\":\"gix-path\",\"req\":\"^0.14.0\"},{\"name\":\"gix-quote\",\"req\":\"^0.10.0\"},{\"name\":\"gix-trace\",\"req\":\"^0.3.0\"},{\"kind\":\"dev\",\"name\":\"insta\",\"req\":\"^1.46.3\"},{\"default_features\":false,\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.114\"},{\"name\":\"smallvec\",\"req\":\"^1.15.1\"},{\"name\":\"unicode-bom\",\"req\":\"^2.0.3\"}],\"features\":{\"serde\":[\"dep:serde\",\"bstr/serde\",\"gix-glob/serde\"]}}",
"gix-chunk_0.10.0": "{\"dependencies\":[{\"features\":[\"bstr\"],\"name\":\"gix-error\",\"req\":\"^0.5.0\"}],\"features\":{}}",
@@ -1475,6 +1478,7 @@
"hermit-abi_0.5.2": "{\"dependencies\":[{\"name\":\"alloc\",\"optional\":true,\"package\":\"rustc-std-workspace-alloc\",\"req\":\"^1.0.0\"},{\"name\":\"core\",\"optional\":true,\"package\":\"rustc-std-workspace-core\",\"req\":\"^1.0.0\"}],\"features\":{\"default\":[],\"rustc-dep-of-std\":[\"core\",\"alloc\"]}}",
"hex_0.4.3": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.3\"},{\"kind\":\"dev\",\"name\":\"faster-hex\",\"req\":\"^0.5\"},{\"kind\":\"dev\",\"name\":\"pretty_assertions\",\"req\":\"^0.6\"},{\"kind\":\"dev\",\"name\":\"rustc-hex\",\"req\":\"^2.1\"},{\"default_features\":false,\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0\"},{\"features\":[\"derive\"],\"kind\":\"dev\",\"name\":\"serde\",\"req\":\"^1.0\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0\"},{\"kind\":\"dev\",\"name\":\"version-sync\",\"req\":\"^0.9\"}],\"features\":{\"alloc\":[],\"default\":[\"std\"],\"std\":[\"alloc\"]}}",
"hickory-proto_0.25.2": "{\"dependencies\":[{\"name\":\"async-trait\",\"req\":\"^0.1.43\"},{\"default_features\":false,\"features\":[\"prebuilt-nasm\"],\"name\":\"aws-lc-rs\",\"optional\":true,\"req\":\"^1.12.3\"},{\"name\":\"backtrace\",\"optional\":true,\"req\":\"^0.3.50\"},{\"name\":\"bitflags\",\"optional\":true,\"req\":\"^2.4.1\"},{\"name\":\"bytes\",\"optional\":true,\"req\":\"^1\"},{\"name\":\"cfg-if\",\"req\":\"^1\"},{\"name\":\"critical-section\",\"optional\":true,\"req\":\"^1.1.1\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"data-encoding\",\"req\":\"^2.2.0\"},{\"name\":\"enum-as-inner\",\"req\":\"^0.6\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"futures-channel\",\"req\":\"^0.3.5\"},{\"default_features\":false,\"features\":[\"std\"],\"kind\":\"dev\",\"name\":\"futures-executor\",\"req\":\"^0.3.5\"},{\"default_features\":false,\"name\":\"futures-io\",\"optional\":true,\"req\":\"^0.3.5\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"futures-util\",\"req\":\"^0.3.5\"},{\"features\":[\"stream\"],\"name\":\"h2\",\"optional\":true,\"req\":\"^0.4.0\"},{\"name\":\"h3\",\"optional\":true,\"req\":\"^0.0.7\"},{\"name\":\"h3-quinn\",\"optional\":true,\"req\":\"^0.0.9\"},{\"name\":\"http\",\"optional\":true,\"req\":\"^1.1\"},{\"default_features\":false,\"features\":[\"alloc\",\"compiled_data\"],\"name\":\"idna\",\"req\":\"^1.0.3\"},{\"default_features\":false,\"name\":\"ipnet\",\"req\":\"^2.3.0\"},{\"name\":\"js-sys\",\"optional\":true,\"req\":\"^0.3.44\"},{\"default_features\":false,\"features\":[\"critical-section\"],\"name\":\"once_cell\",\"req\":\"^1.20.0\"},{\"name\":\"pin-project-lite\",\"optional\":true,\"req\":\"^0.2\"},{\"default_features\":false,\"features\":[\"log\",\"runtime-tokio\"],\"name\":\"quinn\",\"optional\":true,\"req\":\"^0.11.2\"},{\"default_features\":false,\"features\":[\"alloc\",\"std_rng\"],\"name\":\"rand\",\"req\":\"^0.9\"},{\"features\":[\"std\"],\"name\":\"ring\",\"optional\":true,\"req\":\"^0.17\"},{\"default_features\":false,\"features\":[\"logging\",\"std\",\"tls12\"],\"name\":\"rustls\",\"optional\":true,\"req\":\"^0.23.23\"},{\"name\":\"rustls-pki-types\",\"optional\":true,\"req\":\"^1.10\"},{\"name\":\"rustls-platform-verifier\",\"optional\":true,\"req\":\"^0.5\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0\"},{\"name\":\"socket2\",\"optional\":true,\"req\":\"^0.5\"},{\"default_features\":false,\"name\":\"thiserror\",\"req\":\"^2\"},{\"name\":\"time\",\"optional\":true,\"req\":\"^0.3\"},{\"features\":[\"alloc\"],\"name\":\"tinyvec\",\"req\":\"^1.1.1\"},{\"features\":[\"io-util\",\"macros\"],\"name\":\"tokio\",\"optional\":true,\"req\":\"^1.21\"},{\"features\":[\"rt\",\"time\",\"macros\"],\"kind\":\"dev\",\"name\":\"tokio\",\"req\":\"^1.21\"},{\"default_features\":false,\"features\":[\"early-data\"],\"name\":\"tokio-rustls\",\"optional\":true,\"req\":\"^0.26\"},{\"default_features\":false,\"name\":\"tracing\",\"req\":\"^0.1.30\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"tracing-subscriber\",\"req\":\"^0.3\"},{\"default_features\":false,\"name\":\"url\",\"req\":\"^2.5.4\"},{\"name\":\"wasm-bindgen-crate\",\"optional\":true,\"package\":\"wasm-bindgen\",\"req\":\"^0.2.58\"},{\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"^0.26\"}],\"features\":{\"__dnssec\":[\"dep:bitflags\",\"dep:rustls-pki-types\",\"dep:time\",\"std\"],\"__h3\":[\"dep:h3\",\"dep:h3-quinn\",\"dep:http\",\"std\"],\"__https\":[\"dep:bytes\",\"dep:h2\",\"dep:http\",\"std\"],\"__quic\":[\"dep:bytes\",\"dep:pin-project-lite\",\"dep:quinn\",\"std\"],\"__tls\":[\"dep:bytes\",\"dep:rustls\",\"dep:tokio-rustls\",\"std\",\"tokio\"],\"backtrace\":[\"dep:backtrace\",\"std\"],\"default\":[\"std\",\"tokio\"],\"dnssec-aws-lc-rs\":[\"dep:aws-lc-rs\",\"aws-lc-rs/aws-lc-sys\",\"aws-lc-rs/ring-io\",\"__dnssec\"],\"dnssec-ring\":[\"dep:ring\",\"__dnssec\"],\"h3-aws-lc-rs\":[\"quic-aws-lc-rs\",\"__h3\"],\"h3-ring\":[\"quic-ring\",\"__h3\"],\"https-aws-lc-rs\":[\"tls-aws-lc-rs\",\"__https\"],\"https-ring\":[\"tls-ring\",\"__https\"],\"mdns\":[\"socket2/all\",\"std\"],\"no-std-rand\":[\"once_cell/critical-section\",\"dep:critical-section\"],\"quic-aws-lc-rs\":[\"quinn/rustls-aws-lc-rs\",\"tls-aws-lc-rs\",\"__quic\"],\"quic-ring\":[\"quinn/rustls-ring\",\"tls-ring\",\"__quic\"],\"rustls-platform-verifier\":[\"dep:rustls-platform-verifier\",\"std\"],\"serde\":[\"dep:serde\",\"std\",\"url/serde\"],\"std\":[\"data-encoding/std\",\"futures-channel/std\",\"futures-io/std\",\"futures-util/std\",\"ipnet/std\",\"rand/std\",\"rand/thread_rng\",\"ring?/std\",\"thiserror/std\",\"tracing-subscriber/env-filter\",\"tracing-subscriber/fmt\",\"tracing-subscriber/std\",\"tracing/std\",\"url/std\"],\"testing\":[\"std\"],\"text-parsing\":[\"std\"],\"tls-aws-lc-rs\":[\"tokio-rustls/aws-lc-rs\",\"__tls\"],\"tls-ring\":[\"tokio-rustls/ring\",\"__tls\"],\"tokio\":[\"dep:tokio\",\"std\",\"tokio/net\",\"tokio/rt\",\"tokio/time\",\"tokLine truncated
"hickory-proto_0.26.3": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"prebuilt-nasm\"],\"name\":\"aws-lc-rs\",\"optional\":true,\"req\":\"^1.12.3\"},{\"name\":\"bitflags\",\"optional\":true,\"req\":\"^2.4.1\"},{\"name\":\"critical-section\",\"optional\":true,\"req\":\"^1.1.1\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"data-encoding\",\"req\":\"^2.2.0\"},{\"default_features\":false,\"features\":[\"alloc\",\"compiled_data\"],\"name\":\"idna\",\"req\":\"^1.0.3\"},{\"default_features\":false,\"name\":\"ipnet\",\"req\":\"^2.11.0\"},{\"name\":\"jni\",\"req\":\"^0.22.1\",\"target\":\"cfg(target_os = \\\"android\\\")\"},{\"name\":\"js-sys\",\"optional\":true,\"req\":\"^0.3.44\"},{\"default_features\":false,\"features\":[\"critical-section\"],\"name\":\"once_cell\",\"req\":\"^1.20.0\"},{\"name\":\"prefix-trie\",\"optional\":true,\"req\":\"^0.8.4\"},{\"default_features\":false,\"features\":[\"alloc\",\"std_rng\"],\"name\":\"rand\",\"req\":\"^0.10.0\"},{\"features\":[\"std\"],\"name\":\"ring\",\"optional\":true,\"req\":\"^0.17\"},{\"name\":\"rustls-pki-types\",\"optional\":true,\"req\":\"^1.10\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0\"},{\"default_features\":false,\"name\":\"thiserror\",\"req\":\"^2\"},{\"name\":\"time\",\"optional\":true,\"req\":\"^0.3\"},{\"features\":[\"alloc\"],\"name\":\"tinyvec\",\"req\":\"^1.1.1\"},{\"default_features\":false,\"name\":\"tracing\",\"req\":\"^0.1.30\"},{\"default_features\":false,\"name\":\"url\",\"req\":\"^2.5.4\"},{\"name\":\"wasm-bindgen-crate\",\"optional\":true,\"package\":\"wasm-bindgen\",\"req\":\"^0.2.107\"}],\"features\":{\"__dnssec\":[\"dep:bitflags\",\"dep:rustls-pki-types\",\"dep:time\",\"std\"],\"access-control\":[\"std\",\"dep:prefix-trie\"],\"default\":[\"std\"],\"dnssec-aws-lc-rs\":[\"dep:aws-lc-rs\",\"aws-lc-rs/aws-lc-sys\",\"aws-lc-rs/ring-io\",\"__dnssec\"],\"dnssec-ring\":[\"dep:ring\",\"__dnssec\"],\"mdns\":[],\"no-std-rand\":[\"once_cell/critical-section\",\"dep:critical-section\"],\"serde\":[\"dep:serde\",\"std\",\"url/serde\"],\"std\":[\"data-encoding/std\",\"ipnet/std\",\"rand/std\",\"rand/thread_rng\",\"ring?/std\",\"thiserror/std\",\"tracing/std\",\"url/std\"],\"testing\":[\"std\"],\"wasm-bindgen\":[\"dep:wasm-bindgen-crate\",\"dep:js-sys\"]}}",
"hickory-resolver_0.25.2": "{\"dependencies\":[{\"name\":\"backtrace\",\"optional\":true,\"req\":\"^0.3.50\"},{\"name\":\"cfg-if\",\"req\":\"^1\"},{\"default_features\":false,\"features\":[\"std\"],\"kind\":\"dev\",\"name\":\"futures-executor\",\"req\":\"^0.3.5\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"futures-util\",\"req\":\"^0.3.5\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"hickory-proto\",\"req\":\"^0.25\"},{\"name\":\"ipconfig\",\"optional\":true,\"req\":\"^0.3.0\",\"target\":\"cfg(windows)\"},{\"features\":[\"sync\"],\"name\":\"moka\",\"req\":\"^0.12\"},{\"default_features\":false,\"features\":[\"critical-section\"],\"name\":\"once_cell\",\"req\":\"^1.20.0\"},{\"name\":\"parking_lot\",\"req\":\"^0.12\"},{\"default_features\":false,\"features\":[\"log\",\"runtime-tokio\"],\"name\":\"quinn\",\"optional\":true,\"req\":\"^0.11.2\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"rand\",\"req\":\"^0.9\"},{\"features\":[\"system\"],\"name\":\"resolv-conf\",\"optional\":true,\"req\":\"^0.7.0\"},{\"default_features\":false,\"features\":[\"logging\",\"std\",\"tls12\"],\"name\":\"rustls\",\"optional\":true,\"req\":\"^0.23.23\"},{\"features\":[\"derive\",\"rc\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1\"},{\"name\":\"smallvec\",\"req\":\"^1.6\"},{\"default_features\":false,\"name\":\"thiserror\",\"req\":\"^2\"},{\"name\":\"tokio\",\"optional\":true,\"req\":\"^1.21\"},{\"features\":[\"macros\",\"test-util\"],\"kind\":\"dev\",\"name\":\"tokio\",\"req\":\"^1.21\"},{\"default_features\":false,\"name\":\"tokio-rustls\",\"optional\":true,\"req\":\"^0.26\"},{\"kind\":\"dev\",\"name\":\"toml\",\"req\":\"^0.8.14\"},{\"default_features\":false,\"name\":\"tracing\",\"req\":\"^0.1.30\"},{\"default_features\":false,\"features\":[\"env-filter\",\"fmt\",\"std\"],\"kind\":\"dev\",\"name\":\"tracing-subscriber\",\"req\":\"^0.3\"},{\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"^0.26\"}],\"features\":{\"__dnssec\":[],\"__h3\":[\"__quic\"],\"__https\":[\"__tls\"],\"__quic\":[\"dep:quinn\",\"__tls\"],\"__tls\":[\"dep:rustls\",\"dep:tokio-rustls\",\"tokio\"],\"backtrace\":[\"dep:backtrace\",\"hickory-proto/backtrace\"],\"default\":[\"system-config\",\"tokio\"],\"dnssec-aws-lc-rs\":[\"hickory-proto/dnssec-aws-lc-rs\",\"__dnssec\"],\"dnssec-ring\":[\"hickory-proto/dnssec-ring\",\"__dnssec\"],\"h3-aws-lc-rs\":[\"hickory-proto/h3-aws-lc-rs\",\"__h3\"],\"h3-ring\":[\"hickory-proto/h3-ring\",\"__h3\"],\"https-aws-lc-rs\":[\"hickory-proto/https-aws-lc-rs\",\"__https\"],\"https-ring\":[\"hickory-proto/https-ring\",\"__https\"],\"quic-aws-lc-rs\":[\"hickory-proto/quic-aws-lc-rs\",\"__quic\",\"quinn/rustls-aws-lc-rs\"],\"quic-ring\":[\"hickory-proto/quic-ring\",\"__quic\",\"quinn/rustls-ring\"],\"rustls-platform-verifier\":[\"hickory-proto/rustls-platform-verifier\"],\"serde\":[\"dep:serde\",\"hickory-proto/serde\"],\"system-config\":[\"dep:ipconfig\",\"dep:resolv-conf\"],\"tls-aws-lc-rs\":[\"hickory-proto/tls-aws-lc-rs\",\"__tls\"],\"tls-ring\":[\"hickory-proto/tls-ring\",\"__tls\"],\"tokio\":[\"dep:tokio\",\"tokio/rt\",\"hickory-proto/tokio\"],\"webpki-roots\":[\"dep:webpki-roots\",\"hickory-proto/webpki-roots\"]}}",
"hkdf_0.12.4": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"blobby\",\"req\":\"^0.3\"},{\"kind\":\"dev\",\"name\":\"hex-literal\",\"req\":\"^0.2.2\"},{\"name\":\"hmac\",\"req\":\"^0.12.1\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"sha1\",\"req\":\"^0.10\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"sha2\",\"req\":\"^0.10\"}],\"features\":{\"std\":[\"hmac/std\"]}}",
"hkdf_0.13.0": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"blobby\",\"req\":\"^0.4\"},{\"kind\":\"dev\",\"name\":\"hex-literal\",\"req\":\"^1\"},{\"name\":\"hmac\",\"req\":\"^0.13\"},{\"name\":\"kdf\",\"optional\":true,\"req\":\"^0.1\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"sha1\",\"req\":\"^0.11\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"sha2\",\"req\":\"^0.11\"}],\"features\":{}}",
@@ -1525,7 +1529,7 @@
"idna_1.1.0": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"assert_matches\",\"req\":\"^1.3\"},{\"kind\":\"dev\",\"name\":\"bencher\",\"req\":\"^0.1\"},{\"name\":\"idna_adapter\",\"req\":\"^1\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0\"},{\"features\":[\"const_generics\"],\"name\":\"smallvec\",\"req\":\"^1.13.1\"},{\"kind\":\"dev\",\"name\":\"tester\",\"req\":\"^0.9\"},{\"name\":\"utf8_iter\",\"req\":\"^1.0.4\"}],\"features\":{\"alloc\":[],\"compiled_data\":[\"idna_adapter/compiled_data\"],\"default\":[\"std\",\"compiled_data\"],\"std\":[\"alloc\"]}}",
"idna_adapter_1.2.1": "{\"dependencies\":[{\"default_features\":false,\"name\":\"icu_normalizer\",\"req\":\"^2\"},{\"default_features\":false,\"name\":\"icu_properties\",\"req\":\"^2\"}],\"features\":{\"compiled_data\":[\"icu_normalizer/compiled_data\",\"icu_properties/compiled_data\"]}}",
"idna_adapter_1.2.2": "{\"dependencies\":[{\"default_features\":false,\"name\":\"icu_normalizer\",\"req\":\"^2.2\"},{\"default_features\":false,\"name\":\"icu_properties\",\"req\":\"^2.2\"}],\"features\":{\"compiled_data\":[\"icu_normalizer/compiled_data\",\"icu_properties/compiled_data\"]}}",
"ignore_0.4.25": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"std\"],\"kind\":\"dev\",\"name\":\"bstr\",\"req\":\"^1.6.2\"},{\"kind\":\"dev\",\"name\":\"crossbeam-channel\",\"req\":\"^0.5.15\"},{\"name\":\"crossbeam-deque\",\"req\":\"^0.8.3\"},{\"name\":\"globset\",\"req\":\"^0.4.18\"},{\"name\":\"log\",\"req\":\"^0.4.20\"},{\"name\":\"memchr\",\"req\":\"^2.6.3\"},{\"default_features\":false,\"features\":[\"std\",\"perf\",\"syntax\",\"meta\",\"nfa\",\"hybrid\",\"dfa-onepass\"],\"name\":\"regex-automata\",\"req\":\"^0.4.0\"},{\"name\":\"same-file\",\"req\":\"^1.0.6\"},{\"name\":\"walkdir\",\"req\":\"^2.4.0\"},{\"name\":\"winapi-util\",\"req\":\"^0.1.2\",\"target\":\"cfg(windows)\"}],\"features\":{\"simd-accel\":[]}}",
"ignore_0.4.30": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"std\"],\"kind\":\"dev\",\"name\":\"bstr\",\"req\":\"^1.6.2\"},{\"kind\":\"dev\",\"name\":\"crossbeam-channel\",\"req\":\"^0.5.15\"},{\"name\":\"crossbeam-deque\",\"req\":\"^0.8.3\"},{\"name\":\"globset\",\"req\":\"^0.4.18\"},{\"name\":\"log\",\"req\":\"^0.4.20\"},{\"name\":\"memchr\",\"req\":\"^2.6.3\"},{\"default_features\":false,\"features\":[\"std\",\"perf\",\"syntax\",\"meta\",\"nfa\",\"hybrid\",\"dfa-onepass\"],\"name\":\"regex-automata\",\"req\":\"^0.4.0\"},{\"name\":\"same-file\",\"req\":\"^1.0.6\"},{\"name\":\"walkdir\",\"req\":\"^2.4.0\"},{\"name\":\"winapi-util\",\"req\":\"^0.1.2\",\"target\":\"cfg(windows)\"}],\"features\":{\"simd-accel\":[]}}",
"image-webp_0.2.4": "{\"dependencies\":[{\"name\":\"byteorder-lite\",\"req\":\"^0.1.0\"},{\"kind\":\"dev\",\"name\":\"paste\",\"req\":\"^1.0.14\"},{\"kind\":\"dev\",\"name\":\"png\",\"req\":\"^0.17.12\"},{\"name\":\"quick-error\",\"req\":\"^2.0.1\"},{\"kind\":\"dev\",\"name\":\"rand\",\"req\":\"^0.8.5\"},{\"kind\":\"dev\",\"name\":\"webp\",\"req\":\"^0.3.0\"}],\"features\":{\"_benchmarks\":[]}}",
"image_0.25.9": "{\"dependencies\":[{\"features\":[\"extern_crate_alloc\"],\"name\":\"bytemuck\",\"req\":\"^1.8.0\"},{\"name\":\"byteorder-lite\",\"req\":\"^0.1.0\"},{\"name\":\"color_quant\",\"optional\":true,\"req\":\"^1.1\"},{\"kind\":\"dev\",\"name\":\"crc32fast\",\"req\":\"^1.2.0\"},{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.5.0\"},{\"name\":\"dav1d\",\"optional\":true,\"req\":\"^0.10.3\"},{\"default_features\":false,\"name\":\"exr\",\"optional\":true,\"req\":\"^1.74.0\"},{\"name\":\"gif\",\"optional\":true,\"req\":\"^0.14.0\"},{\"kind\":\"dev\",\"name\":\"glob\",\"req\":\"^0.3\"},{\"name\":\"image-webp\",\"optional\":true,\"req\":\"^0.2.0\"},{\"name\":\"moxcms\",\"req\":\"^0.7.4\"},{\"name\":\"mp4parse\",\"optional\":true,\"req\":\"^0.17.0\"},{\"kind\":\"dev\",\"name\":\"num-complex\",\"req\":\"^0.4\"},{\"name\":\"num-traits\",\"req\":\"^0.2.0\"},{\"name\":\"png\",\"optional\":true,\"req\":\"^0.18.0\"},{\"name\":\"qoi\",\"optional\":true,\"req\":\"^0.4\"},{\"kind\":\"dev\",\"name\":\"quickcheck\",\"req\":\"^1\"},{\"default_features\":false,\"name\":\"ravif\",\"optional\":true,\"req\":\"^0.12\"},{\"name\":\"rayon\",\"optional\":true,\"req\":\"^1.7.0\"},{\"default_features\":false,\"name\":\"rgb\",\"optional\":true,\"req\":\"^0.8.48\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.214\"},{\"name\":\"tiff\",\"optional\":true,\"req\":\"^0.10.3\"},{\"default_features\":false,\"name\":\"zune-core\",\"optional\":true,\"req\":\"^0.5.0\"},{\"name\":\"zune-jpeg\",\"optional\":true,\"req\":\"^0.5.5\"}],\"features\":{\"avif\":[\"dep:ravif\",\"dep:rgb\"],\"avif-native\":[\"dep:mp4parse\",\"dep:dav1d\"],\"benchmarks\":[],\"bmp\":[],\"color_quant\":[\"dep:color_quant\"],\"dds\":[],\"default\":[\"rayon\",\"default-formats\"],\"default-formats\":[\"avif\",\"bmp\",\"dds\",\"exr\",\"ff\",\"gif\",\"hdr\",\"ico\",\"jpeg\",\"png\",\"pnm\",\"qoi\",\"tga\",\"tiff\",\"webp\"],\"exr\":[\"dep:exr\"],\"ff\":[],\"gif\":[\"dep:gif\",\"dep:color_quant\"],\"hdr\":[],\"ico\":[\"bmp\",\"png\"],\"jpeg\":[\"dep:zune-core\",\"dep:zune-jpeg\"],\"nasm\":[\"ravif?/asm\"],\"png\":[\"dep:png\"],\"pnm\":[],\"qoi\":[\"dep:qoi\"],\"rayon\":[\"dep:rayon\",\"ravif?/threading\",\"exr?/rayon\"],\"serde\":[\"dep:serde\"],\"tga\":[],\"tiff\":[\"dep:tiff\"],\"webp\":[\"dep:image-webp\"]}}",
"include_dir_0.7.4": "{\"dependencies\":[{\"name\":\"glob\",\"optional\":true,\"req\":\"^0.3\"},{\"name\":\"include_dir_macros\",\"req\":\"^0.7.4\"},{\"kind\":\"dev\",\"name\":\"tempfile\",\"req\":\"^3\"}],\"features\":{\"default\":[],\"metadata\":[\"include_dir_macros/metadata\"],\"nightly\":[\"include_dir_macros/nightly\"]}}",
@@ -1574,6 +1578,7 @@
"jobserver_0.1.34": "{\"dependencies\":[{\"features\":[\"std\"],\"name\":\"getrandom\",\"req\":\"^0.3.2\",\"target\":\"cfg(windows)\"},{\"name\":\"libc\",\"req\":\"^0.2.171\",\"target\":\"cfg(unix)\"},{\"features\":[\"fs\"],\"kind\":\"dev\",\"name\":\"nix\",\"req\":\"^0.28.0\",\"target\":\"cfg(unix)\"},{\"kind\":\"dev\",\"name\":\"tempfile\",\"req\":\"^3.10.1\"}],\"features\":{}}",
"js-sys_0.3.82": "{\"dependencies\":[{\"default_features\":false,\"name\":\"once_cell\",\"req\":\"^1.12\"},{\"default_features\":false,\"name\":\"wasm-bindgen\",\"req\":\"=0.2.105\"}],\"features\":{\"default\":[\"std\"],\"std\":[\"wasm-bindgen/std\"]}}",
"js-sys_0.3.85": "{\"dependencies\":[{\"default_features\":false,\"name\":\"once_cell\",\"req\":\"^1.12\"},{\"default_features\":false,\"name\":\"wasm-bindgen\",\"req\":\"=0.2.108\"}],\"features\":{\"default\":[\"std\"],\"std\":[\"wasm-bindgen/std\"]}}",
"jsonc-parser_0.26.2": "{\"dependencies\":[{\"name\":\"indexmap\",\"optional\":true,\"req\":\"^2.2.6\"},{\"kind\":\"dev\",\"name\":\"pretty_assertions\",\"req\":\"^1.0.0\"},{\"name\":\"serde_json\",\"optional\":true,\"req\":\"^1.0\"},{\"name\":\"unicode-width\",\"optional\":true,\"req\":\"^0.2.0\"}],\"features\":{\"cst\":[],\"error_unicode_width\":[\"unicode-width\"],\"preserve_order\":[\"indexmap\",\"serde_json/preserve_order\"],\"serde\":[\"serde_json\"]}}",
"jsonptr_0.7.1": "{\"dependencies\":[{\"features\":[\"fancy\"],\"name\":\"miette\",\"optional\":true,\"req\":\"^7.4.0\"},{\"kind\":\"dev\",\"name\":\"quickcheck\",\"req\":\"^1.0.3\"},{\"kind\":\"dev\",\"name\":\"quickcheck_macros\",\"req\":\"^1.0.0\"},{\"features\":[\"alloc\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.203\"},{\"features\":[\"alloc\"],\"name\":\"serde_json\",\"optional\":true,\"req\":\"^1.0.119\"},{\"name\":\"syn\",\"optional\":true,\"req\":\"^1.0.109\",\"target\":\"cfg(any())\"},{\"name\":\"toml\",\"optional\":true,\"req\":\"^0.8\"}],\"features\":{\"assign\":[],\"default\":[\"std\",\"serde\",\"json\",\"resolve\",\"assign\",\"delete\"],\"delete\":[\"resolve\"],\"json\":[\"dep:serde_json\",\"serde\"],\"miette\":[\"dep:miette\",\"std\"],\"resolve\":[],\"std\":[\"serde/std\",\"serde_json?/std\"],\"toml\":[\"dep:toml\",\"serde\",\"std\"]}}",
"jsonwebtoken_9.3.1": "{\"dependencies\":[{\"name\":\"base64\",\"req\":\"^0.22\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.4\",\"target\":\"cfg(all(target_arch = \\\"wasm32\\\", not(any(target_os = \\\"emscripten\\\", target_os = \\\"wasi\\\"))))\"},{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.4\",\"target\":\"cfg(not(all(target_arch = \\\"wasm32\\\", not(any(target_os = \\\"emscripten\\\", target_os = \\\"wasi\\\")))))\"},{\"name\":\"js-sys\",\"req\":\"^0.3\",\"target\":\"cfg(target_arch = \\\"wasm32\\\")\"},{\"name\":\"pem\",\"optional\":true,\"req\":\"^3\"},{\"features\":[\"std\"],\"name\":\"ring\",\"req\":\"^0.17.4\",\"target\":\"cfg(not(target_arch = \\\"wasm32\\\"))\"},{\"features\":[\"std\",\"wasm32_unknown_unknown_js\"],\"name\":\"ring\",\"req\":\"^0.17.4\",\"target\":\"cfg(target_arch = \\\"wasm32\\\")\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"req\":\"^1.0\"},{\"name\":\"serde_json\",\"req\":\"^1.0\"},{\"name\":\"simple_asn1\",\"optional\":true,\"req\":\"^0.6\"},{\"features\":[\"wasm-bindgen\"],\"kind\":\"dev\",\"name\":\"time\",\"req\":\"^0.3\",\"target\":\"cfg(all(target_arch = \\\"wasm32\\\", not(any(target_os = \\\"emscripten\\\", target_os = \\\"wasi\\\"))))\"},{\"kind\":\"dev\",\"name\":\"time\",\"req\":\"^0.3\",\"target\":\"cfg(not(all(target_arch = \\\"wasm32\\\", not(any(target_os = \\\"emscripten\\\", target_os = \\\"wasi\\\")))))\"},{\"kind\":\"dev\",\"name\":\"wasm-bindgen-test\",\"req\":\"^0.3.1\"}],\"features\":{\"default\":[\"use_pem\"],\"use_pem\":[\"pem\",\"simple_asn1\"]}}",
"kasuari_0.4.12": "{\"dependencies\":[{\"name\":\"document-features\",\"optional\":true,\"req\":\"^0.2\"},{\"name\":\"hashbrown\",\"req\":\"^0.16\"},{\"default_features\":false,\"features\":[\"require-cas\"],\"name\":\"portable-atomic\",\"optional\":true,\"req\":\"^1.13\"},{\"features\":[\"alloc\"],\"name\":\"portable-atomic-util\",\"optional\":true,\"req\":\"^0.2.5\"},{\"kind\":\"dev\",\"name\":\"rstest\",\"req\":\"^0.26\"},{\"default_features\":false,\"name\":\"thiserror\",\"req\":\"^2.0\"}],\"features\":{\"default\":[\"std\"],\"document-features\":[\"dep:document-features\"],\"portable-atomic\":[\"dep:portable-atomic\",\"dep:portable-atomic-util\"],\"std\":[\"thiserror/std\",\"portable-atomic?/std\"]}}",
@@ -1597,7 +1602,7 @@
"libm_0.2.16": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"no-panic\",\"req\":\"^0.1.35\"}],\"features\":{\"arch\":[],\"default\":[\"arch\"],\"force-soft-floats\":[],\"unstable\":[\"unstable-intrinsics\",\"unstable-float\"],\"unstable-float\":[],\"unstable-intrinsics\":[],\"unstable-public-internals\":[]}}",
"libredox_0.1.12": "{\"dependencies\":[{\"name\":\"bitflags\",\"req\":\"^2\"},{\"name\":\"ioslice\",\"optional\":true,\"req\":\"^0.6\"},{\"name\":\"libc\",\"req\":\"^0.2\"},{\"name\":\"redox_syscall\",\"optional\":true,\"req\":\"^0.7\"}],\"features\":{\"call\":[],\"default\":[\"call\",\"std\",\"redox_syscall\"],\"mkns\":[\"ioslice\"],\"std\":[]}}",
"libredox_0.1.14": "{\"dependencies\":[{\"name\":\"bitflags\",\"optional\":true,\"req\":\"^2\"},{\"name\":\"ioslice\",\"optional\":true,\"req\":\"^0.6\"},{\"name\":\"libc\",\"optional\":true,\"req\":\"^0.2\"},{\"name\":\"plain\",\"optional\":true,\"req\":\"^0.2\"},{\"name\":\"redox_syscall\",\"optional\":true,\"req\":\"^0.7\"}],\"features\":{\"base\":[\"libc\"],\"call\":[\"base\"],\"default\":[\"base\",\"call\",\"std\",\"redox_syscall\",\"protocol\"],\"mkns\":[\"ioslice\"],\"protocol\":[\"plain\",\"bitflags\",\"redox_syscall\"],\"std\":[\"base\"]}}",
"libsqlite3-sys_0.37.0": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"runtime\"],\"kind\":\"build\",\"name\":\"bindgen\",\"optional\":true,\"req\":\"^0.72\"},{\"kind\":\"build\",\"name\":\"cc\",\"optional\":true,\"req\":\"^1.2.27\"},{\"name\":\"openssl-sys\",\"optional\":true,\"req\":\"^0.9.103\"},{\"kind\":\"build\",\"name\":\"pkg-config\",\"optional\":true,\"req\":\"^0.3.19\"},{\"kind\":\"build\",\"name\":\"prettyplease\",\"optional\":true,\"req\":\"^0.2.20\"},{\"default_features\":false,\"kind\":\"build\",\"name\":\"quote\",\"optional\":true,\"req\":\"^1.0.36\"},{\"features\":[\"full\",\"extra-traits\",\"visit-mut\"],\"kind\":\"build\",\"name\":\"syn\",\"optional\":true,\"req\":\"^2.0.89\"},{\"kind\":\"build\",\"name\":\"vcpkg\",\"optional\":true,\"req\":\"^0.2.15\"}],\"features\":{\"buildtime_bindgen\":[\"bindgen\",\"pkg-config\",\"vcpkg\"],\"bundled\":[\"cc\",\"bundled_bindings\"],\"bundled-sqlcipher\":[\"bundled\"],\"bundled-sqlcipher-vendored-openssl\":[\"bundled-sqlcipher\",\"openssl-sys/vendored\"],\"bundled-windows\":[\"cc\",\"bundled_bindings\"],\"bundled_bindings\":[],\"column_metadata\":[],\"default\":[\"min_sqlite_version_3_34_1\"],\"in_gecko\":[],\"loadable_extension\":[\"prettyplease\",\"quote\",\"syn\"],\"min_sqlite_version_3_34_1\":[\"pkg-config\",\"vcpkg\"],\"preupdate_hook\":[\"buildtime_bindgen\"],\"session\":[\"preupdate_hook\",\"buildtime_bindgen\"],\"sqlcipher\":[],\"unlock_notify\":[],\"wasm32-wasi-vfs\":[],\"with-asan\":[]}}",
"libsqlite3-sys_0.39.1": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"runtime\"],\"kind\":\"build\",\"name\":\"bindgen\",\"optional\":true,\"req\":\"^0.73\"},{\"kind\":\"build\",\"name\":\"cc\",\"optional\":true,\"req\":\"^1.2.27\"},{\"name\":\"openssl-sys\",\"optional\":true,\"req\":\"^0.9.103\"},{\"kind\":\"build\",\"name\":\"pkg-config\",\"optional\":true,\"req\":\"^0.3.19\"},{\"kind\":\"build\",\"name\":\"prettyplease\",\"optional\":true,\"req\":\"^0.3.0\"},{\"default_features\":false,\"kind\":\"build\",\"name\":\"quote\",\"optional\":true,\"req\":\"^1.0.36\"},{\"kind\":\"build\",\"name\":\"sqlcipher-src\",\"optional\":true,\"req\":\"=419.0.6\"},{\"features\":[\"full\",\"extra-traits\",\"visit-mut\"],\"kind\":\"build\",\"name\":\"syn\",\"optional\":true,\"req\":\"^3.0.1\"},{\"kind\":\"build\",\"name\":\"vcpkg\",\"optional\":true,\"req\":\"^0.2.15\"}],\"features\":{\"buildtime_bindgen\":[\"bindgen\",\"pkg-config\",\"vcpkg\"],\"bundled\":[\"cc\",\"bundled_bindings\"],\"bundled-sqlcipher\":[\"bundled\",\"dep:sqlcipher-src\"],\"bundled-sqlcipher-vendored-openssl\":[\"bundled-sqlcipher\",\"openssl-sys/vendored\"],\"bundled-windows\":[\"cc\",\"bundled_bindings\"],\"bundled_bindings\":[],\"column_metadata\":[],\"default\":[\"min_sqlite_version_3_45_3\"],\"in_gecko\":[],\"loadable_extension\":[\"prettyplease\",\"quote\",\"syn\"],\"min_sqlite_version_3_45_3\":[\"pkg-config\",\"vcpkg\"],\"preupdate_hook\":[\"buildtime_bindgen\"],\"session\":[\"preupdate_hook\",\"buildtime_bindgen\"],\"sqlcipher\":[],\"unlock_notify\":[],\"wasm32-wasi-vfs\":[],\"with-asan\":[]}}",
"libz-sys_1.1.25": "{\"dependencies\":[{\"kind\":\"build\",\"name\":\"cc\",\"req\":\"^1.0.98\"},{\"kind\":\"build\",\"name\":\"cmake\",\"optional\":true,\"req\":\"^0.1.50\"},{\"name\":\"libc\",\"optional\":true,\"req\":\"^0.2.43\"},{\"kind\":\"build\",\"name\":\"pkg-config\",\"req\":\"^0.3.9\"},{\"kind\":\"build\",\"name\":\"vcpkg\",\"req\":\"^0.2.11\"}],\"features\":{\"asm\":[],\"default\":[\"libc\",\"stock-zlib\"],\"static\":[],\"stock-zlib\":[],\"zlib-ng\":[\"libc\",\"cmake\"],\"zlib-ng-no-cmake-experimental-community-maintained\":[\"libc\"]}}",
"libz-sys_1.1.29": "{\"dependencies\":[{\"kind\":\"build\",\"name\":\"cc\",\"req\":\"^1.0.98\"},{\"kind\":\"build\",\"name\":\"cmake\",\"optional\":true,\"req\":\"^0.1.50\"},{\"name\":\"libc\",\"optional\":true,\"req\":\"^0.2.43\"},{\"kind\":\"build\",\"name\":\"pkg-config\",\"req\":\"^0.3.9\"},{\"kind\":\"build\",\"name\":\"vcpkg\",\"req\":\"^0.2.11\"}],\"features\":{\"asm\":[],\"default\":[\"libc\",\"stock-zlib\"],\"static\":[],\"stock-zlib\":[],\"zlib-ng\":[\"libc\",\"cmake\"],\"zlib-ng-no-cmake-experimental-community-maintained\":[\"libc\"]}}",
"line-clipping_0.3.7": "{\"dependencies\":[{\"name\":\"bitflags\",\"req\":\"^2.11\"},{\"kind\":\"dev\",\"name\":\"rstest\",\"req\":\"^0.26\"}],\"features\":{}}",
@@ -1670,8 +1675,8 @@
"nu-ansi-term_0.50.3": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"doc-comment\",\"req\":\"^0.3.3\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.152\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.94\"},{\"features\":[\"Win32_Foundation\",\"Win32_System_Console\",\"Win32_Storage_FileSystem\",\"Win32_Security\"],\"name\":\"windows\",\"package\":\"windows-sys\",\"req\":\">=0.59, <=0.61\",\"target\":\"cfg(windows)\"}],\"features\":{\"default\":[\"std\"],\"derive_serde_style\":[\"serde\"],\"gnu_legacy\":[],\"std\":[]}}",
"num-bigint_0.4.6": "{\"dependencies\":[{\"default_features\":false,\"name\":\"arbitrary\",\"optional\":true,\"req\":\"^1\"},{\"default_features\":false,\"features\":[\"i128\"],\"name\":\"num-integer\",\"req\":\"^0.1.46\"},{\"default_features\":false,\"features\":[\"i128\"],\"name\":\"num-traits\",\"req\":\"^0.2.18\"},{\"default_features\":false,\"name\":\"quickcheck\",\"optional\":true,\"req\":\"^1\"},{\"default_features\":false,\"name\":\"rand\",\"optional\":true,\"req\":\"^0.8\"},{\"default_features\":false,\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0\"}],\"features\":{\"arbitrary\":[\"dep:arbitrary\"],\"default\":[\"std\"],\"quickcheck\":[\"dep:quickcheck\"],\"rand\":[\"dep:rand\"],\"serde\":[\"dep:serde\"],\"std\":[\"num-integer/std\",\"num-traits/std\"]}}",
"num-complex_0.4.6": "{\"dependencies\":[{\"default_features\":false,\"name\":\"bytecheck\",\"optional\":true,\"req\":\"^0.6\"},{\"name\":\"bytemuck\",\"optional\":true,\"req\":\"^1\"},{\"default_features\":false,\"features\":[\"i128\"],\"name\":\"num-traits\",\"req\":\"^0.2.18\"},{\"default_features\":false,\"name\":\"rand\",\"optional\":true,\"req\":\"^0.8\"},{\"default_features\":false,\"name\":\"rkyv\",\"optional\":true,\"req\":\"^0.7\"},{\"default_features\":false,\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0\"}],\"features\":{\"bytecheck\":[\"dep:bytecheck\"],\"bytemuck\":[\"dep:bytemuck\"],\"default\":[\"std\"],\"libm\":[\"num-traits/libm\"],\"rand\":[\"dep:rand\"],\"rkyv\":[\"dep:rkyv\"],\"serde\":[\"dep:serde\"],\"std\":[\"num-traits/std\"]}}",
"num-conv_0.2.0": "{\"dependencies\":[],\"features\":{}}",
"num-conv_0.2.1": "{\"dependencies\":[],\"features\":{}}",
"num-conv_0.2.2": "{\"dependencies\":[],\"features\":{}}",
"num-derive_0.4.2": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"num\",\"req\":\"^0.4\"},{\"kind\":\"dev\",\"name\":\"num-traits\",\"req\":\"^0.2\"},{\"name\":\"proc-macro2\",\"req\":\"^1\"},{\"name\":\"quote\",\"req\":\"^1\"},{\"name\":\"syn\",\"req\":\"^2.0.5\"}],\"features\":{}}",
"num-integer_0.1.46": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"i128\"],\"name\":\"num-traits\",\"req\":\"^0.2.11\"}],\"features\":{\"default\":[\"std\"],\"i128\":[],\"std\":[\"num-traits/std\"]}}",
"num-iter_0.1.45": "{\"dependencies\":[{\"kind\":\"build\",\"name\":\"autocfg\",\"req\":\"^1\"},{\"default_features\":false,\"features\":[\"i128\"],\"name\":\"num-integer\",\"req\":\"^0.1.46\"},{\"default_features\":false,\"features\":[\"i128\"],\"name\":\"num-traits\",\"req\":\"^0.2.11\"}],\"features\":{\"default\":[\"std\"],\"i128\":[],\"std\":[\"num-integer/std\",\"num-traits/std\"]}}",
@@ -1717,8 +1722,8 @@
"openssl-probe_0.1.6": "{\"dependencies\":[],\"features\":{}}",
"openssl-probe_0.2.1": "{\"dependencies\":[],\"features\":{}}",
"openssl-src_300.6.1+3.6.3": "{\"dependencies\":[{\"name\":\"cc\",\"req\":\"^1.0.79\"}],\"features\":{\"camellia\":[],\"default\":[],\"force-engine\":[],\"idea\":[],\"ktls\":[],\"legacy\":[],\"no-dso\":[],\"seed\":[],\"ssl3\":[],\"weak-crypto\":[]}}",
"openssl-sys_0.9.111": "{\"dependencies\":[{\"features\":[\"ssl\",\"bindgen\"],\"name\":\"aws-lc-fips-sys\",\"optional\":true,\"req\":\"^0.13\"},{\"features\":[\"ssl\"],\"name\":\"aws-lc-sys\",\"optional\":true,\"req\":\"^0.27\"},{\"features\":[\"experimental\"],\"kind\":\"build\",\"name\":\"bindgen\",\"optional\":true,\"req\":\"^0.72.0\"},{\"name\":\"bssl-sys\",\"optional\":true,\"req\":\"^0.1.0\"},{\"kind\":\"build\",\"name\":\"cc\",\"req\":\"^1.0.61\"},{\"name\":\"libc\",\"req\":\"^0.2\"},{\"features\":[\"legacy\"],\"kind\":\"build\",\"name\":\"openssl-src\",\"optional\":true,\"req\":\"^300.2.0\"},{\"kind\":\"build\",\"name\":\"pkg-config\",\"req\":\"^0.3.9\"},{\"kind\":\"build\",\"name\":\"vcpkg\",\"req\":\"^0.2.8\"}],\"features\":{\"aws-lc\":[\"dep:aws-lc-sys\"],\"aws-lc-fips\":[\"dep:aws-lc-fips-sys\"],\"unstable_boringssl\":[\"bssl-sys\"],\"vendored\":[\"openssl-src\"]}}",
"openssl_0.10.75": "{\"dependencies\":[{\"name\":\"bitflags\",\"req\":\"^2.2.1\"},{\"name\":\"cfg-if\",\"req\":\"^1.0\"},{\"name\":\"ffi\",\"package\":\"openssl-sys\",\"req\":\"^0.9.111\"},{\"name\":\"foreign-types\",\"req\":\"^0.3.1\"},{\"kind\":\"dev\",\"name\":\"hex\",\"req\":\"^0.4\"},{\"name\":\"libc\",\"req\":\"^0.2\"},{\"name\":\"once_cell\",\"req\":\"^1.5.2\"},{\"name\":\"openssl-macros\",\"req\":\"^0.1.1\"}],\"features\":{\"aws-lc\":[\"ffi/aws-lc\"],\"aws-lc-fips\":[\"ffi/aws-lc-fips\"],\"bindgen\":[\"ffi/bindgen\"],\"default\":[],\"unstable_boringssl\":[\"ffi/unstable_boringssl\"],\"v101\":[],\"v102\":[],\"v110\":[],\"v111\":[],\"vendored\":[\"ffi/vendored\"]}}",
"openssl-sys_0.9.118": "{\"dependencies\":[{\"features\":[\"ssl\",\"bindgen\"],\"name\":\"aws-lc-fips-sys\",\"optional\":true,\"req\":\"^0.14\"},{\"features\":[\"ssl\"],\"name\":\"aws-lc-sys\",\"optional\":true,\"req\":\"^0.41\"},{\"features\":[\"experimental\"],\"kind\":\"build\",\"name\":\"bindgen\",\"optional\":true,\"req\":\"^0.72.0\"},{\"name\":\"bssl-sys\",\"optional\":true,\"req\":\"^0.1.0\"},{\"kind\":\"build\",\"name\":\"cc\",\"req\":\"^1.0.61\"},{\"name\":\"libc\",\"req\":\"^0.2\"},{\"features\":[\"legacy\"],\"kind\":\"build\",\"name\":\"openssl-src\",\"optional\":true,\"req\":\"^300.2.0\"},{\"kind\":\"build\",\"name\":\"pkg-config\",\"req\":\"^0.3.9\"},{\"kind\":\"build\",\"name\":\"vcpkg\",\"req\":\"^0.2.8\"}],\"features\":{\"aws-lc\":[\"dep:aws-lc-sys\"],\"aws-lc-fips\":[\"dep:aws-lc-fips-sys\"],\"unstable_boringssl\":[\"bssl-sys\"],\"vendored\":[\"openssl-src\"]}}",
"openssl_0.10.82": "{\"dependencies\":[{\"name\":\"bitflags\",\"req\":\"^2.2.1\"},{\"name\":\"cfg-if\",\"req\":\"^1.0\"},{\"name\":\"ffi\",\"package\":\"openssl-sys\",\"req\":\"^0.9.118\"},{\"name\":\"foreign-types\",\"req\":\"^0.3.1\"},{\"kind\":\"dev\",\"name\":\"hex\",\"req\":\"^0.4\"},{\"name\":\"libc\",\"req\":\"^0.2\"},{\"name\":\"openssl-macros\",\"req\":\"^0.1.1\"}],\"features\":{\"aws-lc\":[\"ffi/aws-lc\"],\"aws-lc-fips\":[\"ffi/aws-lc-fips\"],\"bindgen\":[\"ffi/bindgen\"],\"default\":[],\"unstable_boringssl\":[\"ffi/unstable_boringssl\"],\"v101\":[],\"v102\":[],\"v110\":[],\"v111\":[],\"vendored\":[\"ffi/vendored\"]}}",
"opentelemetry-appender-tracing_0.31.1": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.5\"},{\"name\":\"log\",\"optional\":true,\"req\":\"^0.4.21\"},{\"kind\":\"dev\",\"name\":\"log\",\"req\":\"^0.4.21\"},{\"default_features\":false,\"features\":[\"logs\"],\"name\":\"opentelemetry\",\"req\":\"^0.31\"},{\"default_features\":false,\"features\":[\"logs\"],\"kind\":\"dev\",\"name\":\"opentelemetry-stdout\",\"req\":\"^0.31\"},{\"default_features\":false,\"features\":[\"logs\",\"testing\",\"internal-logs\"],\"kind\":\"dev\",\"name\":\"opentelemetry_sdk\",\"req\":\"^0.31\"},{\"features\":[\"flamegraph\",\"criterion\"],\"kind\":\"dev\",\"name\":\"pprof\",\"req\":\"^0.14\",\"target\":\"cfg(not(target_os = \\\"windows\\\"))\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"tracing\",\"req\":\">=0.1.40\"},{\"default_features\":false,\"features\":[\"std\"],\"kind\":\"dev\",\"name\":\"tracing\",\"req\":\">=0.1.40\"},{\"default_features\":false,\"name\":\"tracing-core\",\"req\":\">=0.1.33\"},{\"name\":\"tracing-log\",\"optional\":true,\"req\":\"^0.2\"},{\"kind\":\"dev\",\"name\":\"tracing-log\",\"req\":\"^0.2\"},{\"name\":\"tracing-opentelemetry\",\"optional\":true,\"req\":\"^0.32\"},{\"default_features\":false,\"features\":[\"registry\",\"std\"],\"name\":\"tracing-subscriber\",\"req\":\"^0.3\"},{\"default_features\":false,\"features\":[\"env-filter\",\"registry\",\"std\",\"fmt\"],\"kind\":\"dev\",\"name\":\"tracing-subscriber\",\"req\":\"^0.3\"}],\"features\":{\"default\":[],\"experimental_metadata_attributes\":[\"dep:tracing-log\"],\"experimental_use_tracing_span_context\":[\"tracing-opentelemetry\"],\"spec_unstable_logs_enabled\":[\"opentelemetry/spec_unstable_logs_enabled\"]}}",
"opentelemetry-http_0.31.0": "{\"dependencies\":[{\"name\":\"async-trait\",\"req\":\"^0.1\"},{\"name\":\"bytes\",\"req\":\"^1\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"http\",\"req\":\"^1.1\"},{\"name\":\"http-body-util\",\"optional\":true,\"req\":\"^0.1\"},{\"default_features\":false,\"name\":\"hyper\",\"optional\":true,\"req\":\"^1.3\"},{\"features\":[\"client-legacy\",\"http1\",\"http2\"],\"name\":\"hyper-util\",\"optional\":true,\"req\":\"^0.1\"},{\"default_features\":false,\"features\":[\"trace\"],\"name\":\"opentelemetry\",\"req\":\"^0.31\"},{\"default_features\":false,\"name\":\"reqwest\",\"optional\":true,\"req\":\"^0.12\"},{\"default_features\":false,\"features\":[\"time\"],\"name\":\"tokio\",\"optional\":true,\"req\":\"^1\"}],\"features\":{\"default\":[\"internal-logs\"],\"hyper\":[\"dep:http-body-util\",\"dep:hyper\",\"dep:hyper-util\",\"dep:tokio\"],\"internal-logs\":[\"opentelemetry/internal-logs\"],\"reqwest\":[\"dep:reqwest\"],\"reqwest-blocking\":[\"dep:reqwest\",\"reqwest/blocking\"],\"reqwest-rustls\":[\"dep:reqwest\",\"reqwest/rustls-tls-native-roots\"],\"reqwest-rustls-webpki-roots\":[\"dep:reqwest\",\"reqwest/rustls-tls-webpki-roots\"]}}",
"opentelemetry-otlp_0.31.0": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"async-trait\",\"req\":\"^0.1\"},{\"name\":\"flate2\",\"optional\":true,\"req\":\"^1.1.2\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"futures-util\",\"req\":\"^0.3\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"http\",\"optional\":true,\"req\":\"^1.1\"},{\"default_features\":false,\"name\":\"opentelemetry\",\"req\":\"^0.31\"},{\"default_features\":false,\"name\":\"opentelemetry-http\",\"optional\":true,\"req\":\"^0.31\"},{\"default_features\":false,\"name\":\"opentelemetry-proto\",\"req\":\"^0.31\"},{\"default_features\":false,\"name\":\"opentelemetry_sdk\",\"req\":\"^0.31\"},{\"default_features\":false,\"features\":[\"trace\",\"testing\"],\"kind\":\"dev\",\"name\":\"opentelemetry_sdk\",\"req\":\"^0.31\"},{\"name\":\"prost\",\"optional\":true,\"req\":\"^0.14\"},{\"default_features\":false,\"name\":\"reqwest\",\"optional\":true,\"req\":\"^0.12\"},{\"default_features\":false,\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0\"},{\"name\":\"serde_json\",\"optional\":true,\"req\":\"^1.0\"},{\"kind\":\"dev\",\"name\":\"temp-env\",\"req\":\"^0.3.6\"},{\"default_features\":false,\"name\":\"thiserror\",\"req\":\"^2\"},{\"default_features\":false,\"features\":[\"sync\",\"rt\"],\"name\":\"tokio\",\"optional\":true,\"req\":\"^1\"},{\"default_features\":false,\"features\":[\"macros\",\"rt-multi-thread\"],\"kind\":\"dev\",\"name\":\"tokio\",\"req\":\"^1\"},{\"features\":[\"net\"],\"kind\":\"dev\",\"name\":\"tokio-stream\",\"req\":\"^0.1\"},{\"default_features\":false,\"name\":\"tonic\",\"optional\":true,\"req\":\"^0.14.1\"},{\"default_features\":false,\"features\":[\"router\",\"server\"],\"kind\":\"dev\",\"name\":\"tonic\",\"req\":\"^0.14.1\"},{\"default_features\":false,\"name\":\"tracing\",\"optional\":true,\"req\":\">=0.1.40\"},{\"name\":\"zstd\",\"optional\":true,\"req\":\"^0.13\"}],\"features\":{\"default\":[\"http-proto\",\"reqwest-blocking-client\",\"trace\",\"metrics\",\"logs\",\"internal-logs\"],\"grpc-tonic\":[\"tonic\",\"prost\",\"http\",\"tokio\",\"opentelemetry-proto/gen-tonic\"],\"gzip-http\":[\"flate2\"],\"gzip-tonic\":[\"tonic/gzip\"],\"http-json\":[\"serde_json\",\"prost\",\"opentelemetry-http\",\"opentelemetry-proto/gen-tonic-messages\",\"opentelemetry-proto/with-serde\",\"http\",\"trace\",\"metrics\"],\"http-proto\":[\"prost\",\"opentelemetry-http\",\"opentelemetry-proto/gen-tonic-messages\",\"http\",\"trace\",\"metrics\"],\"hyper-client\":[\"opentelemetry-http/hyper\"],\"integration-testing\":[\"tonic\",\"prost\",\"tokio/full\",\"trace\",\"logs\"],\"internal-logs\":[\"tracing\",\"opentelemetry_sdk/internal-logs\",\"opentelemetry-http/internal-logs\"],\"logs\":[\"opentelemetry/logs\",\"opentelemetry_sdk/logs\",\"opentelemetry-proto/logs\"],\"metrics\":[\"opentelemetry/metrics\",\"opentelemetry_sdk/metrics\",\"opentelemetry-proto/metrics\"],\"reqwest-blocking-client\":[\"reqwest/blocking\",\"opentelemetry-http/reqwest-blocking\"],\"reqwest-client\":[\"reqwest\",\"opentelemetry-http/reqwest\"],\"reqwest-rustls\":[\"reqwest\",\"opentelemetry-http/reqwest-rustls\"],\"reqwest-rustls-webpki-roots\":[\"reqwest\",\"opentelemetry-http/reqwest-rustls-webpki-roots\"],\"serialize\":[\"serde\",\"serde_json\"],\"tls\":[\"tonic/tls-ring\"],\"tls-roots\":[\"tls\",\"tonic/tls-native-roots\"],\"tls-webpki-roots\":[\"tls\",\"tonic/tls-webpki-roots\"],\"trace\":[\"opentelemetry/trace\",\"opentelemetry_sdk/trace\",\"opentelemetry-proto/trace\"],\"zstd-http\":[\"zstd\"],\"zstd-tonic\":[\"tonic/zstd\"]}}",
@@ -2035,6 +2040,7 @@
"smol_str_0.3.5": "{\"dependencies\":[{\"name\":\"arbitrary\",\"optional\":true,\"req\":\"^1.3\"},{\"default_features\":false,\"name\":\"borsh\",\"optional\":true,\"req\":\"^1.4.0\"},{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.7\"},{\"kind\":\"dev\",\"name\":\"proptest\",\"req\":\"^1.5\"},{\"kind\":\"dev\",\"name\":\"rand\",\"req\":\"^0.9.2\"},{\"features\":[\"derive\"],\"kind\":\"dev\",\"name\":\"serde\",\"req\":\"^1.0\"},{\"default_features\":false,\"name\":\"serde_core\",\"optional\":true,\"req\":\"^1.0.220\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0\"}],\"features\":{\"default\":[\"std\"],\"serde\":[\"dep:serde_core\"],\"std\":[\"serde_core?/std\",\"borsh?/std\"]}}",
"socket2_0.5.10": "{\"dependencies\":[{\"name\":\"libc\",\"req\":\"^0.2.171\",\"target\":\"cfg(unix)\"},{\"features\":[\"Win32_Foundation\",\"Win32_Networking_WinSock\",\"Win32_System_IO\",\"Win32_System_Threading\",\"Win32_System_WindowsProgramming\"],\"name\":\"windows-sys\",\"req\":\"^0.52\",\"target\":\"cfg(windows)\"}],\"features\":{\"all\":[]}}",
"socket2_0.6.3": "{\"dependencies\":[{\"name\":\"libc\",\"req\":\"^0.2.172\",\"target\":\"cfg(any(unix, target_os = \\\"wasi\\\"))\"},{\"features\":[\"Win32_Foundation\",\"Win32_Networking_WinSock\",\"Win32_System_IO\",\"Win32_System_Threading\",\"Win32_System_WindowsProgramming\"],\"name\":\"windows-sys\",\"req\":\">=0.60, <0.62\",\"target\":\"cfg(windows)\"}],\"features\":{\"all\":[]}}",
"socks5-protocol_0.3.5": "{\"dependencies\":[{\"name\":\"thiserror\",\"req\":\"^1.0\"},{\"features\":[\"io-util\"],\"name\":\"tokio\",\"req\":\"^1.0\"},{\"features\":[\"full\"],\"kind\":\"dev\",\"name\":\"tokio\",\"req\":\"^1.0\"}],\"features\":{\"default\":[\"sync\"],\"doc\":[\"tokio/rt-multi-thread\",\"tokio/macros\"],\"sync\":[]}}",
"sonora-aec3_0.2.0": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"proptest\",\"req\":\"^1.11\"},{\"name\":\"sonora-common-audio\",\"req\":\"^0.2.0\"},{\"name\":\"sonora-fft\",\"req\":\"^0.2.0\"},{\"name\":\"sonora-simd\",\"req\":\"^0.2.0\"},{\"kind\":\"dev\",\"name\":\"test-strategy\",\"req\":\"^0.4\"}],\"features\":{}}",
"sonora-agc2_0.2.0": "{\"dependencies\":[{\"features\":[\"derive\"],\"name\":\"bytemuck\",\"req\":\"^1\"},{\"features\":[\"debug\"],\"name\":\"derive_more\",\"req\":\"^2\"},{\"kind\":\"dev\",\"name\":\"proptest\",\"req\":\"^1.11\"},{\"name\":\"sonora-common-audio\",\"req\":\"^0.2.0\"},{\"name\":\"sonora-fft\",\"req\":\"^0.2.0\"},{\"name\":\"sonora-simd\",\"req\":\"^0.2.0\"},{\"kind\":\"dev\",\"name\":\"test-strategy\",\"req\":\"^0.4\"},{\"name\":\"tracing\",\"req\":\"^0.1\"}],\"features\":{}}",
"sonora-common-audio_0.2.0": "{\"dependencies\":[{\"features\":[\"debug\"],\"name\":\"derive_more\",\"req\":\"^2\"},{\"name\":\"sonora-simd\",\"req\":\"^0.2.0\"}],\"features\":{}}",
@@ -2045,12 +2051,10 @@
"sorted_vector_map_0.2.1": "{\"dependencies\":[{\"name\":\"itertools\",\"req\":\"^0.14.0\"},{\"name\":\"quickcheck\",\"req\":\"^1.0\"}],\"features\":{}}",
"spin_0.9.8": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.4\"},{\"name\":\"lock_api_crate\",\"optional\":true,\"package\":\"lock_api\",\"req\":\"^0.4\"},{\"default_features\":false,\"name\":\"portable-atomic\",\"optional\":true,\"req\":\"^1\"}],\"features\":{\"barrier\":[\"mutex\"],\"default\":[\"lock_api\",\"mutex\",\"spin_mutex\",\"rwlock\",\"once\",\"lazy\",\"barrier\"],\"fair_mutex\":[\"mutex\"],\"lazy\":[\"once\"],\"lock_api\":[\"lock_api_crate\"],\"mutex\":[],\"once\":[],\"portable_atomic\":[\"portable-atomic\"],\"rwlock\":[],\"spin_mutex\":[\"mutex\"],\"std\":[],\"ticket_mutex\":[\"mutex\"],\"use_ticket_mutex\":[\"mutex\",\"ticket_mutex\"]}}",
"spki_0.7.3": "{\"dependencies\":[{\"features\":[\"derive\"],\"name\":\"arbitrary\",\"optional\":true,\"req\":\"^1.2\"},{\"default_features\":false,\"name\":\"base64ct\",\"optional\":true,\"req\":\"^1\"},{\"features\":[\"oid\"],\"name\":\"der\",\"req\":\"^0.7.2\"},{\"kind\":\"dev\",\"name\":\"hex-literal\",\"req\":\"^0.4\"},{\"default_features\":false,\"name\":\"sha2\",\"optional\":true,\"req\":\"^0.10\"},{\"kind\":\"dev\",\"name\":\"tempfile\",\"req\":\"^3\"}],\"features\":{\"alloc\":[\"base64ct?/alloc\",\"der/alloc\"],\"arbitrary\":[\"std\",\"dep:arbitrary\",\"der/arbitrary\"],\"base64\":[\"dep:base64ct\"],\"fingerprint\":[\"sha2\"],\"pem\":[\"alloc\",\"der/pem\"],\"std\":[\"der/std\",\"alloc\"]}}",
"sqlx-core_0.9.0": "{\"dependencies\":[{\"name\":\"async-fs\",\"optional\":true,\"req\":\"^2.1\"},{\"default_features\":false,\"features\":[\"async-io\"],\"name\":\"async-global-executor\",\"optional\":true,\"req\":\"^3.1\"},{\"name\":\"async-io\",\"optional\":true,\"req\":\"^2.4.1\"},{\"name\":\"async-std\",\"optional\":true,\"req\":\"^1.13\"},{\"name\":\"async-task\",\"optional\":true,\"req\":\"^4.7.1\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"base64\",\"req\":\"^0.22.1\"},{\"name\":\"bigdecimal\",\"optional\":true,\"req\":\"^0.4.0\"},{\"name\":\"bit-vec\",\"optional\":true,\"req\":\"^0.8\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"bstr\",\"optional\":true,\"req\":\"^1.0.1\"},{\"name\":\"bytes\",\"req\":\"^1.2.0\"},{\"name\":\"cfg-if\",\"req\":\"^1.0.0\"},{\"default_features\":false,\"features\":[\"std\",\"clock\"],\"name\":\"chrono\",\"optional\":true,\"req\":\"^0.4.34\"},{\"name\":\"crc\",\"optional\":true,\"req\":\"^3\"},{\"name\":\"crossbeam-queue\",\"req\":\"^0.3.2\"},{\"name\":\"either\",\"req\":\"^1.6.1\"},{\"name\":\"event-listener\",\"req\":\"^5.2.0\"},{\"default_features\":false,\"name\":\"futures-core\",\"req\":\"^0.3.32\"},{\"name\":\"futures-intrusive\",\"req\":\"^0.5.0\"},{\"name\":\"futures-io\",\"req\":\"^0.3.32\"},{\"default_features\":false,\"features\":[\"alloc\",\"sink\",\"io\"],\"name\":\"futures-util\",\"req\":\"^0.3.32\"},{\"name\":\"hashbrown\",\"req\":\"^0.16.0\"},{\"name\":\"hashlink\",\"req\":\"^0.11.0\"},{\"name\":\"indexmap\",\"req\":\"^2.0\"},{\"name\":\"ipnet\",\"optional\":true,\"req\":\"^2.3.0\"},{\"name\":\"ipnetwork\",\"optional\":true,\"req\":\"^0.21.1\"},{\"default_features\":false,\"name\":\"log\",\"req\":\"^0.4.18\"},{\"name\":\"mac_address\",\"optional\":true,\"req\":\"^1.1.5\"},{\"default_features\":false,\"name\":\"memchr\",\"req\":\"^2.5.0\"},{\"name\":\"native-tls\",\"optional\":true,\"req\":\"^0.2.10\"},{\"name\":\"percent-encoding\",\"req\":\"^2.3.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"rust_decimal\",\"optional\":true,\"req\":\"^1.36.0\"},{\"default_features\":false,\"features\":[\"std\",\"tls12\"],\"name\":\"rustls\",\"optional\":true,\"req\":\"^0.23.24\"},{\"name\":\"rustls-native-certs\",\"optional\":true,\"req\":\"^0.8.0\"},{\"features\":[\"derive\",\"rc\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.219\"},{\"features\":[\"raw_value\"],\"name\":\"serde_json\",\"optional\":true,\"req\":\"^1.0.142\"},{\"default_features\":false,\"name\":\"sha2\",\"optional\":true,\"req\":\"^0.10.0\"},{\"name\":\"smallvec\",\"req\":\"^1.13.1\"},{\"default_features\":false,\"name\":\"smol\",\"optional\":true,\"req\":\"^2.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"thiserror\",\"req\":\"^2.0.18\"},{\"features\":[\"formatting\",\"parsing\",\"macros\"],\"name\":\"time\",\"optional\":true,\"req\":\"^0.3.47\"},{\"default_features\":false,\"features\":[\"time\",\"net\",\"sync\",\"fs\",\"io-util\",\"rt\"],\"name\":\"tokio\",\"optional\":true,\"req\":\"^1.25.0\"},{\"features\":[\"rt\"],\"kind\":\"dev\",\"name\":\"tokio\",\"req\":\"^1.25.0\"},{\"features\":[\"fs\"],\"name\":\"tokio-stream\",\"optional\":true,\"req\":\"^0.1.8\"},{\"name\":\"toml\",\"optional\":true,\"req\":\"^0.8.16\"},{\"features\":[\"log\"],\"name\":\"tracing\",\"req\":\"^0.1.37\"},{\"name\":\"url\",\"req\":\"^2.2.2\"},{\"name\":\"uuid\",\"optional\":true,\"req\":\"^1.12.1\"},{\"name\":\"webpki-roots\",\"optional\":true,\"req\":\"^1\"}],\"features\":{\"_rt-async-global-executor\":[\"async-global-executor\",\"_rt-async-io\",\"_rt-async-task\"],\"_rt-async-io\":[\"async-io\",\"async-fs\"],\"_rt-async-std\":[\"async-std\",\"_rt-async-io\"],\"_rt-async-task\":[\"async-task\"],\"_rt-smol\":[\"smol\",\"_rt-async-io\",\"_rt-async-task\"],\"_rt-tokio\":[\"tokio\",\"tokio-stream\"],\"_tls-native-tls\":[\"native-tls\"],\"_tls-none\":[],\"_tls-rustls\":[\"rustls\"],\"_tls-rustls-aws-lc-rs\":[\"_tls-rustls\",\"rustls/aws-lc-rs\",\"webpki-roots\"],\"_tls-rustls-ring-native-roots\":[\"_tls-rustls\",\"rustls/ring\",\"rustls-native-certs\"],\"_tls-rustls-ring-webpki\":[\"_tls-rustls\",\"rustls/ring\",\"webpki-roots\"],\"_unstable-doc\":[\"sqlx-toml\"],\"any\":[],\"default\":[],\"json\":[\"serde\",\"serde_json\"],\"migrate\":[\"sha2\",\"crc\"],\"offline\":[\"serde\",\"either/serde\"],\"sqlx-toml\":[\"serde\",\"toml/parse\"]}}",
"sqlx-macros-core_0.9.0": "{\"dependencies\":[{\"default_features\":false,\"features\":[\"async-io\"],\"name\":\"async-global-executor\",\"optional\":true,\"req\":\"^3.1\"},{\"name\":\"async-std\",\"optional\":true,\"req\":\"^1.13\"},{\"name\":\"cfg-if\",\"req\":\"^1.0.0\"},{\"default_features\":false,\"name\":\"dotenvy\",\"req\":\"^0.15.7\"},{\"name\":\"either\",\"req\":\"^1.6.1\"},{\"name\":\"heck\",\"req\":\"^0.5\"},{\"name\":\"hex\",\"req\":\"^0.4.3\"},{\"default_features\":false,\"name\":\"proc-macro2\",\"req\":\"^1.0.83\"},{\"default_features\":false,\"name\":\"quote\",\"req\":\"^1.0.35\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"req\":\"^1.0.219\"},{\"name\":\"serde_json\",\"req\":\"^1.0.142\"},{\"name\":\"sha2\",\"req\":\"^0.10.0\"},{\"default_features\":false,\"name\":\"smol\",\"optional\":true,\"req\":\"^2.0\"},{\"features\":[\"offline\"],\"name\":\"sqlx-core\",\"req\":\"=0.9.0\"},{\"default_features\":false,\"features\":[\"offline\",\"migrate\"],\"name\":\"sqlx-mysql\",\"optional\":true,\"req\":\"=0.9.0\"},{\"features\":[\"offline\",\"migrate\"],\"name\":\"sqlx-postgres\",\"optional\":true,\"req\":\"=0.9.0\"},{\"features\":[\"offline\",\"migrate\"],\"name\":\"sqlx-sqlite\",\"optional\":true,\"req\":\"=0.9.0\"},{\"default_features\":false,\"features\":[\"full\",\"derive\",\"parsing\",\"printing\",\"clone-impls\"],\"name\":\"syn\",\"req\":\"^2.0.87\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"thiserror\",\"optional\":true,\"req\":\"^2.0.18\"},{\"default_features\":false,\"features\":[\"time\",\"net\",\"sync\",\"fs\",\"io-util\",\"rt\"],\"name\":\"tokio\",\"optional\":true,\"req\":\"^1.25.0\"},{\"name\":\"url\",\"req\":\"^2.2.2\"}],\"features\":{\"_rt-async-global-executor\":[\"async-global-executor\",\"sqlx-core/_rt-async-global-executor\"],\"_rt-async-std\":[\"async-std\",\"sqlx-core/_rt-async-std\"],\"_rt-smol\":[\"smol\",\"sqlx-core/_rt-smol\"],\"_rt-tokio\":[\"tokio\",\"sqlx-core/_rt-tokio\"],\"_sqlite\":[],\"_tls-native-tls\":[\"sqlx-core/_tls-native-tls\"],\"_tls-rustls-aws-lc-rs\":[\"sqlx-core/_tls-rustls-aws-lc-rs\"],\"_tls-rustls-ring-native-roots\":[\"sqlx-core/_tls-rustls-ring-native-roots\"],\"_tls-rustls-ring-webpki\":[\"sqlx-core/_tls-rustls-ring-webpki\"],\"bigdecimal\":[\"sqlx-core/bigdecimal\",\"sqlx-mysql?/bigdecimal\",\"sqlx-postgres?/bigdecimal\"],\"bit-vec\":[\"sqlx-core/bit-vec\",\"sqlx-postgres?/bit-vec\"],\"chrono\":[\"sqlx-core/chrono\",\"sqlx-mysql?/chrono\",\"sqlx-postgres?/chrono\",\"sqlx-sqlite?/chrono\"],\"default\":[],\"derive\":[],\"ipnet\":[\"sqlx-core/ipnet\",\"sqlx-postgres?/ipnet\"],\"ipnetwork\":[\"sqlx-core/ipnetwork\",\"sqlx-postgres?/ipnetwork\"],\"json\":[\"sqlx-core/json\",\"sqlx-mysql?/json\",\"sqlx-postgres?/json\",\"sqlx-sqlite?/json\"],\"mac_address\":[\"sqlx-core/mac_address\",\"sqlx-postgres?/mac_address\"],\"macros\":[\"thiserror\"],\"migrate\":[\"sqlx-core/migrate\"],\"mysql\":[\"sqlx-mysql\"],\"mysql-rsa\":[\"mysql\",\"sqlx-mysql/rsa\"],\"postgres\":[\"sqlx-postgres\"],\"rust_decimal\":[\"sqlx-core/rust_decimal\",\"sqlx-mysql?/rust_decimal\",\"sqlx-postgres?/rust_decimal\"],\"sqlite\":[\"_sqlite\",\"sqlx-sqlite/bundled\"],\"sqlite-load-extension\":[\"sqlx-sqlite/load-extension\"],\"sqlite-unbundled\":[\"_sqlite\",\"sqlx-sqlite/unbundled\"],\"sqlx-toml\":[\"sqlx-core/sqlx-toml\",\"sqlx-sqlite?/sqlx-toml\"],\"time\":[\"sqlx-core/time\",\"sqlx-mysql?/time\",\"sqlx-postgres?/time\",\"sqlx-sqlite?/time\"],\"uuid\":[\"sqlx-core/uuid\",\"sqlx-mysql?/uuid\",\"sqlx-postgres?/uuid\",\"sqlx-sqlite?/uuid\"]}}",
"sqlx-macros_0.9.0": "{\"dependencies\":[{\"default_features\":false,\"name\":\"proc-macro2\",\"req\":\"^1.0.83\"},{\"default_features\":false,\"name\":\"quote\",\"req\":\"^1.0.35\"},{\"features\":[\"any\"],\"name\":\"sqlx-core\",\"req\":\"=0.9.0\"},{\"name\":\"sqlx-macros-core\",\"req\":\"=0.9.0\"},{\"default_features\":false,\"features\":[\"parsing\",\"proc-macro\"],\"name\":\"syn\",\"req\":\"^2.0.87\"}],\"features\":{\"_rt-async-global-executor\":[\"sqlx-macros-core/_rt-async-global-executor\"],\"_rt-async-std\":[\"sqlx-macros-core/_rt-async-std\"],\"_rt-smol\":[\"sqlx-macros-core/_rt-smol\"],\"_rt-tokio\":[\"sqlx-macros-core/_rt-tokio\"],\"_tls-native-tls\":[\"sqlx-macros-core/_tls-native-tls\"],\"_tls-rustls-aws-lc-rs\":[\"sqlx-macros-core/_tls-rustls-aws-lc-rs\"],\"_tls-rustls-ring-native-roots\":[\"sqlx-macros-core/_tls-rustls-ring-native-roots\"],\"_tls-rustls-ring-webpki\":[\"sqlx-macros-core/_tls-rustls-ring-webpki\"],\"bigdecimal\":[\"sqlx-macros-core/bigdecimal\"],\"bit-vec\":[\"sqlx-macros-core/bit-vec\"],\"chrono\":[\"sqlx-macros-core/chrono\"],\"default\":[],\"derive\":[\"sqlx-macros-core/derive\"],\"ipnet\":[\"sqlx-macros-core/ipnet\"],\"ipnetwork\":[\"sqlx-macros-core/ipnetwork\"],\"json\":[\"sqlx-macros-core/json\"],\"mac_address\":[\"sqlx-macros-core/mac_address\"],\"macros\":[\"sqlx-macros-core/macros\"],\"migrate\":[\"sqlx-macros-core/migrate\"],\"mysql\":[\"sqlx-macros-core/mysql\"],\"mysql-rsa\":[\"sqlx-macros-core/mysql-rsa\"],\"postgres\":[\"sqlx-macros-core/postgres\"],\"rust_decimal\":[\"sqlx-macros-core/rust_decimal\"],\"sqlite\":[\"sqlx-macros-core/sqlite\"],\"sqlite-load-extension\":[\"sqlx-macros-core/sqlite-load-extension\"],\"sqlite-unbundled\":[\"sqlx-macros-core/sqlite-unbundled\"],\"sqlx-toml\":[\"sqlx-macros-core/sqlx-toml\"],\"time\":[\"sqlx-macros-core/time\"],\"uuid\":[\"sqlx-macros-core/uuid\"]}}",
"sqlx-mysql_0.9.0": "{\"dependencies\":[{\"name\":\"bigdecimal\",\"optional\":true,\"req\":\"^0.4.0\"},{\"default_features\":false,\"name\":\"bitflags\",\"req\":\"^2.4\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"byteorder\",\"req\":\"^1.4.3\"},{\"name\":\"bytes\",\"req\":\"^1.2.0\"},{\"default_features\":false,\"features\":[\"std\",\"clock\"],\"name\":\"chrono\",\"optional\":true,\"req\":\"^0.4.34\"},{\"name\":\"crc\",\"optional\":true,\"req\":\"^3.0.0\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"digest\",\"req\":\"^0.11.2\"},{\"default_features\":false,\"name\":\"dotenvy\",\"req\":\"^0.15.7\"},{\"name\":\"either\",\"req\":\"^1.6.1\"},{\"default_features\":false,\"name\":\"futures-core\",\"req\":\"^0.3.32\"},{\"default_features\":false,\"features\":[\"alloc\",\"sink\",\"io\"],\"name\":\"futures-util\",\"req\":\"^0.3.32\"},{\"default_features\":false,\"name\":\"generic-array\",\"req\":\"^0.14.4\"},{\"name\":\"log\",\"req\":\"^0.4.18\"},{\"name\":\"percent-encoding\",\"req\":\"^2.3.0\"},{\"default_features\":false,\"features\":[\"thread_rng\"],\"name\":\"rand\",\"optional\":true,\"req\":\"^0.10.1\"},{\"name\":\"rsa\",\"optional\":true,\"req\":\"^0.10.0-rc.18\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"rust_decimal\",\"optional\":true,\"req\":\"^1.36.0\"},{\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.219\"},{\"default_features\":false,\"name\":\"sha1\",\"req\":\"^0.11.0\"},{\"default_features\":false,\"name\":\"sha2\",\"req\":\"^0.11.0\"},{\"name\":\"sqlx-core\",\"req\":\"=0.9.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"thiserror\",\"req\":\"^2.0.18\"},{\"features\":[\"formatting\",\"parsing\",\"macros\"],\"name\":\"time\",\"optional\":true,\"req\":\"^0.3.47\"},{\"features\":[\"log\"],\"name\":\"tracing\",\"req\":\"^0.1.37\"},{\"name\":\"uuid\",\"optional\":true,\"req\":\"^1.12.1\"}],\"features\":{\"any\":[\"sqlx-core/any\"],\"bigdecimal\":[\"dep:bigdecimal\",\"sqlx-core/bigdecimal\"],\"chrono\":[\"dep:chrono\",\"sqlx-core/chrono\"],\"default\":[],\"json\":[\"sqlx-core/json\",\"serde\"],\"migrate\":[\"sqlx-core/migrate\",\"dep:crc\"],\"offline\":[\"sqlx-core/offline\",\"serde/derive\",\"bitflags/serde\"],\"rsa\":[\"dep:rand\",\"dep:rsa\"],\"rust_decimal\":[\"dep:rust_decimal\",\"rust_decimal/maths\",\"sqlx-core/rust_decimal\"],\"time\":[\"dep:time\",\"sqlx-core/time\"],\"uuid\":[\"dep:uuid\",\"sqlx-core/uuid\"]}}",
"sqlx-postgres_0.9.0": "{\"dependencies\":[{\"name\":\"atoi\",\"req\":\"^2.0\"},{\"default_features\":false,\"features\":[\"alloc\"],\"name\":\"base64\",\"req\":\"^0.22.1\"},{\"name\":\"bigdecimal\",\"optional\":true,\"req\":\"^0.4.0\"},{\"name\":\"bit-vec\",\"optional\":true,\"req\":\"^0.8\"},{\"default_features\":false,\"name\":\"bitflags\",\"req\":\"^2.4\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"byteorder\",\"req\":\"^1.4.3\"},{\"default_features\":false,\"features\":[\"std\",\"clock\"],\"name\":\"chrono\",\"optional\":true,\"req\":\"^0.4.34\"},{\"name\":\"crc\",\"optional\":true,\"req\":\"^3.0.0\"},{\"default_features\":false,\"name\":\"dotenvy\",\"req\":\"^0.15.7\"},{\"name\":\"etcetera\",\"req\":\"^0.11.0\",\"target\":\"cfg(target_os = \\\"windows\\\")\"},{\"default_features\":false,\"features\":[\"sink\",\"alloc\",\"std\"],\"name\":\"futures-channel\",\"req\":\"^0.3.32\"},{\"default_features\":false,\"name\":\"futures-core\",\"req\":\"^0.3.32\"},{\"default_features\":false,\"features\":[\"alloc\",\"sink\",\"io\"],\"name\":\"futures-util\",\"req\":\"^0.3.32\"},{\"name\":\"hex\",\"req\":\"^0.4.3\"},{\"name\":\"hkdf\",\"req\":\"^0.13.0\"},{\"default_features\":false,\"name\":\"hmac\",\"req\":\"^0.13.0\"},{\"name\":\"ipnet\",\"optional\":true,\"req\":\"^2.3.0\"},{\"name\":\"ipnetwork\",\"optional\":true,\"req\":\"^0.21.1\"},{\"name\":\"itoa\",\"req\":\"^1.0.5\"},{\"name\":\"log\",\"req\":\"^0.4.18\"},{\"name\":\"mac_address\",\"optional\":true,\"req\":\"^1.1.5\"},{\"default_features\":false,\"name\":\"md-5\",\"req\":\"^0.11.0\"},{\"default_features\":false,\"name\":\"memchr\",\"req\":\"^2.5.0\"},{\"name\":\"num-bigint\",\"optional\":true,\"req\":\"^0.4.3\"},{\"default_features\":false,\"features\":[\"thread_rng\"],\"name\":\"rand\",\"req\":\"^0.10.1\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"rust_decimal\",\"optional\":true,\"req\":\"^1.36.0\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.219\"},{\"features\":[\"raw_value\"],\"name\":\"serde_json\",\"optional\":true,\"req\":\"^1.0.142\"},{\"default_features\":false,\"name\":\"sha2\",\"req\":\"^0.11.0\"},{\"name\":\"smallvec\",\"req\":\"^1.13.1\"},{\"name\":\"sqlx-core\",\"req\":\"=0.9.0\"},{\"name\":\"stringprep\",\"req\":\"^0.1.2\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"thiserror\",\"req\":\"^2.0.18\"},{\"features\":[\"formatting\",\"parsing\",\"macros\"],\"name\":\"time\",\"optional\":true,\"req\":\"^0.3.47\"},{\"features\":[\"log\"],\"name\":\"tracing\",\"req\":\"^0.1.37\"},{\"name\":\"uuid\",\"optional\":true,\"req\":\"^1.12.1\"},{\"default_features\":false,\"name\":\"whoami\",\"req\":\"^2.0.2\"}],\"features\":{\"any\":[\"sqlx-core/any\"],\"bigdecimal\":[\"dep:bigdecimal\",\"dep:num-bigint\",\"sqlx-core/bigdecimal\"],\"bit-vec\":[\"dep:bit-vec\",\"sqlx-core/bit-vec\"],\"chrono\":[\"dep:chrono\",\"sqlx-core/chrono\"],\"ipnet\":[\"dep:ipnet\",\"sqlx-core/ipnet\"],\"ipnetwork\":[\"dep:ipnetwork\",\"sqlx-core/ipnetwork\"],\"json\":[\"dep:serde\",\"dep:serde_json\",\"sqlx-core/json\"],\"mac_address\":[\"dep:mac_address\",\"sqlx-core/mac_address\"],\"migrate\":[\"sqlx-core/migrate\",\"dep:crc\"],\"offline\":[\"json\",\"sqlx-core/offline\",\"smallvec/serde\"],\"rust_decimal\":[\"dep:rust_decimal\",\"rust_decimal/maths\",\"sqlx-core/rust_decimal\"],\"time\":[\"dep:time\",\"sqlx-core/time\"],\"uuid\":[\"dep:uuid\",\"sqlx-core/uuid\"]}}",
"sqlx-sqlite_0.9.0": "{\"dependencies\":[{\"name\":\"atoi\",\"req\":\"^2.0\"},{\"default_features\":false,\"features\":[\"std\",\"clock\"],\"name\":\"chrono\",\"optional\":true,\"req\":\"^0.4.34\"},{\"default_features\":false,\"features\":[\"async\"],\"name\":\"flume\",\"req\":\"^0.12.0\"},{\"name\":\"form_urlencoded\",\"req\":\"^1.2.2\"},{\"default_features\":false,\"features\":[\"sink\",\"alloc\",\"std\"],\"name\":\"futures-channel\",\"req\":\"^0.3.32\"},{\"default_features\":false,\"name\":\"futures-core\",\"req\":\"^0.3.32\"},{\"name\":\"futures-executor\",\"req\":\"^0.3.32\"},{\"name\":\"futures-intrusive\",\"req\":\"^0.5.0\"},{\"default_features\":false,\"features\":[\"alloc\",\"sink\"],\"name\":\"futures-util\",\"req\":\"^0.3.32\"},{\"default_features\":false,\"features\":[\"pkg-config\",\"vcpkg\"],\"name\":\"libsqlite3-sys\",\"req\":\">=0.30.1, <0.38.0\"},{\"name\":\"log\",\"req\":\"^0.4.18\"},{\"name\":\"percent-encoding\",\"req\":\"^2.3.0\"},{\"name\":\"regex\",\"optional\":true,\"req\":\"^1.6.0\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.219\"},{\"name\":\"sqlx-core\",\"req\":\"=0.9.0\"},{\"default_features\":false,\"features\":[\"std\"],\"name\":\"thiserror\",\"req\":\"^2.0.18\"},{\"features\":[\"formatting\",\"parsing\",\"macros\"],\"name\":\"time\",\"optional\":true,\"req\":\"^0.3.47\"},{\"features\":[\"log\"],\"name\":\"tracing\",\"req\":\"^0.1.37\"},{\"name\":\"url\",\"req\":\"^2.2.2\"},{\"name\":\"uuid\",\"optional\":true,\"req\":\"^1.12.1\"}],\"features\":{\"_unstable-all-sqlite-features\":[\"deserialize\",\"load-extension\",\"preupdate-hook\",\"unlock-notify\"],\"_unstable-all-types\":[\"json\",\"chrono\",\"time\",\"uuid\"],\"_unstable-docs\":[\"bundled\",\"any\",\"_unstable-all-types\",\"_unstable-all-sqlite-features\"],\"any\":[\"sqlx-core/any\"],\"bigdecimal\":[],\"bundled\":[\"libsqlite3-sys/bundled\"],\"chrono\":[\"dep:chrono\",\"sqlx-core/chrono\"],\"deserialize\":[],\"json\":[\"sqlx-core/json\",\"serde\"],\"load-extension\":[],\"migrate\":[\"sqlx-core/migrate\"],\"offline\":[\"sqlx-core/offline\",\"serde\"],\"preupdate-hook\":[\"libsqlite3-sys/preupdate_hook\"],\"regexp\":[\"dep:regex\"],\"rust_decimal\":[],\"sqlx-toml\":[\"sqlx-core/sqlx-toml\"],\"time\":[\"dep:time\",\"sqlx-core/time\"],\"unbundled\":[\"libsqlite3-sys/buildtime_bindgen\"],\"unlock-notify\":[\"libsqlite3-sys/unlock_notify\"],\"uuid\":[\"dep:uuid\",\"sqlx-core/uuid\"]}}",
"sqlx_0.9.0": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"anyhow\",\"req\":\"^1.0.58\"},{\"features\":[\"attributes\"],\"kind\":\"dev\",\"name\":\"async-std\",\"req\":\"^1.13\"},{\"features\":[\"async_tokio\"],\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.5.1\"},{\"kind\":\"dev\",\"name\":\"dotenvy\",\"req\":\"^0.15.7\"},{\"kind\":\"dev\",\"name\":\"env_logger\",\"req\":\"^0.11\"},{\"default_features\":false,\"features\":[\"alloc\"],\"kind\":\"dev\",\"name\":\"futures-util\",\"req\":\"^0.3.32\"},{\"kind\":\"dev\",\"name\":\"hex\",\"req\":\"^0.4.3\"},{\"kind\":\"dev\",\"name\":\"libsqlite3-sys\",\"req\":\"^0.37.0\"},{\"features\":[\"bundled-sqlcipher\"],\"kind\":\"dev\",\"name\":\"libsqlite3-sys\",\"req\":\"^0.37.0\",\"target\":\"cfg(sqlite_test_sqlcipher)\"},{\"kind\":\"dev\",\"name\":\"paste\",\"req\":\"^1.0.6\"},{\"default_features\":false,\"features\":[\"thread_rng\"],\"kind\":\"dev\",\"name\":\"rand\",\"req\":\"^0.10.1\"},{\"features\":[\"derive\"],\"kind\":\"dev\",\"name\":\"serde\",\"req\":\"^1.0.219\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.142\"},{\"features\":[\"migrate\"],\"name\":\"sqlx-core\",\"req\":\"=0.9.0\"},{\"name\":\"sqlx-macros\",\"optional\":true,\"req\":\"=0.9.0\"},{\"default_features\":false,\"name\":\"sqlx-mysql\",\"optional\":true,\"req\":\"=0.9.0\"},{\"name\":\"sqlx-postgres\",\"optional\":true,\"req\":\"=0.9.0\"},{\"name\":\"sqlx-sqlite\",\"optional\":true,\"req\":\"=0.9.0\"},{\"kind\":\"dev\",\"name\":\"tempfile\",\"req\":\"^3.10.1\"},{\"kind\":\"dev\",\"name\":\"time_\",\"package\":\"time\",\"req\":\"^0.3.47\"},{\"features\":[\"full\"],\"kind\":\"dev\",\"name\":\"tokio\",\"req\":\"^1.25.0\"},{\"kind\":\"dev\",\"name\":\"trybuild\",\"req\":\"^1.0.53\"},{\"kind\":\"dev\",\"name\":\"url\",\"req\":\"^2.2.2\"}],\"features\":{\"_rt-async-global-executor\":[],\"_rt-async-std\":[],\"_rt-smol\":[],\"_rt-tokio\":[],\"_sqlite\":[],\"_unstable-all-types\":[\"bigdecimal\",\"rust_decimal\",\"json\",\"time\",\"chrono\",\"ipnet\",\"ipnetwork\",\"mac_address\",\"uuid\",\"bit-vec\",\"bstr\"],\"_unstable-docs\":[\"all-databases\",\"_unstable-all-types\",\"sqlx-sqlite/_unstable-docs\"],\"all-databases\":[\"mysql\",\"sqlite\",\"postgres\",\"any\"],\"any\":[\"sqlx-core/any\",\"sqlx-mysql?/any\",\"sqlx-postgres?/any\",\"sqlx-sqlite?/any\"],\"bigdecimal\":[\"sqlx-core/bigdecimal\",\"sqlx-macros?/bigdecimal\",\"sqlx-mysql?/bigdecimal\",\"sqlx-postgres?/bigdecimal\"],\"bit-vec\":[\"sqlx-core/bit-vec\",\"sqlx-macros?/bit-vec\",\"sqlx-postgres?/bit-vec\"],\"bstr\":[\"sqlx-core/bstr\"],\"chrono\":[\"sqlx-core/chrono\",\"sqlx-macros?/chrono\",\"sqlx-mysql?/chrono\",\"sqlx-postgres?/chrono\",\"sqlx-sqlite?/chrono\"],\"default\":[\"any\",\"macros\",\"migrate\",\"json\"],\"derive\":[\"sqlx-macros/derive\"],\"ipnet\":[\"sqlx-core/ipnet\",\"sqlx-macros?/ipnet\",\"sqlx-postgres?/ipnet\"],\"ipnetwork\":[\"sqlx-core/ipnetwork\",\"sqlx-macros?/ipnetwork\",\"sqlx-postgres?/ipnetwork\"],\"json\":[\"sqlx-core/json\",\"sqlx-macros?/json\",\"sqlx-mysql?/json\",\"sqlx-postgres?/json\",\"sqlx-sqlite?/json\"],\"mac_address\":[\"sqlx-core/mac_address\",\"sqlx-macros?/mac_address\",\"sqlx-postgres?/mac_address\"],\"macros\":[\"derive\",\"sqlx-macros/macros\",\"sqlx-core/offline\",\"sqlx-mysql?/offline\",\"sqlx-postgres?/offline\",\"sqlx-sqlite?/offline\"],\"migrate\":[\"sqlx-core/migrate\",\"sqlx-macros?/migrate\",\"sqlx-mysql?/migrate\",\"sqlx-postgres?/migrate\",\"sqlx-sqlite?/migrate\"],\"mysql\":[\"sqlx-mysql\",\"sqlx-macros?/mysql\"],\"mysql-rsa\":[\"mysql\",\"sqlx-mysql/rsa\",\"sqlx-macros?/mysql-rsa\"],\"postgres\":[\"sqlx-postgres\",\"sqlx-macros?/postgres\"],\"regexp\":[\"sqlx-sqlite?/regexp\"],\"runtime-async-global-executor\":[\"_rt-async-global-executor\",\"sqlx-core/_rt-async-global-executor\",\"sqlx-macros?/_rt-async-global-executor\"],\"runtime-async-std\":[\"_rt-async-std\",\"sqlx-core/_rt-async-std\",\"sqlx-macros?/_rt-async-std\"],\"runtime-smol\":[\"_rt-smol\",\"sqlx-core/_rt-smol\",\"sqlx-macros?/_rt-smol\"],\"runtime-tokio\":[\"_rt-tokio\",\"sqlx-core/_rt-tokio\",\"sqlx-macros?/_rt-tokio\"],\"rust_decimal\":[\"sqlx-core/rust_decimal\",\"sqlx-macros?/rust_decimal\",\"sqlx-mysql?/rust_decimal\",\"sqlx-postgres?/rust_decimal\"],\"sqlite\":[\"sqlite-bundled\",\"sqlite-deserialize\",\"sqlite-load-extension\",\"sqlite-unlock-notify\"],\"sqlite-bundled\":[\"_sqlite\",\"sqlx-sqlite/bundled\",\"sqlx-macros?/sqlite\"],\"sqlite-deserialize\":[\"sqlx-sqlite/deserialize\"],\"sqlite-load-extension\":[\"sqlx-sqlite/load-extension\",\"sqlx-macros?/sqlite-load-extension\"],\"sqlite-preupdate-hook\":[\"sqlx-sqlite/preupdate-hook\"],\"sqlite-unbundled\":[\"_sqlite\",\"sqlx-sqlite/unbundled\",\"sqlx-macros?/sqlite-unbundled\"],\"sqlite-unlock-notify\":[\"sqlx-sqlite/unlock-notify\"],\"sqlx-toml\":[\"sqlx-core/sqlx-toml\",\"sqlx-macros?/sqlx-toml\",\"sqlx-sqlite?/sqlx-toml\"],\"time\":[\"sqlx-core/time\",\"sqlx-macros?/time\",\"sqlx-mysql?/time\",\"sqlx-postgres?/time\",\"sqlx-sqlite?/time\Line truncated
"sse-stream_0.2.5": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"anyhow\",\"req\":\"^1\"},{\"features\":[\"tracing\"],\"kind\":\"dev\",\"name\":\"axum\",\"req\":\"^0.8\"},{\"name\":\"bytes\",\"req\":\"^1\"},{\"name\":\"futures-util\",\"req\":\"^0.3\"},{\"name\":\"http-body\",\"req\":\"^1\"},{\"name\":\"http-body-util\",\"req\":\"^0.1\"},{\"features\":[\"client\",\"http1\"],\"kind\":\"dev\",\"name\":\"hyper\",\"req\":\"^1\"},{\"features\":[\"tokio\"],\"kind\":\"dev\",\"name\":\"hyper-util\",\"req\":\"^0.1\"},{\"name\":\"pin-project-lite\",\"req\":\"^0.2\"},{\"features\":[\"stream\"],\"kind\":\"dev\",\"name\":\"reqwest\",\"req\":\"^0.12\"},{\"features\":[\"derive\"],\"kind\":\"dev\",\"name\":\"serde\",\"req\":\"^1\"},{\"features\":[\"full\"],\"kind\":\"dev\",\"name\":\"tokio\",\"req\":\"^1\"},{\"features\":[\"io\"],\"kind\":\"dev\",\"name\":\"tokio-util\",\"req\":\"^0.7\"},{\"name\":\"tracing\",\"optional\":true,\"req\":\"^0.1\"},{\"kind\":\"dev\",\"name\":\"tracing\",\"req\":\"^0.1\"},{\"features\":[\"env-filter\",\"std\",\"fmt\"],\"kind\":\"dev\",\"name\":\"tracing-subscriber\",\"req\":\"^0.3\"}],\"features\":{\"default\":[],\"tracing\":[\"dep:tracing\"]}}",
"stable_deref_trait_1.2.1": "{\"dependencies\":[],\"features\":{\"alloc\":[],\"default\":[\"std\"],\"std\":[\"alloc\"]}}",
@@ -2132,8 +2136,10 @@
"tikv-jemalloc-sys_0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8": "{\"dependencies\":[{\"kind\":\"build\",\"name\":\"cc\",\"req\":\"^1.0.13\"},{\"default_features\":false,\"name\":\"libc\",\"req\":\"^0.2.8\"}],\"features\":{\"background_threads\":[\"background_threads_runtime_support\"],\"background_threads_runtime_support\":[],\"debug\":[],\"default\":[\"background_threads_runtime_support\"],\"disable_cache_oblivious\":[],\"disable_initial_exec_tls\":[],\"override_allocator_on_supported_platforms\":[\"unprefixed_malloc_on_supported_platforms\"],\"profiling\":[],\"profiling_libunwind\":[\"profiling\"],\"stats\":[],\"unprefixed_malloc_on_supported_platforms\":[]}}",
"tikv-jemallocator_0.7.0": "{\"dependencies\":[{\"default_features\":false,\"name\":\"libc\",\"req\":\"^0.2.8\"},{\"kind\":\"dev\",\"name\":\"paste\",\"req\":\"^1\"},{\"default_features\":false,\"name\":\"tikv-jemalloc-sys\",\"req\":\"^0.7.0\"}],\"features\":{\"alloc_trait\":[],\"background_threads\":[\"tikv-jemalloc-sys/background_threads\"],\"background_threads_runtime_support\":[\"tikv-jemalloc-sys/background_threads_runtime_support\"],\"debug\":[\"tikv-jemalloc-sys/debug\"],\"default\":[\"background_threads_runtime_support\"],\"disable_cache_oblivious\":[\"tikv-jemalloc-sys/disable_cache_oblivious\"],\"disable_initial_exec_tls\":[\"tikv-jemalloc-sys/disable_initial_exec_tls\"],\"override_allocator_on_supported_platforms\":[\"unprefixed_malloc_on_supported_platforms\",\"tikv-jemalloc-sys/override_allocator_on_supported_platforms\"],\"profiling\":[\"tikv-jemalloc-sys/profiling\"],\"profiling_libunwind\":[\"tikv-jemalloc-sys/profiling_libunwind\",\"profiling\"],\"stats\":[\"tikv-jemalloc-sys/stats\"],\"unprefixed_malloc_on_supported_platforms\":[\"tikv-jemalloc-sys/unprefixed_malloc_on_supported_platforms\"]}}",
"time-core_0.1.8": "{\"dependencies\":[],\"features\":{\"large-dates\":[]}}",
"time-macros_0.2.27": "{\"dependencies\":[{\"name\":\"num-conv\",\"req\":\"^0.2.0\"},{\"name\":\"time-core\",\"req\":\"=0.1.8\"}],\"features\":{\"formatting\":[],\"large-dates\":[],\"parsing\":[],\"serde\":[]}}",
"time-core_0.1.9": "{\"dependencies\":[],\"features\":{\"large-dates\":[]}}",
"time-macros_0.2.32": "{\"dependencies\":[{\"name\":\"num-conv\",\"req\":\"^0.2.2\"},{\"name\":\"time-core\",\"req\":\"=0.1.9\"}],\"features\":{\"formatting\":[],\"large-dates\":[],\"parsing\":[],\"serde\":[]}}",
"time_0.3.47": "{\"dependencies\":[{\"default_features\":false,\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.8.1\",\"target\":\"cfg(bench)\"},{\"features\":[\"powerfmt\"],\"name\":\"deranged\",\"req\":\"^0.5.2\"},{\"name\":\"itoa\",\"optional\":true,\"req\":\"^1.0.1\"},{\"name\":\"js-sys\",\"optional\":true,\"req\":\"^0.3.58\",\"target\":\"cfg(all(target_family = \\\"wasm\\\", not(any(target_os = \\\"emscripten\\\", target_os = \\\"wasi\\\"))))\"},{\"name\":\"libc\",\"optional\":true,\"req\":\"^0.2.98\",\"target\":\"cfg(target_family = \\\"unix\\\")\"},{\"name\":\"num-conv\",\"req\":\"^0.2.0\"},{\"kind\":\"dev\",\"name\":\"num-conv\",\"req\":\"^0.2.0\"},{\"name\":\"num_threads\",\"optional\":true,\"req\":\"^0.1.2\",\"target\":\"cfg(target_family = \\\"unix\\\")\"},{\"default_features\":false,\"name\":\"powerfmt\",\"req\":\"^0.2.0\"},{\"default_features\":false,\"name\":\"quickcheck\",\"optional\":true,\"req\":\"^1.0.3\"},{\"kind\":\"dev\",\"name\":\"quickcheck_macros\",\"req\":\"^1.0.0\"},{\"default_features\":false,\"name\":\"rand08\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"rand08\",\"package\":\"rand\",\"req\":\"^0.8.4\"},{\"default_features\":false,\"name\":\"rand09\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.9.2\"},{\"default_features\":false,\"features\":[\"small_rng\"],\"kind\":\"dev\",\"name\":\"rand09\",\"package\":\"rand\",\"req\":\"^0.9.2\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"rstest\",\"req\":\"^0.26.1\"},{\"kind\":\"dev\",\"name\":\"rstest_reuse\",\"req\":\"^0.7.0\"},{\"default_features\":false,\"features\":[\"derive\"],\"kind\":\"dev\",\"name\":\"serde\",\"req\":\"^1.0.184\"},{\"default_features\":false,\"name\":\"serde_core\",\"optional\":true,\"req\":\"^1.0.220\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.68\"},{\"kind\":\"dev\",\"name\":\"serde_test\",\"req\":\"^1.0.126\"},{\"name\":\"time-core\",\"req\":\"=0.1.8\"},{\"name\":\"time-macros\",\"optional\":true,\"req\":\"=0.2.27\"},{\"kind\":\"dev\",\"name\":\"time-macros\",\"req\":\"=0.2.27\"},{\"kind\":\"dev\",\"name\":\"trybuild\",\"req\":\"^1.0.102\",\"target\":\"cfg(__ui_tests)\"}],\"features\":{\"alloc\":[\"serde_core?/alloc\"],\"default\":[\"std\"],\"formatting\":[\"dep:itoa\",\"std\",\"time-macros?/formatting\"],\"large-dates\":[\"time-core/large-dates\",\"time-macros?/large-dates\"],\"local-offset\":[\"std\",\"dep:libc\",\"dep:num_threads\"],\"macros\":[\"dep:time-macros\"],\"parsing\":[\"time-macros?/parsing\"],\"quickcheck\":[\"dep:quickcheck\",\"alloc\",\"deranged/quickcheck\"],\"rand\":[\"rand08\",\"rand09\"],\"rand08\":[\"dep:rand08\",\"deranged/rand08\"],\"rand09\":[\"dep:rand09\",\"deranged/rand09\"],\"serde\":[\"dep:serde_core\",\"time-macros?/serde\",\"deranged/serde\"],\"serde-human-readable\":[\"serde\",\"formatting\",\"parsing\"],\"serde-well-known\":[\"serde\",\"formatting\",\"parsing\"],\"std\":[\"alloc\"],\"wasm-bindgen\":[\"dep:js-sys\"]}}",
"time_0.3.55": "{\"dependencies\":[{\"default_features\":false,\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.8.1\",\"target\":\"cfg(bench)\"},{\"name\":\"deranged\",\"req\":\"^0.5.8\"},{\"name\":\"js-sys\",\"optional\":true,\"req\":\"^0.3.58\",\"target\":\"cfg(all(target_family = \\\"wasm\\\", not(any(target_os = \\\"emscripten\\\", target_os = \\\"wasi\\\"))))\"},{\"name\":\"libc\",\"optional\":true,\"req\":\"^0.2.98\",\"target\":\"cfg(target_family = \\\"unix\\\")\"},{\"name\":\"num-conv\",\"req\":\"^0.2.2\"},{\"kind\":\"dev\",\"name\":\"num-conv\",\"req\":\"^0.2.2\"},{\"name\":\"num_threads\",\"optional\":true,\"req\":\"^0.1.2\",\"target\":\"cfg(target_family = \\\"unix\\\")\"},{\"default_features\":false,\"name\":\"powerfmt\",\"req\":\"^0.2.0\"},{\"default_features\":false,\"name\":\"quickcheck\",\"optional\":true,\"req\":\"^1.0.3\"},{\"kind\":\"dev\",\"name\":\"quickcheck_macros\",\"req\":\"^1.0.0\"},{\"default_features\":false,\"name\":\"rand010\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.10.1\"},{\"default_features\":false,\"name\":\"rand08\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.8.6\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"rand08\",\"package\":\"rand\",\"req\":\"^0.8.6\"},{\"default_features\":false,\"name\":\"rand09\",\"optional\":true,\"package\":\"rand\",\"req\":\"^0.9.4\"},{\"default_features\":false,\"features\":[\"small_rng\"],\"kind\":\"dev\",\"name\":\"rand09\",\"package\":\"rand\",\"req\":\"^0.9.4\"},{\"default_features\":false,\"kind\":\"dev\",\"name\":\"rstest\",\"req\":\"^0.26.1\"},{\"kind\":\"dev\",\"name\":\"rstest_reuse\",\"req\":\"^0.7.0\"},{\"default_features\":false,\"features\":[\"derive\",\"alloc\"],\"kind\":\"dev\",\"name\":\"serde\",\"req\":\"^1.0.184\"},{\"default_features\":false,\"name\":\"serde_core\",\"optional\":true,\"req\":\"^1.0.220\"},{\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.68\"},{\"kind\":\"dev\",\"name\":\"serde_test2\",\"req\":\"^2.0.0\"},{\"name\":\"time-core\",\"req\":\"=0.1.9\"},{\"name\":\"time-macros\",\"optional\":true,\"req\":\"=0.2.32\"},{\"kind\":\"dev\",\"name\":\"time-macros\",\"req\":\"=0.2.32\"},{\"kind\":\"dev\",\"name\":\"trybuild\",\"req\":\"^1.0.102\",\"target\":\"cfg(__ui_tests)\"}],\"features\":{\"alloc\":[\"serde_core?/alloc\"],\"default\":[\"std\"],\"formatting\":[\"std\",\"time-macros?/formatting\"],\"large-dates\":[\"time-core/large-dates\",\"time-macros?/large-dates\"],\"local-offset\":[\"std\",\"dep:libc\",\"dep:num_threads\"],\"macros\":[\"dep:time-macros\"],\"parsing\":[\"time-macros?/parsing\"],\"quickcheck\":[\"dep:quickcheck\",\"alloc\",\"deranged/quickcheck\"],\"rand\":[\"rand08\",\"rand09\",\"rand010\"],\"rand010\":[\"dep:rand010\",\"deranged/rand010\"],\"rand08\":[\"dep:rand08\",\"deranged/rand08\"],\"rand09\":[\"dep:rand09\",\"deranged/rand09\"],\"serde\":[\"dep:serde_core\",\"time-macros?/serde\",\"deranged/serde\"],\"serde-human-readable\":[\"serde\",\"formatting\",\"parsing\"],\"serde-well-known\":[\"serde\",\"formatting\",\"parsing\"],\"std\":[\"alloc\"],\"wasm-bindgen\":[\"dep:js-sys\"]}}",
"timezone_provider_0.2.3": "{\"dependencies\":[{\"name\":\"combine\",\"optional\":true,\"req\":\"^4.6.7\"},{\"features\":[\"derive\"],\"name\":\"databake\",\"optional\":true,\"req\":\"^0.2.0\"},{\"features\":[\"compiled_data\"],\"kind\":\"dev\",\"name\":\"icu_time\",\"req\":\"^2\"},{\"name\":\"jiff-tzdb\",\"optional\":true,\"req\":\"^0.1.4\"},{\"features\":[\"derive\"],\"name\":\"serde\",\"optional\":true,\"req\":\"^1.0.225\"},{\"name\":\"serde_json\",\"optional\":true,\"req\":\"^1.0.145\"},{\"features\":[\"zerovec\"],\"name\":\"tinystr\",\"req\":\"^0.8.0\"},{\"name\":\"tzif\",\"optional\":true,\"req\":\"^0.4.0\"},{\"features\":[\"derive\"],\"name\":\"yoke\",\"optional\":true,\"req\":\"^0.8.0\"},{\"name\":\"zerofrom\",\"optional\":true,\"req\":\"^0.1.6\"},{\"name\":\"zerotrie\",\"req\":\"^0.2.0\"},{\"features\":[\"derive\",\"alloc\"],\"name\":\"zerovec\",\"req\":\"^0.11.0\"},{\"name\":\"zoneinfo64\",\"optional\":true,\"req\":\"^0.3.0\"},{\"default_features\":false,\"features\":[\"std\",\"unstable\"],\"name\":\"zoneinfo_rs\",\"optional\":true,\"req\":\"^0.1.0\"}],\"features\":{\"datagen\":[\"std\",\"dep:serde\",\"dep:databake\",\"dep:yoke\",\"dep:serde_json\",\"tinystr/serde\",\"tinystr/databake\",\"zerotrie/serde\",\"zerotrie/databake\",\"zerovec/serde\",\"zerovec/databake\",\"zerovec/derive\",\"dep:zoneinfo_rs\",\"experimental_tzif\"],\"default\":[],\"experimental_tzif\":[\"dep:zerofrom\",\"zerofrom/derive\"],\"std\":[],\"tzif\":[\"dep:tzif\",\"dep:jiff-tzdb\",\"dep:combine\",\"std\"],\"zoneinfo64\":[\"dep:zoneinfo64\"]}}",
"tiny_http_0.12.0": "{\"dependencies\":[{\"name\":\"ascii\",\"req\":\"^1.0\"},{\"name\":\"chunked_transfer\",\"req\":\"^1\"},{\"kind\":\"dev\",\"name\":\"fdlimit\",\"req\":\"^0.1\"},{\"name\":\"httpdate\",\"req\":\"^1.0.2\"},{\"name\":\"log\",\"req\":\"^0.4.4\"},{\"name\":\"openssl\",\"optional\":true,\"req\":\"^0.10\"},{\"kind\":\"dev\",\"name\":\"rustc-serialize\",\"req\":\"^0.3\"},{\"name\":\"rustls\",\"optional\":true,\"req\":\"^0.20\"},{\"name\":\"rustls-pemfile\",\"optional\":true,\"req\":\"^0.2.1\"},{\"kind\":\"dev\",\"name\":\"sha1\",\"req\":\"^0.6.0\"},{\"name\":\"zeroize\",\"optional\":true,\"req\":\"^1\"}],\"features\":{\"default\":[],\"ssl\":[\"ssl-openssl\"],\"ssl-openssl\":[\"openssl\",\"zeroize\"],\"ssl-rustls\":[\"rustls\",\"rustls-pemfile\",\"zeroize\"]}}",
"tinystr_0.8.3": "{\"dependencies\":[{\"kind\":\"dev\",\"name\":\"bincode\",\"req\":\"^1.3.1\"},{\"kind\":\"dev\",\"name\":\"criterion\",\"req\":\"^0.5.0\",\"target\":\"cfg(not(target_arch = \\\"wasm32\\\"))\"},{\"default_features\":false,\"name\":\"databake\",\"optional\":true,\"req\":\"^0.2.0\"},{\"default_features\":false,\"name\":\"displaydoc\",\"req\":\"^0.2.3\"},{\"default_features\":false,\"features\":[\"use-std\"],\"kind\":\"dev\",\"name\":\"postcard\",\"req\":\"^1.0.3\"},{\"features\":[\"small_rng\"],\"kind\":\"dev\",\"name\":\"rand\",\"req\":\"^0.9\"},{\"default_features\":false,\"name\":\"serde_core\",\"optional\":true,\"req\":\"^1.0.220\"},{\"features\":[\"alloc\"],\"kind\":\"dev\",\"name\":\"serde_json\",\"req\":\"^1.0.45\"},{\"default_features\":false,\"name\":\"zerovec\",\"optional\":true,\"req\":\"^0.11.6\"}],\"features\":{\"alloc\":[\"serde_core?/alloc\",\"zerovec?/alloc\"],\"databake\":[\"dep:databake\"],\"default\":[\"alloc\"],\"serde\":[\"dep:serde_core\"],\"std\":[],\"zerovec\":[\"dep:zerovec\"]}}",
@@ -2479,6 +2485,7 @@
"rust-std-1.95.0-powerpc64-unknown-linux-gnu.tar.xz": "cc7fb9aa289ff1756502ae16a05e2885289165f01ed94a7c2db6576b3dae74a6",
"rust-std-1.95.0-powerpc64le-unknown-linux-gnu.tar.xz": "2370d9266051a0b23346d42e43a00f91b2daff22a963fb03e28ae50cb0b76c50",
"rust-std-1.95.0-powerpc64le-unknown-linux-musl.tar.xz": "0362ba4ecfe0bb508f0d2b064c6fbbfe72604d5ae1989d6a8a7b4fe5ff1889f1",
"rust-std-1.95.0-riscv32imac-unknown-none-elf.tar.xz": "09d568f3f445670917ee9aeb3a86374dae760da8a92d4bfecde88af7fe0bd6ad",
"rust-std-1.95.0-riscv32imc-unknown-none-elf.tar.xz": "04befebf3b15372dacb7e6c0fcdab842c17a63ea58bf2f4cdccd7182ae9195c6",
"rust-std-1.95.0-riscv64gc-unknown-linux-gnu.tar.xz": "50fe7869e166bb4c990a0e1664366b1ffdbe669664b7663cd03c079bd0efdcac",
"rust-std-1.95.0-riscv64gc-unknown-linux-musl.tar.xz": "e01bdbf5d6fa3e529671d49e87ba81dc9612101144f3ee5a0e1de3c48f27b47c",
+76
View File
@@ -0,0 +1,76 @@
LOCAL_RUST_BIN := $(CURDIR)/build/toolchain/bin
CARGO ?= $(if $(wildcard $(LOCAL_RUST_BIN)/cargo),$(LOCAL_RUST_BIN)/cargo,cargo)
RUSTC ?= $(if $(wildcard $(LOCAL_RUST_BIN)/rustc),$(LOCAL_RUST_BIN)/rustc,rustc)
ZIRAN ?= ziran
export CARGO_HOME := $(CURDIR)/build/cargo-home
export CARGO_TARGET_DIR := $(CURDIR)/codex-rs/target
export XCODER_RUNTIME_DIR := $(CURDIR)/build/native-runtime
export RUSTC ZIRAN
export CARGO_BUILD_JOBS ?= 1
# `local` (default) skips LTO for fast builds; published releases use `release`.
export XCODER_CARGO_PROFILE ?= local
# UI plugins retain their separate JavaScript sandbox; tool execution is native.
UI_FEATURES ?=
CARGO_FEATURE_FLAGS := $(if $(UI_FEATURES),--features $(UI_FEATURES),)
BACKGROUND_BUILD := python3 scripts/low-priority-build.py
.PHONY: all native-test native-test-build prebuild-tests test runtime-check install
all:
mkdir -p build/bin
$(BACKGROUND_BUILD) $(CARGO) build --manifest-path codex-rs/Cargo.toml --profile $(XCODER_CARGO_PROFILE) -p codex-cli -p codex-code-mode-host $(CARGO_FEATURE_FLAGS)
python3 scripts/package-xcoder.py
native-test-build:
mkdir -p build/native-dispatch
$(ZIRAN) build --project --target=c -o build/native-dispatch native/dispatch.zi
$(CC) -O3 -std=c99 -c build/native-dispatch/dispatch.c -I build/native-dispatch -o build/native-dispatch/dispatch.o
$(AR) rcs build/native-dispatch/libxcoder_dispatch.a build/native-dispatch/dispatch.o
$(BACKGROUND_BUILD) $(RUSTC) --edition=2024 --test tests/native_abi.rs -L build/native-dispatch -l static=xcoder_dispatch -o build/native-dispatch/native-abi-test
$(BACKGROUND_BUILD) $(RUSTC) --edition=2024 --test tests/native_allocator.rs -o build/native-dispatch/native-allocator-test
rm -rf build/native-idle && mkdir -p build/native-idle
$(ZIRAN) build --project --target=c -o build/native-idle native/idle.zi
$(CC) -O3 -std=c99 -c build/native-idle/idle.c -I build/native-idle -o build/native-idle/idle.o
$(AR) rcs build/native-idle/libxcoder_idle.a build/native-idle/idle.o
$(BACKGROUND_BUILD) $(RUSTC) --edition=2024 --test tests/native_idle.rs -L build/native-idle -l static=xcoder_idle -o build/native-dispatch/native-idle-test
native-test: native-test-build
build/native-dispatch/native-abi-test
build/native-dispatch/native-allocator-test
build/native-dispatch/native-idle-test
XCODER_ZIRAN_TOOLCHAIN="$$($(ZIRAN) pkg path ziran)" python3 tests/native_cell_test.py
prebuild-tests: native-test-build
$(BACKGROUND_BUILD) python3 scripts/prebuild-tests.py --cargo "$(CARGO)"
runtime-check:
$(BACKGROUND_BUILD) $(CARGO) check --manifest-path codex-rs/Cargo.toml -p codex-code-mode-runtime
test:
$(BACKGROUND_BUILD) python3 scripts/test-xcoder.py --cargo "$(CARGO)" --ui-features "$(UI_FEATURES)"
install:
python3 scripts/install-xcoder.py
JAVASCRIPT_HOST ?= $(HOME)/.codex/packages/standalone/current/bin/codex-code-mode-host.javascript
JAVASCRIPT_CLI ?= $(HOME)/.codex/packages/standalone/current/bin/codex-upstream
.PHONY: benchmark-source benchmark-plan benchmark-fuzzy benchmark-memory benchmark-apply-patch
benchmark-json:
python3 scripts/benchmark-runtime.py --native-host build/bin/codex-code-mode-host --javascript-host "$(JAVASCRIPT_HOST)" --diagnose-json
benchmark-source:
python3 scripts/benchmark-runtime.py --native-host build/bin/codex-code-mode-host --native-cli build/bin/xcoder --javascript-host "$(JAVASCRIPT_HOST)" --javascript-cli "$(JAVASCRIPT_CLI)" --native-mode source
benchmark-plan:
python3 scripts/benchmark-runtime.py --native-host build/bin/codex-code-mode-host --native-cli build/bin/xcoder --javascript-host "$(JAVASCRIPT_HOST)" --javascript-cli "$(JAVASCRIPT_CLI)" --native-mode plan
# A long offline session: memory per tool call, the idle footprint, and the
# footprint and wake time after the idle release.
benchmark-memory:
python3 scripts/benchmark-memory.py --cli build/bin/xcoder --calls 150 --idle-seconds 5 --release-wait 30 --environment XCODER_IDLE_RELEASE_SECONDS=15 --output build/memory/benchmark.json
benchmark-apply-patch:
$(CARGO) test --manifest-path codex-rs/Cargo.toml --release -p codex-apply-patch --lib -- --ignored --nocapture bench
benchmark-fuzzy:
$(CARGO) run --manifest-path codex-rs/Cargo.toml --release -p codex-utils-fuzzy-match --example fuzzy_bench
.PHONY: mermaid-test
MERMAID_LOCKED := $(if $(wildcard ziran.local.toml),,--locked)
mermaid-test:
$(MAKE) -C "$$($(ZIRAN) pkg path mermaid $(MERMAID_LOCKED))" test ZIRAN="$(ZIRAN)"
$(BACKGROUND_BUILD) $(CARGO) test --manifest-path codex-rs/Cargo.toml -p codex-mermaid --lib
+5
View File
@@ -1,6 +1,11 @@
OpenAI Codex
Copyright 2025 OpenAI
Xcoder fork modifications
Copyright 2026 Waozi <[email protected]>
This fork changes tool orchestration to native Ziran/Zi2c execution with
embedded Rust supervision. The original license and upstream notices remain.
This project includes code derived from [Ratatui](https://github.com/ratatui/ratatui), licensed under the MIT license.
Copyright (c) 2016-2022 Florian Dehau
Copyright (c) 2023-2025 The Ratatui Developers
+75 -10
View File
@@ -1,3 +1,78 @@
## Xcoder
For automatic Linux builds and downloads, see
[Xcoder Linux](https://github.com/waozixyz/xcoder/actions/workflows/xcoder-linux.yml).
Xcoder is Waozi's source fork of OpenAI Codex, under the original Apache 2.0
license. Tool orchestration uses Ziran compiled through Zi2c. Ordinary plans run
through an executor linked into Rust, without a compiler or child process.
Custom Ziran cells compile on a cache miss and reuse private cached executables.
The Rust session
and approval protocols remain the authority for host operations. JavaScript
tool cells have no execution path in this fork. Sessions share the Rust process;
only custom native cells start sandboxed children. Ordinary tool calls do not
start a separate code-mode host. The optional JavaScript UI plugin renderer is
excluded from the default build (`UI_FEATURES=codex-code-mode-runtime/ui` enables
it when the corresponding upstream V8 artifacts are available).
The initial native backend targets Linux with bubblewrap, a C compiler, Rust
1.95 and a built Ziran toolchain. `ziran lock` resolves the pinned toolchain;
local development uses an ignored `ziran.local.toml` override.
The Make targets run Rust work at nice 19 and the lowest best-effort I/O priority, with one
Cargo job by default (set `CARGO_BUILD_JOBS` to use more). They add no memory limit of their
own; run them under a build queue or scope that sizes memory for the machine. Completed
artifacts are reused when a build is resumed.
Run `make test` for Rust/C ABI, Ziran-backed Mermaid and fuzzy-match, native
sandbox, callback, host transport and offline full-CLI local tests. The CLI fixture runs a real shell tool through the
embedded supervisor without contacting an external model service.
`make` builds the CLI at `build/bin/xcoder` with its adjacent tool host.
`make test` writes an installation receipt only after the full local suite passes;
a failed rerun removes the earlier receipt. `make install` verifies the exact binaries and preserves
Harmony's existing launcher, accounts and histories. It replaces the launcher's
Codex executable for new invocations; running sessions are not restarted.
Local interactive launches use the embedded server so an older stock Codex
daemon cannot supply their tool runtime. Explicit remote endpoints keep their
normal behavior.
Update this fork from its source with `make test` and `make install`; the stock
Codex package updater cannot replace the installed native fork.
Prefer a JSON tool plan for ordinary calls:
```json
{"calls":[{"tool":"exec_command","input":{"cmd":"pwd"}}]}
```
Plans validate structure, tool names and freeform input types before execution;
each tool validates its own arguments. Results include the call index and tool
name. Add `"parallel":true` for up to four independent calls at
once. A plan supports up to 128 calls; dependent steps use a later cell or custom
code. This path works without the compiler installed.
Custom native cells import `xcoder/runtime`. `Call(name, json)` returns caller-owned
storage: inspect `Body(*reply)` and release it with `defer Release(*reply)`.
`Text`, `Image`, `Audio`, `Notify`, `Store`, `Load`, `Catalog` and `Yield` provide
output and session state. `CallBatch` runs arrays of `BatchCall` on up to four
explicit threads, then joins them; release each result after use. A native cell has only its executable and callback
socket; the compiler has only its binaries, headers, standard library and cell
sources. Tool errors never fall back to JavaScript.
The custom-cell cache holds at most 64 executables and 256 MiB on disk.
Files default to `~/.local/state/xcoder/runtime/cache`; an explicit
`XCODER_RUNTIME_DIR` keeps its selected location. Cache keys include source,
the runtime API, sandbox/compiler settings, toolchain inputs and the C compiler.
Executables are verified before reuse; corruption triggers recompilation.
`scripts/benchmark-runtime.py --help` describes the offline comparison with
preserved JavaScript binaries. It records raw samples, hashes, CPU time,
process-tree proportional RAM and latency under ignored `backup/runtime-benchmark/`.
Use `--native-mode source` for custom cells and `--native-mode plan` for ordinary
calls. Compilation and sandbox startup are included; model inference is excluded.
The fork retains upstream documentation below.
---
<p align="center"><strong>Codex CLI</strong> is a coding agent from OpenAI that runs locally on your computer.
<p align="center">
<img src="https://github.com/openai/codex/blob/main/.github/codex-cli-splash.png" alt="Codex CLI splash" width="80%" />
@@ -19,22 +94,12 @@ Run the following on Mac or Linux to install Codex CLI:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
```
Run the following on Windows to install Codex CLI:
```shell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
```
The standalone installers download from `https://releases.openai.com/codex` by default and fall back to GitHub Releases if a metadata or asset download is unavailable. To force GitHub Releases, set `CODEX_INSTALLER_USE_RELEASES_OPENAI_COM` to `false` (`0` and `no` are also accepted):
```shell
curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false sh
```
```powershell
$env:CODEX_INSTALLER_USE_RELEASES_OPENAI_COM='false'; irm https://chatgpt.com/codex/install.ps1 | iex
```
Codex CLI can also be installed via the following package managers:
```shell
+11 -5
View File
@@ -16,7 +16,6 @@ _PROFILE_INPUTS = [
"//command_line_option:host_action_env",
"//command_line_option:macos_minimum_os",
"//command_line_option:host_platform",
"//command_line_option:extra_toolchains",
_RUSTC_FLAGS,
_EXEC_RUSTC_FLAGS,
]
@@ -61,11 +60,13 @@ def _release_profile_impl(settings, attr):
# Compatibility with the Cargo musl release: aws-lc jitter can hang.
profile["//command_line_option:copt"] += ["-DDISABLE_CPU_JITTER_ENTROPY"]
elif attr.platform_os == "windows" and "@platforms//os:windows" in HOST_CONSTRAINTS:
# Native MSVC supplies the SDK and host tools for both architectures.
# Build tools run natively with the registered LLVM MSVC toolchain.
profile["//command_line_option:host_platform"] = "//:local_windows_msvc"
profile["//command_line_option:extra_toolchains"] += [
"@local_config_cc//:cc-toolchain-x64_windows",
"@local_config_cc//:cc-toolchain-arm64_windows",
if attr.linux_x86_64_musl:
# Match the Cargo release linker for x86-64 static PIEs.
profile[_RUSTC_FLAGS] += [
"-Cllvm-args=--addrsig",
"-Clink-arg=-Wl,--icf=safe,-z,pack-relative-relocs",
]
return profile
@@ -132,6 +133,7 @@ _runtime_binary_files = rule(
attrs = {
"binary": attr.label(mandatory = True, executable = True, cfg = _release_profile),
"platform_os": attr.string(),
"linux_x86_64_musl": attr.bool(),
"macos_minimum_os": attr.string(),
"_allowlist_function_transition": attr.label(
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
@@ -159,6 +161,10 @@ def release_binary(binary, name = "release", macos_x86_64_minimum_os = "10.12",
_runtime_binary_files(
name = name + "_files",
binary = binary,
linux_x86_64_musl = select({
"@llvm//platforms/config:linux_x86_64_musl": True,
"//conditions:default": False,
}),
platform_os = select({
"@platforms//os:macos": "macos",
"@platforms//os:linux": "linux",
+2 -4
View File
@@ -1,11 +1,9 @@
[advisories]
# Reviewed 2026-07-02. Keep this list in sync with ../deny.toml.
ignore = [
"RUSTSEC-2024-0388", # derivative 2.2.0 via starlark/starlark_syntax; upstream crate is unmaintained
"RUSTSEC-2024-0449", # unsafe-libyaml via serde_yaml in skills, ext/skills, core-plugins, external-agent-migration; remove when migrated off serde_yaml/unsafe-libyaml
"RUSTSEC-2025-0057", # fxhash 0.2.1 via starlark_map/bm25; upstream crate is unmaintained
"RUSTSEC-2024-0436", # paste 1.0.15 via starlark/v8; upstream crate is unmaintained
"RUSTSEC-2023-0089", # atomic-polyfill via postcard/heapless/pagable; upstream crate is unmaintained
"RUSTSEC-2025-0057", # fxhash 0.2.1 via bm25; upstream crate is unmaintained
"RUSTSEC-2024-0436", # paste 1.0.15 via v8; upstream crate is unmaintained
"RUSTSEC-2024-0320", # yaml-rust via syntect; remove when syntect drops or updates it
"RUSTSEC-2025-0141", # bincode via syntect; remove when syntect drops or updates it
"RUSTSEC-2026-0118", # hickory-proto via rama-dns/rama-tcp; remove when rama updates to hickory 0.26.1 or hickory-net
+306 -1726
View File
File diff suppressed because it is too large. Load diff
+42 -39
View File
@@ -20,7 +20,6 @@ members = [
"app-server-client",
"app-server-protocol",
"app-server-protocol-noop-macros",
"app-server-test-client",
"apply-patch",
"arg0",
"feedback",
@@ -34,9 +33,6 @@ members = [
"plugin-host",
"codex-home",
"cloud-config",
"cloud-tasks",
"cloud-tasks-client",
"cloud-tasks-mock-client",
"cli",
"collaboration-mode-templates",
"connectors",
@@ -46,6 +42,7 @@ members = [
"shell-command",
"skills",
"core",
"core-config",
"core-api",
"core-plugin-common",
"core-plugins",
@@ -60,7 +57,6 @@ members = [
"file-system",
"exec-server-protocol",
"exec-server",
"exec-server-cli",
"exec-server/tests/support",
"execpolicy",
"ext/agent",
@@ -86,7 +82,6 @@ members = [
"file-search",
"file-watcher",
"linux-sandbox",
"lmstudio",
"login",
"codex-mcp",
"memories/read",
@@ -95,10 +90,9 @@ members = [
"message-board",
"message-board-mcp",
"model-provider-info",
"mxc-sandbox",
"models-manager",
"network-policy",
"network-proxy",
"ollama",
"process-hardening",
"realtime-webrtc",
"voice-host",
@@ -108,22 +102,18 @@ members = [
"rollout",
"rollout-trace",
"rmcp-client",
"responses-api-proxy",
"runtime-agent-instance",
"response-debug-context",
"sandboxing",
"stdio-to-uds",
"otel",
"otel-trace-websocket",
"tcp-tunnel",
"tui",
"user-verification",
"tools",
"v8-poc",
"websocket-auth",
"websocket-client",
"windows-sandbox-rs/tests/support",
"windows-sandbox-service",
"worktree",
"workload-identity",
"utils/absolute-path",
@@ -144,6 +134,7 @@ members = [
"utils/redacted-string",
"utils/rustls-provider",
"utils/string",
"utils/text-diff",
"utils/cli",
"utils/elapsed",
"utils/sandbox-summary",
@@ -198,7 +189,6 @@ codex-app-server-daemon = { path = "app-server-daemon" }
codex-app-server-client = { path = "app-server-client" }
codex-app-server-protocol = { path = "app-server-protocol" }
codex-app-server-protocol-noop-macros = { path = "app-server-protocol-noop-macros" }
codex-app-server-test-client = { path = "app-server-test-client" }
codex-apply-patch = { path = "apply-patch" }
codex-arg0 = { path = "arg0" }
codex-async-utils = { path = "async-utils" }
@@ -208,8 +198,6 @@ codex-chatgpt = { path = "chatgpt" }
codex-client = { path = "codex-client" }
codex-collaboration-mode-templates = { path = "collaboration-mode-templates" }
codex-cloud-config = { path = "cloud-config" }
codex-cloud-tasks-client = { path = "cloud-tasks-client" }
codex-cloud-tasks-mock-client = { path = "cloud-tasks-mock-client" }
codex-code-mode = { path = "code-mode" }
codex-code-mode-protocol = { path = "code-mode-protocol" }
codex-code-mode-runtime = { path = "code-mode-runtime" }
@@ -228,6 +216,7 @@ codex-message-board-mcp = { path = "message-board-mcp" }
codex-connectors-extension = { path = "ext/connectors" }
codex-context-fragments = { path = "context-fragments" }
codex-core = { path = "core" }
codex-core-config = { path = "core-config" }
codex-core-api = { path = "core-api" }
codex-core-plugin-common = { path = "core-plugin-common" }
codex-core-plugins = { path = "core-plugins" }
@@ -237,7 +226,6 @@ codex-exec = { path = "exec" }
codex-file-system = { path = "file-system" }
codex-exec-server-protocol = { path = "exec-server-protocol" }
codex-exec-server = { path = "exec-server" }
codex-exec-server-cli = { path = "exec-server-cli" }
codex-exec-server-test-support = { path = "exec-server/tests/support" }
codex-execpolicy = { path = "execpolicy" }
codex-extension-api = { path = "ext/extension-api" }
@@ -263,7 +251,6 @@ codex-hooks = { path = "hooks" }
codex-history = { path = "history" }
codex-keyring-store = { path = "keyring-store" }
codex-linux-sandbox = { path = "linux-sandbox" }
codex-lmstudio = { path = "lmstudio" }
codex-login = { path = "login" }
codex-mermaid = { path = "mermaid" }
codex-message-history = { path = "message-history" }
@@ -275,9 +262,8 @@ codex-mcp = { path = "codex-mcp" }
codex-mcp-extension = { path = "ext/mcp" }
codex-model-provider-info = { path = "model-provider-info" }
codex-models-manager = { path = "models-manager" }
codex-mxc-sandbox = { path = "mxc-sandbox" }
codex-network-policy = { path = "network-policy" }
codex-network-proxy = { path = "network-proxy" }
codex-ollama = { path = "ollama" }
codex-otel = { path = "otel" }
codex-otel-trace-websocket = { path = "otel-trace-websocket" }
codex-plugin = { path = "plugin" }
@@ -287,7 +273,6 @@ codex-protocol = { path = "protocol" }
codex-protocol-test-support = { path = "protocol/tests/support" }
codex-prompts = { path = "prompts" }
codex-queue-extension = { path = "ext/queue" }
codex-responses-api-proxy = { path = "responses-api-proxy" }
codex-response-debug-context = { path = "response-debug-context" }
codex-rmcp-client = { path = "rmcp-client" }
codex-rollout = { path = "rollout" }
@@ -304,7 +289,6 @@ codex-terminal-detection = { path = "terminal-detection" }
codex-test-binary-support = { path = "test-binary-support" }
codex-thread-store = { path = "thread-store" }
codex-tools = { path = "tools" }
codex-tcp-tunnel = { path = "tcp-tunnel" }
codex-tui = { path = "tui" }
codex-uds = { path = "uds" }
codex-utils-absolute-path = { path = "utils/absolute-path" }
@@ -335,12 +319,11 @@ codex-worktree = { path = "worktree" }
codex-utils-sleep-inhibitor = { path = "utils/sleep-inhibitor" }
codex-utils-stream-parser = { path = "utils/stream-parser" }
codex-utils-string = { path = "utils/string" }
codex-utils-text-diff = { path = "utils/text-diff" }
codex-utils-template = { path = "utils/template" }
codex-user-verification = { path = "user-verification" }
codex-v8-poc = { path = "v8-poc" }
codex-workload-identity = { path = "workload-identity" }
codex-windows-sandbox = { path = "windows-sandbox-rs" }
codex-windows-sandbox-test-support = { path = "windows-sandbox-rs/tests/support" }
core_test_support = { path = "core/tests/common" }
# External
@@ -354,12 +337,8 @@ assert_matches = "1.5.0"
async-channel = "2.3.1"
async-io = "2.6.0"
async-stream = "0.3.6"
aws-config = "1"
aws-credential-types = "1"
aws-sigv4 = "1"
aws-smithy-runtime-api = { version = "1", features = ["client", "http-1x"] }
aws-smithy-types = { version = "1", features = ["http-body-1-x"] }
aws-types = "1"
axum = { version = "0.8", default-features = false }
base64 = "0.22.1"
bitflags = "2.13.1"
@@ -413,7 +392,7 @@ iana-time-zone = "0.1.64"
icu_decimal = "2.1"
icu_locale_core = "2.1"
icu_provider = { version = "2.1", features = ["sync"] }
ignore = "0.4.23"
ignore = "0.4.30"
image = { version = "^0.25.9", default-features = false }
include_dir = "0.7.4"
indexmap = "2.12.0"
@@ -428,7 +407,8 @@ lazy_static = "1"
libc = "0.2.182"
# Keep SQLx's bundled SQLite on a version containing the WAL-reset corruption fix:
# https://www.sqlite.org/wal.html#the_wal_reset_bug
libsqlite3-sys = { version = "0.37", default-features = false }
# SQLite 3.54 also fixes RUSTSEC-2026-0459 when opening a database with a WAL.
libsqlite3-sys = { version = "0.39.1", default-features = false }
linkify = "0.11"
log = "0.4"
lru = "0.18.2"
@@ -436,7 +416,6 @@ maplit = "1.0.2"
memchr = "2.7.6"
mime_guess = "2.0.5"
multimap = "0.10.0"
mxc-sdk = { git = "https://github.com/microsoft/mxc", rev = "b21120168d70befe12356411423266bfef168446" }
notify = "8.2.0"
nucleo = { git = "https://github.com/helix-editor/nucleo.git", rev = "4253de9faabb4e5c6d81d946a5e35a90f87347ee" }
once_cell = "1.20.2"
@@ -519,7 +498,6 @@ sqlx = { version = "=0.9.0", default-features = false, features = [
sqlx-macros = { version = "=0.9.0", default-features = false, features = ["derive", "migrate"] }
# Preserve the target driver's query-description support without building it on the host.
sqlx-sqlite = { version = "=0.9.0", default-features = false, features = ["offline"] }
starlark = { version = "0.14.2", default-features = false }
strum = "0.27.2"
strum_macros = "0.28.0"
supports-color = "3.0.2"
@@ -554,10 +532,9 @@ tonic = { version = "0.14.3", default-features = false, features = ["channel", "
tonic-prost = "0.14.3"
tree-sitter = "0.25.10"
tree-sitter-bash = "0.25"
tree-sitter-powershell = "=0.26.4"
ts-rs = "11"
tungstenite = { version = "0.27.0", features = ["deflate", "proxy"] }
uds_windows = "1.1.0"
unicode-linebreak = "0.1.5"
unicode-normalization = "0.1.25"
unicode-segmentation = "1.12.0"
unicode-width = "0.2"
@@ -566,12 +543,12 @@ urlencoding = "2.1"
uuid = "1"
v8 = "=152.2.0"
vt100 = "0.16.2"
vtparse = "0.6.2"
walkdir = "2.5.0"
webbrowser = "1.2.2"
which = "8"
whoami = "1.6.1"
wildmatch = "2.6.1"
winapi-util = "0.1.11"
windows-sys = "0.61.2"
winreg = "0.55.0"
# Keep the zip 2.x feature set. In zip 9, `bzip2-rs` selects the bzip2-sys
@@ -591,8 +568,8 @@ zstd = "0.13"
wiremock = "0.6"
zeroize = "1.8.2"
[workspace.lints]
rust = {}
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(codex_bazel)'] }
[workspace.lints.clippy]
await_holding_invalid_type = "deny"
@@ -663,6 +640,28 @@ strip = false
# Balance parallel release code generation against binary size.
codegen-units = 4
# The TUI is a very large crate and can otherwise exhaust constrained builders
# during release code generation. Keep its runtime-independent presentation
# layer cheap to compile while the core remains optimized.
[profile.release.package.codex-tui]
opt-level = 0
codegen-units = 256
# Local builds (`make`; XCODER_CARGO_PROFILE=local): no cross-crate LTO and
# more codegen units, so the final link and the largest crates spread over
# more cores and need far less memory. Published release builds keep the
# `release` profile (XCODER_CARGO_PROFILE=release).
[profile.local]
inherits = "release"
lto = false
codegen-units = 16
debug = false
incremental = true
[profile.local.package.codex-tui]
opt-level = 0
codegen-units = 256
[profile.profiling]
inherits = "release"
debug = "full"
@@ -678,12 +677,16 @@ opt-level = 0
# Uncomment to debug local changes.
# ratatui = { path = "../../ratatui" }
crossterm = { git = "https://github.com/openai-oss-forks/crossterm", rev = "ed1cdab335221515706178d68495bba2aed1924f" }
tokio-tungstenite = { git = "https://github.com/openai-oss-forks/tokio-tungstenite", rev = "0e5b2d73aa18dd9f0a50ee9ff199d5aef7594186" }
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "4fffad30fe373adbdcffab9545e9e9bf4f2fc19f" }
# SQLx 0.9.0 excludes libsqlite3-sys 0.39. Keep its driver and Core traits on
# the same reviewed source until a release includes transact-rs/sqlx#4502.
sqlx-core = { git = "https://github.com/transact-rs/sqlx", rev = "10462fa4414c6c7f1ed1d39bb31678e3b726878c" }
sqlx-sqlite = { git = "https://github.com/transact-rs/sqlx", rev = "10462fa4414c6c7f1ed1d39bb31678e3b726878c" }
tokio-tungstenite = { git = "https://github.com/openai-oss-forks/tokio-tungstenite", rev = "7447c427513cfe685f236e1ac0513c4ea3dd9c0b" }
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "bc589d684755a8c02da0fc7e58d0861cbfc306f1" }
v8 = { git = "https://github.com/openai-oss-forks/rusty_v8.git", rev = "90a65f887a0c0f048f3784afbcb320b373c8a2e0" }
# Uncomment to debug local changes.
# rmcp = { path = "../../rust-sdk/crates/rmcp" }
[patch."ssh://[email protected]/openai-oss-forks/tungstenite-rs.git"]
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "4fffad30fe373adbdcffab9545e9e9bf4f2fc19f" }
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "bc589d684755a8c02da0fc7e58d0861cbfc306f1" }
@@ -25,7 +25,6 @@ pub(crate) fn append_payload(path: &Path, payload: &TrackEventsRequest) -> io::R
fn open_capture_file(path: &Path) -> io::Result<File> {
let mut options = OpenOptions::new();
options.create(true).append(true);
#[cfg(unix)]
{
use std::os::unix::fs::OpenOptionsExt;
options.mode(0o600);
+17
View File
@@ -406,6 +406,23 @@ impl AnalyticsEventsClient {
}
}
/// Give a resumed actor its own queue while preserving the caller's analytics setting.
pub fn for_auth_context(
&self,
auth_manager: Arc<AuthManager>,
base_url: String,
runtime_auth: Option<(RuntimeAuthSlot, RuntimeAuthMode)>,
api_key_headers: HeaderMap,
) -> Self {
Self::new_with_runtime(
auth_manager,
base_url,
Some(self.queue.is_some()),
runtime_auth,
api_key_headers,
)
}
pub fn disabled() -> Self {
Self { queue: None }
}
+4 -2
View File
@@ -155,6 +155,7 @@ fn sample_skill_track_event(thread_id: &str, plugin_id: Option<&str>) -> TrackEv
skill_id: format!("skill-{thread_id}"),
skill_name: "doc".to_string(),
event_params: SkillInvocationEventParams {
turn_trigger: None,
product_client_id: None,
skill_scope: None,
plugin_id: plugin_id.map(str::to_string),
@@ -205,6 +206,7 @@ fn sample_mcp_tool_call_event(thread_id: &str, plugin_id: Option<&str>) -> Track
event_type: "codex_mcp_tool_call_event",
event_params: CodexMcpToolCallEventParams {
base: CodexToolItemEventBase {
turn_trigger: None,
thread_id: thread_id.to_string(),
session_id: format!("session-{thread_id}"),
turn_id: "turn-1".to_string(),
@@ -261,6 +263,7 @@ fn sample_plugin_used_track_event(thread_id: &str, plugin_id: Option<&str>) -> T
TrackEventRequest::PluginUsed(CodexPluginUsedEventRequest {
event_type: "codex_plugin_used",
event_params: CodexPluginUsedMetadata {
turn_trigger: None,
plugin: CodexPluginMetadata {
plugin_id: plugin_id.map(str::to_string),
remote_plugin_id: None,
@@ -324,7 +327,6 @@ fn analytics_destination_uses_explicit_capture_file() {
fs::read_to_string(&capture_path).expect("read capture file"),
""
);
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
@@ -667,6 +669,7 @@ fn sample_thread(thread_id: &str) -> Thread {
extra: None,
session_id: format!("session-{thread_id}"),
forked_from_id: None,
attached_to_thread_id: None,
parent_thread_id: None,
preview: "first prompt".to_string(),
ephemeral: false,
@@ -920,7 +923,6 @@ fn track_response_only_enqueues_analytics_relevant_responses() {
assert!(matches!(receiver.try_recv(), Err(TryRecvError::Empty)));
}
#[cfg(unix)]
#[test]
fn track_response_ignores_unserializable_thread_responses() {
use std::ffi::OsString;
+24 -1
View File
@@ -23,6 +23,7 @@ use crate::facts::PluginState;
use crate::facts::SubAgentThreadStartedInput;
use crate::facts::ThreadInitializationMode;
use crate::facts::TrackEventsContext;
use crate::facts::TurnAnalyticsMetadata;
use crate::facts::TurnStatus;
use crate::facts::TurnSteerRejectionReason;
use crate::facts::TurnSteerResult;
@@ -108,6 +109,8 @@ pub(crate) enum TrackEventRequest {
#[derive(Serialize)]
pub(crate) struct CodexArtifactOperationEventParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) turn_trigger: Option<String>,
pub(crate) thread_id: String,
pub(crate) turn_id: String,
pub(crate) item_id: String,
@@ -136,9 +139,11 @@ pub(crate) fn codex_artifact_operation_event_request(
tracking: TrackEventsContext,
operation: ArtifactOperation,
) -> CodexArtifactOperationEventRequest {
let turn = tracking.turn_metadata.as_deref();
CodexArtifactOperationEventRequest {
event_type: "codex_artifact_operation",
event_params: CodexArtifactOperationEventParams {
turn_trigger: turn.and_then(TurnAnalyticsMetadata::turn_trigger),
thread_id: tracking.thread_id,
turn_id: tracking.turn_id,
item_id: operation.item_id,
@@ -209,6 +214,8 @@ pub(crate) struct SkillInvocationEventRequest {
#[derive(Serialize)]
pub(crate) struct SkillInvocationEventParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) turn_trigger: Option<String>,
pub(crate) product_client_id: Option<String>,
pub(crate) skill_scope: Option<String>,
pub(crate) plugin_id: Option<String>,
@@ -682,6 +689,8 @@ pub(crate) enum ToolEventType {
#[derive(Serialize)]
pub(crate) struct CodexToolItemEventBase {
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) turn_trigger: Option<String>,
pub(crate) thread_id: String,
pub(crate) session_id: String,
pub(crate) turn_id: String,
@@ -719,6 +728,8 @@ pub(crate) struct CodexToolItemEventBase {
#[derive(Serialize)]
pub(crate) struct CodexCuaToolCallStartedEventParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) turn_trigger: Option<String>,
pub(crate) thread_id: String,
pub(crate) session_id: String,
pub(crate) turn_id: String,
@@ -1000,6 +1011,8 @@ pub(crate) struct CodexImageGenerationEventRequest {
#[derive(Serialize)]
pub(crate) struct CodexAppMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) turn_trigger: Option<String>,
pub(crate) connector_id: Option<String>,
pub(crate) thread_id: Option<String>,
pub(crate) turn_id: Option<String>,
@@ -1031,6 +1044,8 @@ pub(crate) struct CodexAppUsedEventRequest {
#[derive(Serialize)]
pub(crate) struct CodexHookRunMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) turn_trigger: Option<String>,
pub(crate) thread_id: Option<String>,
pub(crate) turn_id: Option<String>,
pub(crate) product_client_id: Option<String>,
@@ -1230,6 +1245,8 @@ pub(crate) struct CodexPluginMetadata {
#[derive(Serialize)]
pub(crate) struct CodexPluginUsedMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) turn_trigger: Option<String>,
#[serde(flatten)]
pub(crate) plugin: CodexPluginMetadata,
pub(crate) mcp_server_names: Option<Vec<String>>,
@@ -1340,7 +1357,9 @@ pub(crate) fn codex_app_metadata(
tracking: &TrackEventsContext,
app: AppInvocation,
) -> CodexAppMetadata {
let turn = tracking.turn_metadata.as_deref();
CodexAppMetadata {
turn_trigger: turn.and_then(TurnAnalyticsMetadata::turn_trigger),
connector_id: app.connector_id,
thread_id: Some(tracking.thread_id.clone()),
turn_id: Some(tracking.turn_id.clone()),
@@ -1487,7 +1506,9 @@ pub(crate) fn codex_plugin_used_metadata(
.capability_summary
.as_ref()
.map(|summary| summary.mcp_server_names.clone());
let turn = tracking.turn_metadata.as_deref();
CodexPluginUsedMetadata {
turn_trigger: turn.and_then(TurnAnalyticsMetadata::turn_trigger),
plugin: codex_plugin_metadata_with_product_client_id(
plugin,
tracking.product_client_id.clone(),
@@ -1503,7 +1524,9 @@ pub(crate) fn codex_hook_run_metadata(
tracking: &TrackEventsContext,
hook: HookRunFact,
) -> CodexHookRunMetadata {
let turn = tracking.turn_metadata.as_deref();
CodexHookRunMetadata {
turn_trigger: turn.and_then(TurnAnalyticsMetadata::turn_trigger),
thread_id: Some(tracking.thread_id.clone()),
turn_id: Some(tracking.turn_id.clone()),
product_client_id: Some(tracking.product_client_id.clone()),
@@ -1556,7 +1579,7 @@ pub(crate) fn current_runtime_metadata() -> CodexRuntimeMetadata {
static OS_INFO: LazyLock<os_info::Info> = LazyLock::new(os_info::get);
let os_info = &*OS_INFO;
CodexRuntimeMetadata {
codex_rs_version: env!("CARGO_PKG_VERSION").to_string(),
codex_rs_version: codex_protocol::client_version::reported_client_version().to_string(),
runtime_os: std::env::consts::OS.to_string(),
runtime_os_version: os_info.version().to_string(),
runtime_arch: std::env::consts::ARCH.to_string(),
+19 -10
View File
@@ -110,6 +110,7 @@ use crate::facts::SkillInvocationLocation;
use crate::facts::SkillInvokedInput;
use crate::facts::SubAgentThreadStartedInput;
use crate::facts::ThreadInitializationMode;
use crate::facts::TurnAnalyticsMetadata;
use crate::facts::TurnCodexError;
use crate::facts::TurnCodexErrorFact;
use crate::facts::TurnProfile;
@@ -182,6 +183,7 @@ use std::collections::HashSet;
use std::collections::VecDeque;
use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc;
const MAX_TOOL_RESPONSE_ENTRIES: usize = 256;
const MAX_RECENT_VOICE_SESSION_WINDOWS: usize = 16;
@@ -1056,7 +1058,7 @@ impl AnalyticsReducer {
self.record_tool_event(
&thread_id,
&turn_id,
turn_metadata.root_turn_id(),
Some(turn_metadata.as_ref()),
event,
ToolEventEmission::AwaitResponse,
out,
@@ -1133,7 +1135,7 @@ impl AnalyticsReducer {
self.record_tool_event(
&thread_id,
&turn_id,
turn_metadata.root_turn_id(),
Some(turn_metadata.as_ref()),
event,
ToolEventEmission::AwaitResponse,
out,
@@ -1192,7 +1194,7 @@ impl AnalyticsReducer {
&mut self,
thread_id: &str,
turn_id: &str,
root_turn_id: Option<String>,
turn_metadata: Option<&dyn TurnAnalyticsMetadata>,
mut event: TrackEventRequest,
emission: ToolEventEmission,
out: &mut Vec<TrackEventRequest>,
@@ -1201,7 +1203,8 @@ impl AnalyticsReducer {
out.push(event);
return;
};
base.root_turn_id = root_turn_id;
base.root_turn_id = turn_metadata.and_then(TurnAnalyticsMetadata::root_turn_id);
base.turn_trigger = turn_metadata.and_then(TurnAnalyticsMetadata::turn_trigger);
let state = self
.tool_response_states
.entry((thread_id.to_string(), turn_id.to_string()))
@@ -1489,12 +1492,14 @@ impl AnalyticsReducer {
(skill_id, skill_scope)
}
};
let turn = tracking.turn_metadata.as_deref();
out.push(TrackEventRequest::SkillInvocation(
SkillInvocationEventRequest {
event_type: "skill_invocation",
skill_id,
skill_name: invocation.skill_name.clone(),
event_params: SkillInvocationEventParams {
turn_trigger: turn.and_then(TurnAnalyticsMetadata::turn_trigger),
thread_id: Some(tracking.thread_id.clone()),
turn_id: Some(tracking.turn_id.clone()),
voice_session_id: self
@@ -2120,11 +2125,11 @@ impl AnalyticsReducer {
.get(&(notification.thread_id.clone(), notification.turn_id.clone())),
self.code_mode_cells.get(&notification.thread_id),
);
let root_turn_id = self
let turn_metadata = self
.turns
.get(&notification.turn_id)
.and_then(|turn| turn.resolved_config.as_ref())
.and_then(|config| config.turn_metadata.root_turn_id());
.map(|config| config.turn_metadata.as_ref());
out.push(TrackEventRequest::CuaToolCallStarted(
CodexCuaToolCallStartedEventRequest {
event_type: "codex_cua_tool_call_started",
@@ -2132,7 +2137,10 @@ impl AnalyticsReducer {
thread_id: notification.thread_id,
session_id: thread_metadata.session_id.clone(),
turn_id: notification.turn_id,
root_turn_id,
root_turn_id: turn_metadata
.and_then(TurnAnalyticsMetadata::root_turn_id),
turn_trigger: turn_metadata
.and_then(TurnAnalyticsMetadata::turn_trigger),
item_id: item_id.to_string(),
cell_id: attribution.cell_id,
parent_call_id: attribution.parent_call_id,
@@ -2248,11 +2256,11 @@ impl AnalyticsReducer {
.get(&notification.turn_id)
.and_then(|turn| turn.voice_session_id.clone());
}
let root_turn_id = self
let turn_metadata = self
.turns
.get(&notification.turn_id)
.and_then(|turn| turn.resolved_config.as_ref())
.and_then(|config| config.turn_metadata.root_turn_id());
.map(|config| Arc::clone(&config.turn_metadata));
// Fast collaborator tools can complete before their sampling response.
// Keep the event until that response can supply its originating ID.
let emission = if matches!(
@@ -2266,7 +2274,7 @@ impl AnalyticsReducer {
self.record_tool_event(
&notification.thread_id,
&notification.turn_id,
root_turn_id,
turn_metadata.as_deref(),
event,
emission,
out,
@@ -3469,6 +3477,7 @@ fn tool_item_base(
thread_id: thread_id.to_string(),
session_id: thread_metadata.session_id.clone(),
turn_id: turn_id.to_string(),
turn_trigger: None,
root_turn_id: None,
item_id,
cell_id: None,
@@ -15,6 +15,7 @@ use crate::facts::InvocationType;
use crate::reducer::AnalyticsReducer;
use crate::tests::support::TEST_PRODUCT_CLIENT_ID;
use crate::tests::support::test_tracking_context;
use crate::tests::support::test_turn_metadata;
use pretty_assertions::assert_eq;
use serde_json::json;
@@ -54,7 +55,12 @@ fn app_mentioned_event_serializes_expected_shape() {
#[test]
fn app_used_event_serializes_expected_shape() {
let tracking = test_tracking_context("thread-2", "turn-2");
let mut tracking = test_tracking_context("thread-2", "turn-2");
let mut metadata = test_turn_metadata(/*root_turn_id*/ None);
std::sync::Arc::get_mut(&mut metadata)
.expect("unique metadata")
.turn_trigger = Some("appServer-goal".to_string());
tracking.turn_metadata = Some(metadata);
let event = TrackEventRequest::AppUsed(CodexAppUsedEventRequest {
event_type: "codex_app_used",
event_params: CodexAppUsedMetadata {
@@ -78,6 +84,7 @@ fn app_used_event_serializes_expected_shape() {
json!({
"event_type": "codex_app_used",
"event_params": {
"turn_trigger": "appServer-goal",
"connector_id": "drive",
"thread_id": "thread-2",
"turn_id": "turn-2",
@@ -97,6 +104,14 @@ async fn reducer_ingests_app_facts() {
let mut reducer = AnalyticsReducer::default();
let mut events = Vec::new();
let tracking = test_tracking_context("thread-1", "turn-1");
let mut metadata = test_turn_metadata(/*root_turn_id*/ None);
std::sync::Arc::get_mut(&mut metadata)
.expect("unique metadata")
.turn_trigger = Some("automation_cron_run_now".to_string());
let tracking = crate::facts::TrackEventsContext {
turn_metadata: Some(metadata),
..tracking
};
reducer
.ingest(
@@ -149,6 +164,16 @@ async fn reducer_ingests_app_facts() {
("codex_app_used", Some(TEST_PRODUCT_CLIENT_ID)),
]
);
assert_eq!(
(
mention.event_params.turn_trigger.as_deref(),
usage.event_params.app.turn_trigger.as_deref()
),
(
Some("automation_cron_run_now"),
Some("automation_cron_run_now")
)
);
assert_eq!(
usage.event_params.elicitation_type,
Some(ElicitationType::AuthOrLink)
@@ -83,17 +83,10 @@ fn normalize_path_for_skill_id_repo_root_not_in_skill_path_uses_absolute_path()
/// Foreign paths keep native telemetry spelling without depending on host filesystem lookup.
#[test]
fn normalize_path_for_skill_id_foreign_path_uses_native_spelling() {
let (uri, expected) = if cfg!(windows) {
(
"file:///Users/abc/.codex/skills/doc%20%23/SKILL.md",
"/Users/abc/.codex/skills/doc #/SKILL.md",
)
} else {
(
"file:///C:/Users/abc/.codex/skills/doc%20%23/SKILL.md",
"C:/Users/abc/.codex/skills/doc #/SKILL.md",
)
};
let (uri, expected) = (
"file:///C:/Users/abc/.codex/skills/doc%20%23/SKILL.md",
"C:/Users/abc/.codex/skills/doc #/SKILL.md",
);
let path = normalize_path_for_skill_id(
/*repo_url*/ None,
/*repo_root*/ None,
+154 -144
View File
@@ -105,6 +105,7 @@ fn command_execution_event_serializes_expected_shape() {
model_slug: None,
reasoning_effort: None,
base: CodexToolItemEventBase {
turn_trigger: None,
thread_id: "thread-1".to_string(),
session_id: "session-thread-1".to_string(),
turn_id: "turn-1".to_string(),
@@ -313,149 +314,6 @@ async fn cua_tool_call_lifecycle_requires_a_start_and_deduplicates_replay() {
);
}
#[tokio::test]
async fn item_lifecycle_notifications_publish_command_execution_event() {
let mut reducer = AnalyticsReducer::default();
let mut events = Vec::new();
ingest_review_prerequisites(&mut reducer, &mut events).await;
reducer
.ingest(
AnalyticsFact::Notification(Box::new(sample_turn_started_notification(
"thread-1", "turn-1",
))),
&mut events,
)
.await;
for model in ["invoking-model", "later-model"] {
reducer
.ingest(
AnalyticsFact::Notification(Box::new(ServerNotification::ItemStarted(
ItemStartedNotification::new(
"thread-1".to_string(),
"turn-1".to_string(),
{
let mut item = sample_command_execution_item(
CommandExecutionStatus::InProgress,
/*exit_code*/ None,
/*duration_ms*/ None,
);
if let ThreadItemPayload::CommandExecution { model_context, .. } =
&mut item
{
*model_context =
Some(codex_protocol::items::ModelInvocationContext {
model_slug: model.to_string(),
reasoning_effort: Some("max".to_string()),
});
}
item
},
/*started_at_ms*/ 1_000,
),
))),
&mut events,
)
.await;
}
assert!(
events.is_empty(),
"tool item event should emit on completion"
);
reducer
.ingest(
AnalyticsFact::Notification(Box::new(ServerNotification::ItemCompleted(
ItemCompletedNotification::new(
"thread-1".to_string(),
"turn-1".to_string(),
sample_command_execution_item_with_actions(
CommandExecutionStatus::Completed,
Some(0),
Some(42),
vec![
CommandAction::Read {
command: "cat README.md".to_string(),
name: "README.md".to_string(),
path: test_path_buf("/tmp/README.md").abs().into(),
},
CommandAction::ListFiles {
command: "ls".to_string(),
path: None,
},
CommandAction::Search {
command: "rg TODO".to_string(),
query: Some("TODO".to_string()),
path: None,
},
CommandAction::Unknown {
command: "cargo test".to_string(),
},
],
Some("sample@openai-curated"),
Some("scripts/run.py"),
Some(SandboxType::WindowsMxc),
),
/*started_at_ms*/ None,
/*completed_at_ms*/ 1_045,
),
))),
&mut events,
)
.await;
let payload = serde_json::to_value(&events).expect("serialize events");
assert_eq!(payload.as_array().expect("events array").len(), 1);
assert_eq!(payload[0]["event_params"]["model_slug"], "invoking-model");
assert_eq!(payload[0]["event_params"]["sandbox_backend"], "windows_mxc");
assert_eq!(payload[0]["event_params"]["reasoning_effort"], "max");
assert_eq!(payload[0]["event_type"], "codex_command_execution_event");
assert_eq!(payload[0]["event_params"]["thread_id"], "thread-1");
assert_eq!(payload[0]["event_params"]["session_id"], "session-thread-1");
assert_eq!(payload[0]["event_params"]["turn_id"], "turn-1");
assert_eq!(payload[0]["event_params"]["item_id"], "item-1");
assert_eq!(payload[0]["event_params"]["tool_name"], "shell");
assert_eq!(
payload[0]["event_params"]["plugin_id"],
"sample@openai-curated"
);
assert_eq!(payload[0]["event_params"]["script_path"], "scripts/run.py");
assert_eq!(
payload[0]["event_params"]["command_execution_source"],
"agent"
);
assert_eq!(payload[0]["event_params"]["terminal_status"], "completed");
assert_eq!(
payload[0]["event_params"]["final_approval_outcome"],
"unknown"
);
assert_eq!(
payload[0]["event_params"]["failure_kind"],
serde_json::Value::Null
);
assert_eq!(payload[0]["event_params"]["exit_code"], 0);
assert_eq!(payload[0]["event_params"]["command_total_action_count"], 4);
assert_eq!(payload[0]["event_params"]["command_read_action_count"], 1);
assert_eq!(
payload[0]["event_params"]["command_list_files_action_count"],
1
);
assert_eq!(payload[0]["event_params"]["command_search_action_count"], 1);
assert_eq!(
payload[0]["event_params"]["command_unknown_action_count"],
1
);
assert_eq!(payload[0]["event_params"]["started_at_ms"], 1_000);
assert_eq!(payload[0]["event_params"]["completed_at_ms"], 1_045);
assert_eq!(payload[0]["event_params"]["duration_ms"], 45);
assert_eq!(payload[0]["event_params"]["execution_duration_ms"], 42);
assert_eq!(
payload[0]["event_params"]["app_server_client"]["client_name"],
"codex-tui"
);
assert_eq!(payload[0]["event_params"]["thread_source"], "user");
}
#[tokio::test]
async fn collaborator_tool_events_keep_response_ids_when_completion_races_sampling() {
for response_first in [false, true] {
@@ -771,7 +629,10 @@ async fn mcp_elicitation_classification_survives_turn_completion_and_preserves_c
)
.await;
let turn_metadata = test_turn_metadata(/*root_turn_id*/ None);
let mut turn_metadata = test_turn_metadata(/*root_turn_id*/ None);
std::sync::Arc::get_mut(&mut turn_metadata)
.expect("unique metadata")
.turn_trigger = Some("automation_cron_scheduled".to_string());
reducer
.ingest(
AnalyticsFact::Custom(CustomAnalyticsFact::TurnResolvedConfig(Box::new(
@@ -870,6 +731,12 @@ async fn mcp_elicitation_classification_survives_turn_completion_and_preserves_c
}
let payload = serde_json::to_value(&events).expect("serialize analytics events");
for event in payload.as_array().expect("analytics events array") {
assert_eq!(
event["event_params"]["turn_trigger"],
"automation_cron_scheduled"
);
}
let classifications = payload
.as_array()
.expect("analytics events array")
@@ -1028,3 +895,146 @@ async fn image_generation_events_preserve_transparent_background_metadata() {
assert_eq!(payload["event_params"]["terminal_status"], json!(status));
}
}
#[tokio::test]
async fn item_lifecycle_notifications_publish_command_execution_event() {
let mut reducer = AnalyticsReducer::default();
let mut events = Vec::new();
ingest_review_prerequisites(&mut reducer, &mut events).await;
reducer
.ingest(
AnalyticsFact::Notification(Box::new(sample_turn_started_notification(
"thread-1", "turn-1",
))),
&mut events,
)
.await;
for model in ["invoking-model", "later-model"] {
reducer
.ingest(
AnalyticsFact::Notification(Box::new(ServerNotification::ItemStarted(
ItemStartedNotification::new(
"thread-1".to_string(),
"turn-1".to_string(),
{
let mut item = sample_command_execution_item(
CommandExecutionStatus::InProgress,
/*exit_code*/ None,
/*duration_ms*/ None,
);
if let ThreadItemPayload::CommandExecution { model_context, .. } =
&mut item
{
*model_context =
Some(codex_protocol::items::ModelInvocationContext {
model_slug: model.to_string(),
reasoning_effort: Some("max".to_string()),
});
}
item
},
/*started_at_ms*/ 1_000,
),
))),
&mut events,
)
.await;
}
assert!(
events.is_empty(),
"tool item event should emit on completion"
);
reducer
.ingest(
AnalyticsFact::Notification(Box::new(ServerNotification::ItemCompleted(
ItemCompletedNotification::new(
"thread-1".to_string(),
"turn-1".to_string(),
sample_command_execution_item_with_actions(
CommandExecutionStatus::Completed,
Some(0),
Some(42),
vec![
CommandAction::Read {
command: "cat README.md".to_string(),
name: "README.md".to_string(),
path: test_path_buf("/tmp/README.md").abs().into(),
},
CommandAction::ListFiles {
command: "ls".to_string(),
path: None,
},
CommandAction::Search {
command: "rg TODO".to_string(),
query: Some("TODO".to_string()),
path: None,
},
CommandAction::Unknown {
command: "cargo test".to_string(),
},
],
Some("sample@openai-curated"),
Some("scripts/run.py"),
Some(SandboxType::LinuxSeccomp),
),
/*started_at_ms*/ None,
/*completed_at_ms*/ 1_045,
),
))),
&mut events,
)
.await;
let payload = serde_json::to_value(&events).expect("serialize events");
assert_eq!(payload.as_array().expect("events array").len(), 1);
assert_eq!(payload[0]["event_params"]["model_slug"], "invoking-model");
assert_eq!(payload[0]["event_params"]["sandbox_backend"], "seccomp");
assert_eq!(payload[0]["event_params"]["reasoning_effort"], "max");
assert_eq!(payload[0]["event_type"], "codex_command_execution_event");
assert_eq!(payload[0]["event_params"]["thread_id"], "thread-1");
assert_eq!(payload[0]["event_params"]["session_id"], "session-thread-1");
assert_eq!(payload[0]["event_params"]["turn_id"], "turn-1");
assert_eq!(payload[0]["event_params"]["item_id"], "item-1");
assert_eq!(payload[0]["event_params"]["tool_name"], "shell");
assert_eq!(
payload[0]["event_params"]["plugin_id"],
"sample@openai-curated"
);
assert_eq!(payload[0]["event_params"]["script_path"], "scripts/run.py");
assert_eq!(
payload[0]["event_params"]["command_execution_source"],
"agent"
);
assert_eq!(payload[0]["event_params"]["terminal_status"], "completed");
assert_eq!(
payload[0]["event_params"]["final_approval_outcome"],
"unknown"
);
assert_eq!(
payload[0]["event_params"]["failure_kind"],
serde_json::Value::Null
);
assert_eq!(payload[0]["event_params"]["exit_code"], 0);
assert_eq!(payload[0]["event_params"]["command_total_action_count"], 4);
assert_eq!(payload[0]["event_params"]["command_read_action_count"], 1);
assert_eq!(
payload[0]["event_params"]["command_list_files_action_count"],
1
);
assert_eq!(payload[0]["event_params"]["command_search_action_count"], 1);
assert_eq!(
payload[0]["event_params"]["command_unknown_action_count"],
1
);
assert_eq!(payload[0]["event_params"]["started_at_ms"], 1_000);
assert_eq!(payload[0]["event_params"]["completed_at_ms"], 1_045);
assert_eq!(payload[0]["event_params"]["duration_ms"], 45);
assert_eq!(payload[0]["event_params"]["execution_duration_ms"], 42);
assert_eq!(
payload[0]["event_params"]["app_server_client"]["client_name"],
"codex-tui"
);
assert_eq!(payload[0]["event_params"]["thread_source"], "user");
}
+4 -1
View File
@@ -64,6 +64,7 @@ pub(super) const TEST_PRODUCT_CLIENT_ID: &str = "codex_work_desktop";
pub(super) struct TestTurnMetadata {
pub(super) root_turn_id: Mutex<Option<String>>,
pub(super) turn_trigger: Option<String>,
}
impl TurnAnalyticsMetadata for TestTurnMetadata {
@@ -72,7 +73,7 @@ impl TurnAnalyticsMetadata for TestTurnMetadata {
}
fn turn_trigger(&self) -> Option<String> {
None
self.turn_trigger.clone()
}
fn codex_turn_source(&self) -> Option<String> {
@@ -83,6 +84,7 @@ impl TurnAnalyticsMetadata for TestTurnMetadata {
pub(super) fn test_turn_metadata(root_turn_id: Option<&str>) -> Arc<TestTurnMetadata> {
Arc::new(TestTurnMetadata {
root_turn_id: Mutex::new(root_turn_id.map(str::to_string)),
turn_trigger: None,
})
}
@@ -110,6 +112,7 @@ pub(super) fn sample_thread_with_metadata(
extra: None,
session_id: format!("session-{thread_id}"),
forked_from_id: None,
attached_to_thread_id: None,
parent_thread_id,
preview: "first prompt".to_string(),
ephemeral,
+2
View File
@@ -19,6 +19,7 @@ codex-app-server-transport = { workspace = true }
codex-arg0 = { workspace = true }
codex-cloud-client = { path = "../cloud-client" }
codex-config = { workspace = true }
codex-login = { workspace = true }
codex-core = { workspace = true }
codex-exec-server = { workspace = true }
codex-feedback = { workspace = true }
@@ -42,3 +43,4 @@ pretty_assertions = { workspace = true }
serde_json = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
wiremock = { workspace = true }
+171 -2
View File
@@ -3,12 +3,21 @@
use crate::AppServerEvent;
use crate::RequestResult;
use crate::TypedRequestError;
use codex_app_server_protocol::ClientNotification;
use codex_app_server_protocol::ClientRequest;
use codex_app_server_protocol::JSONRPCErrorError;
use codex_app_server_protocol::ModelListParams;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::Result as JsonRpcResult;
use codex_app_server_protocol::Turn;
use codex_app_server_protocol::TurnStartParams;
use std::collections::HashMap;
use std::io;
use std::sync::Arc;
use std::sync::Mutex;
use std::sync::MutexGuard;
use std::sync::PoisonError;
use tokio::sync::mpsc;
use tokio::sync::oneshot;
@@ -16,6 +25,13 @@ use tokio::sync::oneshot;
/// Unsupported operations must return an explicit error; they must not claim success.
pub enum CloudOperation {
Request(Box<ClientRequest>),
/// Host project metadata stays on the private transport, outside the app-server wire.
StartProjectThread {
request_id: RequestId,
params: Box<codex_app_server_protocol::ThreadStartParams>,
project: codex_cloud_client::ProjectEnvironment,
},
SubmitUserMessage(Box<TurnStartParams>),
Notify(ClientNotification),
Resolve {
request_id: RequestId,
@@ -28,6 +44,15 @@ pub enum CloudOperation {
Shutdown,
}
/// One server-decided admission, not completion. A duplicate carries identity
/// only; read history or observe the reply stream before inferring its status.
#[derive(serde::Serialize, serde::Deserialize)]
pub enum CloudUserMessageReceipt {
Started(Turn),
Steered(Turn),
Duplicate { turn_id: Option<String> },
}
/// An operation and its single response. Dropping a caller does not undo admission;
/// cloud workers must not retry mutations when the receiver has gone away.
pub struct CloudCommand {
@@ -38,9 +63,57 @@ pub struct CloudCommand {
#[derive(Clone)]
pub struct CloudRequestHandle {
commands: mpsc::Sender<CloudCommand>,
catalog: Option<Arc<codex_cloud_client::Client>>,
}
/// Tracks only losses queued for delivery. The worker remains the sole owner
/// of the active attachment. A successful replacement supersedes earlier losses
/// for that conversation, even if the replacement itself later ends.
#[derive(Clone, Default)]
pub(super) struct CloudStreamLosses(Arc<Mutex<HashMap<String, PendingLosses>>>);
#[derive(Default)]
struct PendingLosses {
remaining: usize,
superseded: usize,
}
impl CloudStreamLosses {
fn pending(&self) -> MutexGuard<'_, HashMap<String, PendingLosses>> {
self.0.lock().unwrap_or_else(PoisonError::into_inner)
}
pub(super) fn record(&self, thread_id: &str) {
self.pending()
.entry(thread_id.to_owned())
.or_default()
.remaining += 1;
}
pub(super) fn supersede(&self, thread_id: &str) {
if let Some(losses) = self.pending().get_mut(thread_id) {
losses.superseded = losses.remaining;
}
}
fn should_deliver(&self, thread_id: &str) -> bool {
let mut pending = self.pending();
let Some(losses) = pending.get_mut(thread_id) else {
return true;
};
// A single worker sends losses in the same order as it records them.
let deliver = losses.superseded == 0;
losses.superseded = losses.superseded.saturating_sub(1);
losses.remaining -= 1;
if losses.remaining == 0 {
pending.remove(thread_id);
}
deliver
}
}
pub struct CloudClient {
pub(super) stream_losses: CloudStreamLosses,
handle: CloudRequestHandle,
events: mpsc::UnboundedReceiver<AppServerEvent>,
}
@@ -55,12 +128,27 @@ impl CloudClient {
Self,
mpsc::Receiver<CloudCommand>,
mpsc::UnboundedSender<AppServerEvent>,
) {
Self::channel_with_catalog(capacity, /*catalog*/ None)
}
pub(super) fn channel_with_catalog(
capacity: usize,
catalog: Option<codex_cloud_client::Client>,
) -> (
Self,
mpsc::Receiver<CloudCommand>,
mpsc::UnboundedSender<AppServerEvent>,
) {
let (commands, receiver) = mpsc::channel(capacity.max(1));
let (events, event_receiver) = mpsc::unbounded_channel();
(
Self {
handle: CloudRequestHandle { commands },
stream_losses: CloudStreamLosses::default(),
handle: CloudRequestHandle {
commands,
catalog: catalog.map(Arc::new),
},
events: event_receiver,
},
receiver,
@@ -73,7 +161,15 @@ impl CloudClient {
}
pub(crate) async fn next_event(&mut self) -> Option<AppServerEvent> {
self.events.recv().await
while let Some(event) = self.events.recv().await {
if let AppServerEvent::ThreadStreamDisconnected(error) = &event
&& !self.stream_losses.should_deliver(&error.thread_id)
{
continue;
}
return Some(event);
}
None
}
pub(crate) async fn request(&self, request: ClientRequest) -> io::Result<RequestResult> {
@@ -111,6 +207,73 @@ impl CloudClient {
}
impl CloudRequestHandle {
/// Whether a completed model read still belongs to the bound Cloud account.
pub fn model_catalog_is_current(&self) -> bool {
self.catalog
.as_ref()
.is_none_or(|catalog| catalog.model_catalog_is_current())
}
async fn model_list(
catalog: &codex_cloud_client::Client,
params: &ModelListParams,
) -> RequestResult {
if params.model_provider.is_some() {
return Err(JSONRPCErrorError {
code: -32602,
message: "Cloud model discovery uses the server's model provider.".into(),
data: None,
});
}
let result = async {
let body = catalog
.list_models(
params.cursor.as_deref(),
params.limit,
params.include_hidden,
)
.await
.map_err(|error| error.to_string())?;
if !catalog.model_catalog_is_current() {
return Err("Cloud model catalog account changed.".into());
}
serde_json::from_slice(&body)
.map_err(|_| "Invalid Cloud model catalog response.".into())
}
.await;
result.map_err(|message| JSONRPCErrorError {
code: -32000,
message,
data: None,
})
}
pub(crate) async fn start_project_thread(
&self,
request_id: RequestId,
params: codex_app_server_protocol::ThreadStartParams,
project: codex_cloud_client::ProjectEnvironment,
) -> io::Result<RequestResult> {
self.send(CloudOperation::StartProjectThread {
request_id,
params: Box::new(params),
project,
})
.await
}
/// Submit once with a stable message ID and saved thread settings. The server
/// starts or steers; an error can mean admission is unknown. Never auto-resend.
pub async fn submit_user_message(
&self,
params: TurnStartParams,
) -> Result<CloudUserMessageReceipt, TypedRequestError> {
let response = self
.send(CloudOperation::SubmitUserMessage(Box::new(params)))
.await;
crate::decode_typed_response("cloud/submitUserMessage", response)
}
async fn send(&self, operation: CloudOperation) -> io::Result<RequestResult> {
let (response, result) = oneshot::channel();
self.commands
@@ -136,6 +299,12 @@ impl CloudRequestHandle {
}
pub(crate) async fn request(&self, request: ClientRequest) -> io::Result<RequestResult> {
// Catalog reads must not occupy the serialized send and attachment lane.
if let (Some(catalog), ClientRequest::ModelList { params, .. }) = (&self.catalog, &request)
{
// Keep the catalog HTTP state out of the shared request future.
return Ok(Box::pin(Self::model_list(catalog, params)).await);
}
self.send(CloudOperation::Request(Box::new(request))).await
}
@@ -0,0 +1,54 @@
//! Opens the internal Cloud preview with the selected ChatGPT credentials and local transport policy.
use super::start_worker;
use crate::AppServerClient;
use crate::legacy_core::config::Config;
use codex_app_server_protocol as protocol;
use codex_cloud_client as cloud;
use codex_login::token_data::parse_jwt_expiration;
use codex_protocol::account::PlanType;
use color_eyre::eyre::Result;
use color_eyre::eyre::bail;
use color_eyre::eyre::eyre;
const ORIGIN: &str = "https://codex-cloud-backend.chatgpt.com";
pub async fn connect(config: &Config) -> Result<AppServerClient> {
// The preview borrows Local's policy without owning credential updates.
let factory = config.http_client_factory();
let policy = factory.network_policy().clone().for_current_account();
let factory = factory.with_network_policy(policy);
let auth = config
.auth_config()
.load_auth(/*enable_codex_api_key_env*/ false)
.await?
.ok_or_else(|| eyre!("Sign in with ChatGPT and reopen Codex to use Cloud."))?;
if !auth.is_chatgpt_auth() || auth.is_fedramp_account() {
bail!("This account is not supported by the cloud conversation preview.");
}
let account_id = auth
.get_account_id()
.ok_or_else(|| eyre!("Cloud requires a selected account."))?;
let token = auth.get_token()?;
if let Ok(Some(expires)) = parse_jwt_expiration(&token)
&& std::time::SystemTime::from(expires) <= std::time::SystemTime::now()
{
bail!("Your ChatGPT credential expired. Reopen Codex to reconnect.");
}
factory.network_policy().acquire(&ORIGIN.parse()?)?;
let credentials = cloud::Credentials::new(&token, &account_id)?;
let client = cloud::Client::new(&factory, ORIGIN, credentials)?;
Ok(start_worker(
client,
protocol::GetAccountResponse {
user_id: auth.get_chatgpt_user_id(),
account: Some(protocol::Account::Chatgpt {
email: auth.get_account_email(),
plan_type: auth.account_plan_type().unwrap_or(PlanType::Unknown),
workspace_name: None,
}),
requires_openai_auth: true,
workspace_routing: None,
},
))
}
@@ -5,6 +5,147 @@
use super::*;
use futures::stream;
use pretty_assertions::assert_eq;
use wiremock::Mock;
use wiremock::MockServer;
use wiremock::ResponseTemplate;
use wiremock::matchers::method;
use wiremock::matchers::path;
#[tokio::test]
async fn failed_archive_loaded_list_tracks_attachment_not_cached_metadata() -> Result<()> {
let server = MockServer::start().await;
let home = tempfile::tempdir()?;
let config = crate::legacy_core::config::ConfigBuilder::default()
.codex_home(home.path().to_owned())
.fallback_cwd(Some(home.path().to_owned()))
.without_project_context()
.build()
.await?;
let cached = Box::new(serde_json::from_value::<protocol::ThreadResumeResponse>(
serde_json::json!({
"thread": {
"id": "t", "sessionId": "t", "preview": "", "ephemeral": false,
"modelProvider": "openai", "createdAt": 0, "updatedAt": 0,
"status": {"type": "idle"}, "cwd": home.path(), "cliVersion": "",
"source": "cli", "turns": [],
},
"model": "test", "modelProvider": "openai", "cwd": home.path(),
"approvalPolicy": "never", "approvalsReviewer": "user",
"sandbox": {"type": "readOnly"},
}),
)?);
let mut requests = requests::Requests {
client: cloud::Client::new(
&config.http_client_factory(),
&server.uri(),
cloud::Credentials::new("synthetic-bearer", "synthetic-account")?,
)?,
account: protocol::GetAccountResponse {
user_id: None,
account: None,
requires_openai_auth: true,
workspace_routing: None,
},
loaded: Some(cached.clone()),
warned_partial_history: None,
};
let (output, mut notifications) = mpsc::unbounded_channel();
let (sender, stream) = futures::channel::mpsc::unbounded();
let mut replies = Replies::default();
replies
.replace("t", async { Ok(stream.boxed()) }, &output)
.await?;
Mock::given(method("POST"))
.and(path(
"/oaiproto.codex_app_server_backend.ThreadService/ArchiveThread",
))
.respond_with(ResponseTemplate::new(503))
.expect(2)
.mount(&server)
.await;
// A rejection before shutdown must preserve both this attachment and an
// unrelated attachment when the rejected archive targets another thread.
for id in ["t", "other"] {
assert!(
handle_request(
protocol::ClientRequest::ThreadArchive {
request_id: protocol::RequestId::Integer(1),
params: protocol::ThreadArchiveParams {
thread_id: id.into(),
},
},
cloud::SubmissionMode::StartIfIdle,
/*project*/ None,
&mut requests,
&mut replies,
&output,
)
.await
.is_err()
);
let loaded = handle_request(
protocol::ClientRequest::ThreadLoadedList {
request_id: protocol::RequestId::Integer(2),
params: Default::default(),
},
cloud::SubmissionMode::StartIfIdle,
/*project*/ None,
&mut requests,
&mut replies,
&output,
)
.await?;
assert_eq!(
loaded,
serde_json::json!({"data": ["t"], "nextCursor": null})
);
replies.admit_turn("t", &output)?;
assert!(notifications.try_recv().is_err());
}
// Model a late archive failure winning while_listening's biased select
// when Attach's EOF is also ready. No worker poll has observed the EOF yet.
drop(sender);
let failed: Result<()> = replies
.while_listening(
async { Err(eyre!("archive failed after shutdown")) },
&output,
)
.await;
assert!(failed.is_err());
assert!(replies.active.is_some());
// The first query must notice EOF itself; the second sees an already
// observed disconnect. Neither may use the cached resume response.
for _ in 0..2 {
let loaded = handle_request(
protocol::ClientRequest::ThreadLoadedList {
request_id: protocol::RequestId::Integer(3),
params: Default::default(),
},
cloud::SubmissionMode::StartIfIdle,
/*project*/ None,
&mut requests,
&mut replies,
&output,
)
.await?;
assert_eq!(loaded, serde_json::json!({"data": [], "nextCursor": null}));
assert_eq!(requests.loaded.as_ref(), Some(&cached));
}
let AppServerEvent::ThreadStreamDisconnected(error) = notifications.try_recv()? else {
panic!("expected the existing stream-loss recovery notification");
};
assert_eq!(
*error,
cloud_error(
"t",
"Cloud stream ended. Reopen the conversation to reconnect."
)
);
assert!(notifications.try_recv().is_err());
Ok(())
}
#[tokio::test]
async fn failed_replacement_keeps_old_thread_until_new_attachment_succeeds() -> Result<()> {
@@ -44,19 +185,62 @@ async fn failed_replacement_keeps_old_thread_until_new_attachment_succeeds() ->
let _ = close.send(());
assert!(replies.admit_turn("new", &output).is_err());
let AppServerEvent::ServerNotification(notification) = notifications.try_recv()? else {
let AppServerEvent::ThreadStreamDisconnected(notification) = notifications.try_recv()? else {
panic!("expected a disconnect notification");
};
assert_eq!(
serde_json::to_value(notification)?,
serde_json::to_value(cloud_error(
serde_json::to_value(protocol::ServerNotification::Error(*notification))?,
serde_json::to_value(protocol::ServerNotification::Error(cloud_error(
"new",
"Cloud stream ended. Reopen the conversation to reconnect."
))?
)))?
);
Ok(())
}
#[tokio::test]
async fn successful_reopen_supersedes_only_earlier_losses_for_that_thread() -> Result<()> {
let (mut client, _commands, output) = CloudClient::channel(/*capacity*/ 1);
let mut replies = Replies {
stream_losses: client.stream_losses.clone(),
..Default::default()
};
for id in ["reopened", "different", "reopened"] {
let (sender, stream) = futures::channel::mpsc::unbounded();
replies
.replace(id, async { Ok(stream.boxed()) }, &output)
.await?;
drop(sender);
replies.forward_next(&output).await;
}
assert!(
replies
.replace("reopened", async { Ok(stream::empty().boxed()) }, &output)
.await
.is_err()
);
// The first EOF was followed by a successful reopen. A different thread's
// EOF and the reopened thread's newer EOF must still be delivered, in order.
drop(output);
for expected in ["different", "reopened"] {
let Some(AppServerEvent::ThreadStreamDisconnected(error)) = client.next_event().await
else {
panic!("expected a thread stream disconnect");
};
assert_eq!(
*error,
cloud_error(
expected,
"Cloud stream ended. Reopen the conversation to reconnect."
)
);
}
assert!(client.next_event().await.is_none());
Ok(())
}
#[tokio::test]
async fn attachment_status_follows_its_server_notifications() -> Result<()> {
let (output, _notifications) = mpsc::unbounded_channel();
@@ -2,6 +2,7 @@
use codex_app_server_protocol as protocol;
use codex_cloud_client as cloud;
use codex_protocol::models::ImageDetail;
use color_eyre::eyre::Result;
use color_eyre::eyre::bail;
@@ -92,15 +93,49 @@ pub(super) fn item_summary(item: cloud::ItemSummary) -> Option<protocol::ThreadI
cloud::ItemSummary::UserMessage {
id,
client_id,
text,
content,
} => protocol::ThreadItemPayload::UserMessage {
id,
client_id,
content: text
content: content
.into_iter()
.map(|text| protocol::UserInput::Text {
text,
text_elements: Vec::new(),
.map(|item| match item {
cloud::UserMessageInput::Text {
text,
text_elements,
} => protocol::UserInput::Text {
text,
text_elements: text_elements
.into_iter()
.map(|element| {
protocol::TextElement::new(
protocol::ByteRange {
start: element.start,
end: element.end,
},
element.placeholder,
)
})
.collect(),
},
cloud::UserMessageInput::Image { image, detail } => {
protocol::UserInput::Image {
image: match image {
cloud::ImageReference::Url(url) => {
protocol::ImageReference::Inline { url }
}
cloud::ImageReference::FileId(file_id) => {
protocol::ImageReference::File { file_id }
}
},
detail: detail.map(|detail| match detail {
cloud::ImageDetail::Auto => ImageDetail::Auto,
cloud::ImageDetail::Low => ImageDetail::Low,
cloud::ImageDetail::High => ImageDetail::High,
cloud::ImageDetail::Original => ImageDetail::Original,
}),
}
}
})
.collect(),
},
@@ -109,6 +144,7 @@ pub(super) fn item_summary(item: cloud::ItemSummary) -> Option<protocol::ThreadI
text,
questions,
} => protocol::ThreadItemPayload::AgentMessage {
moderation: None,
id,
text,
phase: None,
@@ -4,11 +4,25 @@ use super::*;
use pretty_assertions::assert_eq;
#[test]
fn text_receipt_preserves_submission_identity() {
fn image_receipt_preserves_submission_identity_and_attachment() {
let label = "[Image #1]";
let actual = item_summary(cloud::ItemSummary::UserMessage {
id: "item-1".into(),
client_id: Some("submission-1".into()),
text: vec!["hello".into(), "world".into()],
content: vec![
cloud::UserMessageInput::Image {
image: cloud::ImageReference::FileId("file-synthetic".into()),
detail: Some(cloud::ImageDetail::High),
},
cloud::UserMessageInput::Text {
text: format!("{label} describe"),
text_elements: vec![cloud::UserMessageTextElement {
start: 0,
end: label.len(),
placeholder: Some(label.into()),
}],
},
],
});
assert_eq!(
actual,
@@ -17,13 +31,21 @@ fn text_receipt_preserves_submission_identity() {
id: "item-1".into(),
client_id: Some("submission-1".into()),
content: vec![
protocol::UserInput::Text {
text: "hello".into(),
text_elements: Vec::new()
protocol::UserInput::Image {
image: protocol::ImageReference::File {
file_id: "file-synthetic".into(),
},
detail: Some(ImageDetail::High),
},
protocol::UserInput::Text {
text: "world".into(),
text_elements: Vec::new()
text: format!("{label} describe"),
text_elements: vec![protocol::TextElement::new(
protocol::ByteRange {
start: 0,
end: label.len(),
},
Some(label.into()),
)],
},
],
},
@@ -57,6 +79,7 @@ fn completed_reply_preserves_the_full_text_questions_and_timestamp() -> Result<(
"thread".into(),
"turn".into(),
protocol::ThreadItemPayload::AgentMessage {
moderation: None,
id: "reply".into(),
text: "Choose one".into(),
phase: None,
@@ -1,6 +1,8 @@
//! Adapts native Cloud requests and the currently open conversation’s reply stream.
//! A replacement becomes active only after its native attachment opens successfully.
//! Loaded-thread queries report reply attachments, not retained resume metadata.
mod auth;
mod events;
mod requests;
@@ -8,6 +10,7 @@ use crate::AppServerClient;
use crate::AppServerEvent;
use crate::CloudClient;
use crate::CloudOperation;
use crate::cloud::CloudStreamLosses;
use codex_app_server_protocol as protocol;
use codex_cloud_client as cloud;
use color_eyre::eyre::Result;
@@ -19,8 +22,19 @@ use futures::stream::BoxStream;
use serde_json::Value;
use tokio::sync::mpsc;
pub use auth::connect;
type ReplyStream = BoxStream<'static, Result<cloud::Event, cloud::Error>>;
/// Rejected locally before an admission request can be sent.
#[derive(Debug, thiserror::Error)]
#[error("{0}")]
struct PreflightRejection(&'static str);
#[derive(Debug, thiserror::Error)]
#[error("Cloud stream is not connected. Reopen the conversation before sending.")]
struct MissingReplyAttachment;
struct Attachment {
thread_id: String,
stream: ReplyStream,
@@ -29,6 +43,7 @@ struct Attachment {
#[derive(Default)]
struct Replies {
active: Option<Attachment>,
stream_losses: CloudStreamLosses,
// Keep the last observed status through EOF until this conversation is unloaded.
latest_status: Option<(String, cloud::ThreadStatus)>,
}
@@ -41,14 +56,13 @@ impl Replies {
match active.stream.next().await {
Some(Ok(event)) => forward(&active.thread_id, event, output, &mut self.latest_status),
Some(Err(_)) | None => {
send_notification(
output,
cloud_error(
&active.thread_id,
"Cloud stream ended. Reopen the conversation to reconnect.",
),
let error = cloud_error(
&active.thread_id,
"Cloud stream ended. Reopen the conversation to reconnect.",
);
self.active = None;
self.stream_losses.record(&error.thread_id);
let _ = output.send(AppServerEvent::ThreadStreamDisconnected(Box::new(error)));
}
}
}
@@ -84,14 +98,15 @@ impl Replies {
Some(Some(Ok(event))) => Some(event),
None => None,
};
self.latest_status = None;
if let Some(event) = first_event {
forward(id, event, output, &mut self.latest_status);
}
self.active = Some(Attachment {
thread_id: id.to_owned(),
stream,
});
self.stream_losses.supersede(id);
self.latest_status = None;
if let Some(event) = first_event {
forward(id, event, output, &mut self.latest_status);
}
Ok(())
}
@@ -119,7 +134,7 @@ impl Replies {
&mut self,
id: &str,
output: &mpsc::UnboundedSender<AppServerEvent>,
) -> Result<()> {
) -> Result<(), MissingReplyAttachment> {
// Notice a ready disconnect before sending. A continuous stream of events
// must still allow commands to make progress.
let _ = tokio::task::unconstrained(self.forward_next(output)).now_or_never();
@@ -128,69 +143,126 @@ impl Replies {
.as_ref()
.is_none_or(|active| active.thread_id != id)
{
bail!("Cloud stream is not connected. Reopen the conversation before sending.");
return Err(MissingReplyAttachment);
}
Ok(())
}
}
/// Opens an app-server client backed by the authenticated native Cloud client.
pub fn connect(client: cloud::Client, account: protocol::GetAccountResponse) -> AppServerClient {
let (app_client, mut commands, output) = CloudClient::channel(/*capacity*/ 32);
fn start_worker(client: cloud::Client, account: protocol::GetAccountResponse) -> AppServerClient {
let (app_client, commands, output) =
CloudClient::channel_with_catalog(/*capacity*/ 32, Some(client.clone()));
let mut requests = requests::Requests {
client,
account,
loaded: None,
warned_partial_history: None,
};
let mut replies = Replies {
stream_losses: app_client.stream_losses.clone(),
..Default::default()
};
tokio::spawn(async move {
let mut replies = Replies::default();
loop {
let command = tokio::select! {
_ = output.closed() => break,
() = replies.forward_next(&output) => continue,
command = commands.recv() => match command { Some(command) => command, None => break },
};
let result = match command.operation {
CloudOperation::Shutdown => {
let _ = command.response.send(Ok(Ok(Value::Null)));
break;
}
CloudOperation::Request(request) => tokio::select! {
_ = output.closed() => break,
result = handle_request(*request, &mut requests, &mut replies, &output) => result,
},
CloudOperation::Notify(_) => {
Err(eyre!("Cloud client notifications are not supported yet."))
}
CloudOperation::Resolve { .. } | CloudOperation::Reject { .. } => Err(eyre!(
"Answer this cloud approval in another client; TUI approval replies are not supported yet."
)),
};
let result = result.map_err(|error| protocol::JSONRPCErrorError {
code: if error
.downcast_ref::<requests::UnsupportedOperation>()
.is_some()
{
-32601
} else {
-32000
},
message: error.to_string(),
data: None,
});
let _ = command.response.send(Ok(result));
}
run_worker(commands, &mut requests, &mut replies, &output).await;
});
AppServerClient::Cloud(app_client)
}
async fn run_worker(
mut commands: mpsc::Receiver<crate::CloudCommand>,
requests: &mut requests::Requests,
replies: &mut Replies,
output: &mpsc::UnboundedSender<AppServerEvent>,
) {
loop {
let command = tokio::select! {
_ = output.closed() => return,
() = replies.forward_next(output) => continue,
command = commands.recv() => match command { Some(command) => command, None => return },
};
let user_message_submission =
matches!(&command.operation, CloudOperation::SubmitUserMessage(_));
let request = match command.operation {
CloudOperation::Shutdown => {
let _ = command.response.send(Ok(Ok(Value::Null)));
return;
}
CloudOperation::Request(request) => {
Ok((*request, cloud::SubmissionMode::StartIfIdle, None))
}
CloudOperation::StartProjectThread {
request_id,
params,
project,
} => Ok((
protocol::ClientRequest::ThreadStart {
request_id,
params: *params,
},
cloud::SubmissionMode::StartIfIdle,
Some(project),
)),
CloudOperation::SubmitUserMessage(params) => Ok((
protocol::ClientRequest::TurnStart {
// Native admission is keyed by the caller's stable message ID.
request_id: protocol::RequestId::Integer(0),
params: *params,
},
cloud::SubmissionMode::Steer,
None,
)),
CloudOperation::Notify(_) => {
Err(eyre!("Cloud client notifications are not supported yet."))
}
CloudOperation::Resolve { .. } | CloudOperation::Reject { .. } => Err(eyre!(
"Answer this cloud approval in another client; TUI approval replies are not supported yet."
)),
};
let result = match request {
Ok((request, mode, project)) => tokio::select! {
_ = output.closed() => return,
result = handle_request(request, mode, project, requests, replies, output) => result,
},
Err(error) => Err(error),
};
let result = result.map_err(|error| protocol::JSONRPCErrorError {
code: if error
.downcast_ref::<requests::UnsupportedOperation>()
.is_some()
{
-32601
} else if error.is::<PreflightRejection>()
|| user_message_submission && error.is::<MissingReplyAttachment>()
{
-32602
} else {
-32000
},
message: error.to_string(),
data: None,
});
let _ = command.response.send(Ok(result));
}
}
async fn handle_request(
request: protocol::ClientRequest,
mode: cloud::SubmissionMode,
project: Option<cloud::ProjectEnvironment>,
requests: &mut requests::Requests,
replies: &mut Replies,
output: &mpsc::UnboundedSender<AppServerEvent>,
) -> Result<Value> {
if let protocol::ClientRequest::ThreadLoadedList { .. } = &request {
// The archive RPC can fail after closing Attach. Observe a ready EOF even
// when the RPC result won the worker's select before the stream did.
let _ = tokio::task::unconstrained(replies.forward_next(output)).now_or_never();
return Ok(serde_json::json!({
"data": replies.active.iter().map(|active| &active.thread_id).collect::<Vec<_>>(),
"nextCursor": null,
}));
}
if let protocol::ClientRequest::ThreadRead { params, .. } = &request {
return requests.read_thread(params, replies.thread_status(&params.thread_id));
}
@@ -212,10 +284,28 @@ async fn handle_request(
replies.admit_turn(&params.thread_id, output)?;
}
match replies
.while_listening(requests.handle(request, output), output)
.while_listening(requests.handle(request, mode, project, output), output)
.await?
{
requests::Response::Value(value) => Ok(value),
requests::Response::Archived(thread_id) => {
replies.detach(&thread_id);
replies.stream_losses.supersede(&thread_id);
if requests
.loaded
.as_ref()
.is_some_and(|loaded| loaded.thread.id == thread_id)
{
requests.loaded = None;
}
send_notification(
output,
protocol::ServerNotification::ThreadArchived(
protocol::ThreadArchivedNotification { thread_id },
),
);
Ok(serde_json::to_value(protocol::ThreadArchiveResponse {})?)
}
requests::Response::Attach(settings) => {
let id = &settings.thread.id;
let result = serde_json::to_value(&settings)?;
@@ -243,7 +333,10 @@ fn forward(
cloud::Event::Transcript(event) => match events::transcript(event.thread_id, event.update) {
Ok(Some(notification)) => notification,
Ok(None) => return,
Err(_) => cloud_error(id, "The cloud sent an unsupported transcript event."),
Err(_) => protocol::ServerNotification::Error(cloud_error(
id,
"The cloud sent an unsupported transcript event.",
)),
},
cloud::Event::ServerRequest(_) => protocol::ServerNotification::Warning(protocol::WarningNotification {
thread_id: Some(id.to_owned()),
@@ -261,8 +354,8 @@ fn send_notification(
let _ = output.send(AppServerEvent::ServerNotification(Box::new(notification)));
}
fn cloud_error(id: &str, message: &str) -> protocol::ServerNotification {
protocol::ServerNotification::Error(protocol::ErrorNotification {
fn cloud_error(id: &str, message: &str) -> protocol::ErrorNotification {
protocol::ErrorNotification {
thread_id: id.to_owned(),
turn_id: String::new(),
will_retry: false,
@@ -272,9 +365,13 @@ fn cloud_error(id: &str, message: &str) -> protocol::ServerNotification {
codex_error_info: None,
misalignment: None,
},
})
}
}
#[cfg(test)]
#[path = "connection_tests.rs"]
mod tests;
#[cfg(test)]
#[path = "submission_tests.rs"]
mod submission_tests;
@@ -7,7 +7,7 @@ use pretty_assertions::assert_eq;
fn ordinary_multi_backend_resume_queries_cloud_interactive_threads_on_every_page() {
// The mixed picker has no shared cwd/provider filter. It sends conventional
// interactive source names, even when the connection belongs to Cloud.
for (cursor, state_db_only) in [(None, true), (Some("page-2"), false)] {
for (cursor, state_db_only, archived) in [(None, true, false), (Some("page-2"), false, true)] {
let params = serde_json::from_value(json!({
"currentAccountOnly": true,
"cursor": cursor,
@@ -15,13 +15,14 @@ fn ordinary_multi_backend_resume_queries_cloud_interactive_threads_on_every_page
"sortKey": "updated_at",
"modelProviders": [],
"sourceKinds": ["cli", "vscode"],
"archived": false,
"archived": archived,
"useStateDbOnly": state_db_only,
}))
.unwrap();
let query = thread_list_query(params).unwrap();
assert_eq!(query.cursor.as_deref(), cursor);
assert_eq!(query.limit, Some(25));
assert_eq!(query.archived, archived);
assert!(matches!(query.sort_key, cloud::ThreadSortKey::UpdatedAt));
assert!(matches!(
query.sort_direction,
@@ -34,7 +35,6 @@ fn ordinary_multi_backend_resume_queries_cloud_interactive_threads_on_every_page
#[test]
fn unsupported_filters_do_not_return_unrelated_cloud_rows() {
for filter in [
json!({"archived": true}),
json!({"sourceKinds": ["exec"]}),
json!({"attachedToThreadId": "other"}),
json!({"modelProviders": ["other"]}),
@@ -63,7 +63,13 @@ fn user_input_uses_stable_id_and_the_existing_cloud_configuration() {
let request = cloud_message(message()).unwrap();
assert_eq!(request.thread_id, "thread-a");
assert_eq!(request.client_user_message_id, "submission-a");
assert_eq!(request.text, "one\ntwo");
assert_eq!(
request.input,
vec![cloud::UserMessageInput::Text {
text: "one\ntwo".into(),
text_elements: Vec::new(),
}]
);
assert_eq!(
request.turn_trigger.as_deref(),
Some("safety_recourse_follow_up")
@@ -89,6 +95,51 @@ fn user_input_uses_stable_id_and_the_existing_cloud_configuration() {
);
}
#[test]
fn image_submission_keeps_attachment_markers_and_input_order() {
let label = "[Image #1]";
let request = cloud_message(protocol::TurnStartParams {
input: vec![
protocol::UserInput::Image {
image: protocol::ImageReference::File {
file_id: "file-synthetic".into(),
},
detail: Some(ImageDetail::High),
},
protocol::UserInput::Text {
text: format!("{label} describe"),
text_elements: vec![protocol::TextElement::new(
protocol::ByteRange {
start: 0,
end: label.len(),
},
Some(label.into()),
)],
},
],
..message()
})
.unwrap();
assert_eq!(
request.input,
vec![
cloud::UserMessageInput::Image {
image: cloud::ImageReference::FileId("file-synthetic".into()),
detail: Some(cloud::ImageDetail::High),
},
cloud::UserMessageInput::Text {
text: format!("{label} describe"),
text_elements: vec![cloud::UserMessageTextElement {
start: 0,
end: label.len(),
placeholder: Some(label.into()),
}],
},
]
);
}
#[test]
fn duplicate_and_queued_admissions_never_invent_a_running_turn() {
for outcome in [
@@ -108,3 +159,43 @@ fn duplicate_and_queued_admissions_never_invent_a_running_turn() {
);
}
}
#[test]
fn admission_receipts_preserve_server_turns_and_duplicate_identity() -> Result<()> {
let turn = |id: &str, status| cloud::TurnSummary {
id: id.into(),
status,
error: None,
started_at: None,
completed_at: None,
duration_ms: None,
};
for (outcome, expected) in [
(
cloud::AdmissionOutcome::Started(turn("u", cloud::TurnStatus::InProgress)),
("started", "u", protocol::TurnStatus::InProgress),
),
(
cloud::AdmissionOutcome::Steered(turn("v", cloud::TurnStatus::Completed)),
("steered", "v", protocol::TurnStatus::Completed),
),
] {
let (kind, turn) = match admitted_message(outcome)? {
CloudUserMessageReceipt::Started(turn) => ("started", turn),
CloudUserMessageReceipt::Steered(turn) => ("steered", turn),
CloudUserMessageReceipt::Duplicate { .. } => panic!("expected a turn"),
};
assert_eq!((kind, turn.id.as_str(), turn.status), expected);
}
for turn_id in [None, Some("original".into())] {
let CloudUserMessageReceipt::Duplicate { turn_id: actual } =
admitted_message(cloud::AdmissionOutcome::Duplicate {
turn_id: turn_id.clone(),
})?
else {
panic!("a duplicate must not become a running turn");
};
assert_eq!(actual, turn_id);
}
Ok(())
}
@@ -1,9 +1,12 @@
//! Maps conversation requests onto native Cloud operations.
use super::PreflightRejection;
use super::events;
use super::send_notification;
use crate::CloudUserMessageReceipt;
use codex_app_server_protocol as protocol;
use codex_cloud_client as cloud;
use codex_protocol::models::ImageDetail;
use color_eyre::eyre::Result;
use color_eyre::eyre::bail;
use color_eyre::eyre::eyre;
@@ -25,6 +28,7 @@ pub(super) struct Requests {
pub(super) enum Response {
Value(Value),
Attach(Box<protocol::ThreadResumeResponse>),
Archived(String),
}
impl Requests {
@@ -51,6 +55,8 @@ impl Requests {
pub(super) async fn handle(
&mut self,
request: protocol::ClientRequest,
mode: cloud::SubmissionMode,
project: Option<cloud::ProjectEnvironment>,
output: &mpsc::UnboundedSender<crate::AppServerEvent>,
) -> Result<Response> {
use protocol::ClientRequest as Request;
@@ -65,6 +71,24 @@ impl Requests {
}
serde_json::to_value(page)?
}
Request::ThreadArchive { params, .. } => {
self.client.archive_thread(&params.thread_id).await?;
return Ok(Response::Archived(params.thread_id));
}
Request::ThreadUnarchive { params, .. } => {
let mut thread = self.client.unarchive_thread(&params.thread_id).await?;
use_paginated_history(&mut thread);
let value = json!({ "thread": thread });
send_notification(
output,
protocol::ServerNotification::ThreadUnarchived(
protocol::ThreadUnarchivedNotification {
thread_id: params.thread_id,
},
),
);
value
}
Request::ThreadStart { mut params, .. } => {
let model = params.model.take();
let provider = params.model_provider.take();
@@ -76,7 +100,7 @@ impl Requests {
"Cloud conversations start with server defaults. Custom settings are not supported yet."
);
}
let settings = self.client.prewarm_default_thread(model, provider).await?;
let settings = self.client.prewarm_thread(model, provider, project).await?;
return attach_response(settings);
}
Request::ThreadResume { params, .. } => {
@@ -93,14 +117,6 @@ impl Requests {
let settings = self.client.activate(&params.thread_id).await?;
return attach_response(settings);
}
Request::ThreadLoadedList { .. } => {
let ids = self
.loaded
.iter()
.map(|loaded| &loaded.thread.id)
.collect::<Vec<_>>();
json!({"data": ids, "nextCursor": null})
}
Request::ThreadTurnsList { params, .. } => {
if params.items_view != Some(protocol::TurnItemsView::NotLoaded) {
bail!("Read cloud turn items separately with thread/items/list.");
@@ -188,12 +204,23 @@ impl Requests {
})?
}
Request::TurnStart { params, .. } => {
let admission = self
.client
.add_user_message(&cloud_message(params)?)
.await?;
let turn = admitted_turn(admission.outcome)?;
serde_json::to_value(protocol::TurnStartResponse { turn })?
let mut message = cloud_message(params)?;
message.mode = mode;
let admission = match self.client.add_user_message(&message).await {
Err(cloud::MutationError::InvalidRequest) => {
return Err(PreflightRejection(
"The Cloud message is empty, invalid, or too large.",
)
.into());
}
result => result?,
};
if matches!(mode, cloud::SubmissionMode::Steer) {
serde_json::to_value(admitted_message(admission.outcome)?)?
} else {
let turn = admitted_turn(admission.outcome)?;
serde_json::to_value(protocol::TurnStartResponse { turn })?
}
}
Request::TurnInterrupt { params, .. } => {
self.client
@@ -230,7 +257,6 @@ fn thread_list_query(params: protocol::ThreadListParams) -> Result<cloud::Thread
// Its explicit CLI/VS Code defaults are conventional source names.
let sources = params.source_kinds.as_deref().unwrap_or_default();
if !matches!(sources, [] | [Cli, VsCode] | [VsCode, Cli])
|| params.archived == Some(true)
|| params.cwd.is_some()
|| params.search_term.is_some()
|| params.section_id.is_some()
@@ -252,6 +278,7 @@ fn thread_list_query(params: protocol::ThreadListParams) -> Result<cloud::Thread
Ok(cloud::ThreadListQuery {
cursor: params.cursor,
limit: params.limit,
archived: params.archived.unwrap_or_default(),
originators: params.originators.unwrap_or_default(),
sort_key: match params.sort_key {
Some(protocol::ThreadSortKey::CreatedAt) | None => cloud::ThreadSortKey::CreatedAt,
@@ -275,48 +302,124 @@ fn history_order(direction: protocol::SortDirection) -> cloud::HistoryOrder {
}
}
fn cloud_message(mut params: protocol::TurnStartParams) -> Result<cloud::AddUserMessageRequest> {
fn cloud_message(
mut params: protocol::TurnStartParams,
) -> Result<cloud::AddUserMessageRequest, PreflightRejection> {
let thread_id = std::mem::take(&mut params.thread_id);
let client_user_message_id = params
.client_user_message_id
.take()
.ok_or_else(|| eyre!("A cloud message needs a stable submission ID."))?;
.ok_or(PreflightRejection(
"A cloud message needs a stable submission ID.",
))?;
let input = std::mem::take(&mut params.input);
let turn_trigger = params.turn_trigger.take();
let (model, effort) = if turn_trigger.as_deref() == Some("user") {
(params.model.take(), params.effort.take())
} else {
(None, None)
};
if params != protocol::TurnStartParams::default() {
bail!("Changing cloud settings or sending structured input is not supported yet.");
return Err(PreflightRejection(
"Changing cloud settings or sending structured input is not supported yet.",
));
}
let text = input
.into_iter()
.map(|item| match item {
let mut content = Vec::with_capacity(input.len());
for item in input {
let item = match item {
protocol::UserInput::Text {
text,
text_elements,
} if text_elements.is_empty() => Ok(text),
_ => bail!("Cloud conversations currently accept plain text only."),
})
.collect::<Result<Vec<_>>>()?
.join("\n");
} => {
// Keep the existing line separation for consecutive plain text parts.
if text_elements.is_empty()
&& let Some(cloud::UserMessageInput::Text {
text: previous,
text_elements: previous_elements,
}) = content.last_mut()
&& previous_elements.is_empty()
{
previous.push('\n');
previous.push_str(&text);
continue;
}
cloud::UserMessageInput::Text {
text,
text_elements: text_elements
.into_iter()
.map(|element| cloud::UserMessageTextElement {
placeholder: element.placeholder().map(str::to_owned),
start: element.byte_range.start,
end: element.byte_range.end,
})
.collect(),
}
}
protocol::UserInput::Image { image, detail } => cloud::UserMessageInput::Image {
image: match image {
protocol::ImageReference::Inline { url } => cloud::ImageReference::Url(url),
protocol::ImageReference::File { file_id } => {
cloud::ImageReference::FileId(file_id)
}
},
detail: detail.map(|detail| match detail {
ImageDetail::Auto => cloud::ImageDetail::Auto,
ImageDetail::Low => cloud::ImageDetail::Low,
ImageDetail::High => cloud::ImageDetail::High,
ImageDetail::Original => cloud::ImageDetail::Original,
}),
},
protocol::UserInput::LocalImage { .. } => {
return Err(PreflightRejection(
"Prepare local images before sending them to Cloud.",
));
}
protocol::UserInput::Audio { .. }
| protocol::UserInput::LocalAudio { .. }
| protocol::UserInput::Skill { .. }
| protocol::UserInput::Mention { .. } => {
return Err(PreflightRejection(
"Cloud conversations currently accept text and images.",
));
}
};
content.push(item);
}
Ok(cloud::AddUserMessageRequest {
thread_id,
client_user_message_id,
text,
input: content,
turn_trigger,
model,
effort: effort.map(|effort| effort.to_string()),
mode: cloud::SubmissionMode::StartIfIdle,
shared_access: false,
})
}
fn admitted_message(outcome: cloud::AdmissionOutcome) -> Result<CloudUserMessageReceipt> {
Ok(match outcome {
cloud::AdmissionOutcome::Started(turn) => {
CloudUserMessageReceipt::Started(events::turn(turn)?)
}
cloud::AdmissionOutcome::Steered(turn) => {
CloudUserMessageReceipt::Steered(events::turn(turn)?)
}
cloud::AdmissionOutcome::Duplicate { turn_id } => {
CloudUserMessageReceipt::Duplicate { turn_id }
}
cloud::AdmissionOutcome::Queued { .. } => bail!(
"Cloud already accepted this message without returning a turn. Reopen the conversation to see its status before sending again."
),
})
}
fn admitted_turn(outcome: cloud::AdmissionOutcome) -> Result<protocol::Turn> {
match outcome {
cloud::AdmissionOutcome::Started(turn) | cloud::AdmissionOutcome::Steered(turn) => {
events::turn(turn)
}
cloud::AdmissionOutcome::Duplicate { .. } | cloud::AdmissionOutcome::Queued { .. } => {
bail!(
"Cloud already accepted this message without returning a turn. Reopen the conversation to see its status before sending again."
)
}
match admitted_message(outcome)? {
CloudUserMessageReceipt::Started(turn) | CloudUserMessageReceipt::Steered(turn) => Ok(turn),
CloudUserMessageReceipt::Duplicate { .. } => bail!(
"Cloud already accepted this message without returning a turn. Reopen the conversation to see its status before sending again."
),
}
}
@@ -0,0 +1,211 @@
#![cfg(test)]
//! Exercises native admission and local validation through the command worker.
use super::*;
use pretty_assertions::assert_eq;
use wiremock::Mock;
use wiremock::MockServer;
use wiremock::ResponseTemplate;
use wiremock::matchers::header;
use wiremock::matchers::method;
use wiremock::matchers::path;
fn submission(message_id: &str) -> protocol::TurnStartParams {
protocol::TurnStartParams {
thread_id: "t".into(),
client_user_message_id: Some(message_id.into()),
model: Some("chosen-model".into()),
effort: Some(codex_protocol::openai_models::ReasoningEffort::High),
turn_trigger: Some("user".into()),
input: vec![protocol::UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
..Default::default()
}
}
#[tokio::test]
async fn native_submission_uses_one_admission_and_keeps_preflight_guards() -> Result<()> {
let server = MockServer::start().await;
let home = tempfile::tempdir()?;
let config = crate::legacy_core::config::ConfigBuilder::default()
.codex_home(home.path().to_owned())
.fallback_cwd(Some(home.path().to_owned()))
.without_project_context()
.build()
.await?;
let native = cloud::Client::new(
&config.http_client_factory(),
&server.uri(),
cloud::Credentials::new("synthetic-bearer", "synthetic-account")?,
)?;
let account = protocol::GetAccountResponse {
user_id: None,
account: None,
requires_openai_auth: true,
workspace_routing: None,
};
let (client, commands, output) = crate::CloudClient::channel(/*capacity*/ 4);
let client = crate::AppServerClient::Cloud(client);
let handle = client.request_handle();
let crate::AppServerRequestHandle::Cloud(cloud_handle) = &handle else {
panic!("expected a Cloud handle");
};
let (reply_sender, stream) = futures::channel::mpsc::unbounded();
let mut replies = Replies {
active: Some(Attachment {
thread_id: "t".into(),
stream: stream.boxed(),
}),
..Replies::default()
};
let worker = tokio::spawn(async move {
let mut requests = crate::cloud_backend::requests::Requests {
client: native,
account,
loaded: None,
warned_partial_history: None,
};
crate::cloud_backend::run_worker(commands, &mut requests, &mut replies, &output).await
});
let rpc = "/oaiproto.codex_app_server_backend.ThreadService/AddUserMessage";
Mock::given(method("POST"))
.and(path(rpc))
.and(header("authorization", "Bearer synthetic-bearer"))
.respond_with(ResponseTemplate::new(503))
.expect(2)
.mount(&server)
.await;
let url = "data:image/png;base64,iVBORw0KGgo=";
let image = protocol::UserInput::Image {
image: protocol::ImageReference::Inline { url: url.into() },
detail: None,
};
let Err(crate::TypedRequestError::Server { source, .. }) = cloud_handle
.submit_user_message(protocol::TurnStartParams {
input: vec![image.clone()],
..submission("x")
})
.await
else {
panic!("a lost receipt must remain uncertain");
};
assert_eq!(source.code, -32000);
assert!(source.message.contains("mutation outcome unknown"));
// Existing typed turn/start callers keep StartIfIdle and the same native error.
let Err(crate::TypedRequestError::Server { source, .. }) = handle
.request_typed::<protocol::TurnStartResponse>(protocol::ClientRequest::TurnStart {
request_id: protocol::RequestId::Integer(1),
params: protocol::TurnStartParams {
input: vec![
image,
protocol::UserInput::Text {
text: "describe the image".into(),
text_elements: Vec::new(),
},
],
..submission("m")
},
})
.await
else {
panic!("ordinary turn/start must retain its server error");
};
assert_eq!(source.code, -32000);
assert!(source.message.contains("mutation outcome unknown"));
for params in [
protocol::TurnStartParams {
service_tier: Some(Some("other".into())),
..submission("invalid")
},
protocol::TurnStartParams {
client_user_message_id: None,
..submission("missing")
},
protocol::TurnStartParams {
input: Vec::new(),
..submission("empty")
},
protocol::TurnStartParams {
thread_id: "other".into(),
..submission("foreign")
},
] {
let Err(crate::TypedRequestError::Server { source, .. }) =
cloud_handle.submit_user_message(params).await
else {
panic!("invalid input must fail before admission");
};
assert_eq!(source.code, -32602);
}
let queued = handle
.request(protocol::ClientRequest::TurnStart {
request_id: protocol::RequestId::Integer(3),
params: protocol::TurnStartParams {
input: vec![protocol::UserInput::LocalImage {
path: "queued.png".into(),
detail: None,
}],
..submission("queued-image")
},
})
.await?
.expect_err("a queued attachment must fail before admission");
assert_eq!(queued.code, -32602);
assert_eq!(
queued.message,
"Prepare local images before sending them to Cloud."
);
let invalid_image = handle
.request(protocol::ClientRequest::TurnStart {
request_id: protocol::RequestId::Integer(4),
params: protocol::TurnStartParams {
input: vec![protocol::UserInput::Image {
image: protocol::ImageReference::Inline { url: String::new() },
detail: None,
}],
..submission("invalid-image")
},
})
.await?
.expect_err("an invalid image must fail before admission");
assert_eq!(invalid_image.code, -32602);
drop(reply_sender);
let Err(crate::TypedRequestError::Server { source, .. }) =
cloud_handle.submit_user_message(submission("closed")).await
else {
panic!("a disconnected stream must reject input");
};
assert_eq!(source.code, -32602);
let ordinary = handle
.request(protocol::ClientRequest::TurnStart {
request_id: protocol::RequestId::Integer(2),
params: submission("closed"),
})
.await?
.expect_err("ordinary turn/start keeps its existing disconnected error");
assert_eq!(ordinary.code, -32000);
client.shutdown().await?;
worker.await?;
let calls = server.received_requests().await.unwrap();
for expected in [url.as_bytes(), b"\x4a\x04high", b"\x62\x0cchosen-model"] {
assert!(calls.iter().all(|request| {
request
.body
.windows(expected.len())
.any(|bytes| bytes == expected)
}));
}
assert_eq!(
calls
.iter()
.map(|request| (request.body[7], *request.body.last().unwrap()))
.collect::<Vec<_>>(),
vec![(b'x', 1), (b'm', 3)]
);
Ok(())
}
@@ -102,3 +102,80 @@ async fn cloud_shutdown_times_out_when_owner_does_not_respond() {
assert!(events.is_closed());
assert!(commands.recv().await.is_none());
}
#[tokio::test]
async fn native_model_list_bypasses_the_cloud_command_queue() -> color_eyre::Result<()> {
use codex_app_server_protocol::ModelListResponse;
use wiremock::Mock;
use wiremock::MockServer;
use wiremock::ResponseTemplate;
use wiremock::matchers::header;
use wiremock::matchers::method;
use wiremock::matchers::path;
use wiremock::matchers::query_param;
let server = MockServer::start().await;
let home = tempfile::tempdir()?;
let config = crate::legacy_core::config::ConfigBuilder::default()
.codex_home(home.path().to_owned())
.fallback_cwd(Some(home.path().to_owned()))
.without_project_context()
.build()
.await?;
let native = codex_cloud_client::Client::new(
&config.http_client_factory(),
&server.uri(),
codex_cloud_client::Credentials::new("synthetic-bearer", "synthetic-account")?,
)?;
let response = serde_json::json!({
"data": [{
"id": "test-model",
"model": "test-model",
"displayName": "Test model",
"description": "Cloud catalog fixture",
"hidden": true,
"supportedReasoningEfforts": [],
"defaultReasoningEffort": "medium",
"isDefault": false
}],
"nextCursor": "next"
});
Mock::given(method("GET"))
.and(path("/v2/models"))
.and(header("authorization", "Bearer synthetic-bearer"))
.and(header("chatgpt-account-id", "synthetic-account"))
.and(query_param("cursor", "previous"))
.and(query_param("limit", "2"))
.and(query_param("includeHidden", "true"))
.respond_with(ResponseTemplate::new(200).set_body_json(&response))
.expect(1)
.mount(&server)
.await;
// Leave the command receiver idle. The catalog must finish without its worker.
let (client, mut commands, _events) =
CloudClient::channel_with_catalog(/*capacity*/ 1, Some(native));
let handle = AppServerClient::Cloud(client).request_handle();
let result = tokio::time::timeout(
std::time::Duration::from_secs(/*secs*/ 5),
handle.request_typed::<ModelListResponse>(ClientRequest::ModelList {
request_id: RequestId::Integer(1),
params: ModelListParams {
cursor: Some("previous".into()),
limit: Some(2),
include_hidden: Some(true),
model_provider: None,
},
}),
)
.await??;
assert_eq!(
result,
serde_json::from_value::<ModelListResponse>(response)?
);
assert!(matches!(
commands.try_recv(),
Err(mpsc::error::TryRecvError::Empty)
));
Ok(())
}
+37 -2
View File
@@ -22,6 +22,7 @@
mod cloud;
pub mod cloud_backend;
pub use codex_cloud_client::ProjectEnvironment;
mod path;
mod remote;
mod remote_websocket;
@@ -29,6 +30,7 @@ pub use cloud::CloudClient;
pub use cloud::CloudCommand;
pub use cloud::CloudOperation;
pub use cloud::CloudRequestHandle;
pub use cloud::CloudUserMessageReceipt;
mod server_request;
pub use server_request::AppServerReplyHandle;
@@ -110,10 +112,16 @@ pub type RequestResult = std::result::Result<JsonRpcResult, JSONRPCErrorError>;
#[derive(Debug, Clone)]
pub enum AppServerEvent {
Lagged { skipped: usize },
Lagged {
skipped: usize,
},
ServerNotification(Box<ServerNotification>),
ServerRequest(Box<ServerRequest>),
Disconnected { message: String },
/// A native Cloud reply stream ended. The underlying thread can still be running.
ThreadStreamDisconnected(Box<codex_app_server_protocol::ErrorNotification>),
Disconnected {
message: String,
},
}
impl From<InProcessServerEvent> for AppServerEvent {
@@ -712,6 +720,27 @@ impl InProcessAppServerRequestHandle {
}
impl AppServerRequestHandle {
/// Starts a native cloud thread with host project metadata without adding wire fields.
pub async fn start_cloud_project_thread(
&self,
request_id: RequestId,
params: codex_app_server_protocol::ThreadStartParams,
project: codex_cloud_client::ProjectEnvironment,
) -> Result<codex_app_server_protocol::ThreadStartResponse, TypedRequestError> {
let response = match self {
Self::Cloud(handle) => {
handle
.start_project_thread(request_id, params, project)
.await
}
Self::InProcess(_) | Self::Remote(_) => Err(IoError::new(
std::io::ErrorKind::Unsupported,
"Project checkout requires the native cloud transport.",
)),
};
decode_typed_response("thread/start", response)
}
pub(crate) async fn resolve_server_request(
&self,
request_id: RequestId,
@@ -1145,6 +1174,7 @@ mod tests {
"thread".to_string(),
"turn".to_string(),
codex_app_server_protocol::ThreadItemPayload::AgentMessage {
moderation: None,
id: "item".to_string(),
text: text.to_string(),
phase: None,
@@ -1475,6 +1505,7 @@ mod tests {
JSONRPCMessage::Response(JSONRPCResponse {
id: request.id,
result: serde_json::to_value(GetAccountResponse {
user_id: None,
workspace_routing: None,
account: None,
requires_openai_auth: false,
@@ -1531,6 +1562,7 @@ mod tests {
JSONRPCMessage::Response(JSONRPCResponse {
id: request.id,
result: serde_json::to_value(GetAccountResponse {
user_id: None,
workspace_routing: None,
account: None,
requires_openai_auth: false,
@@ -1609,6 +1641,7 @@ mod tests {
assert_eq!(
response,
GetAccountResponse {
user_id: None,
workspace_routing: None,
account: None,
requires_openai_auth: false,
@@ -1715,6 +1748,7 @@ mod tests {
JSONRPCMessage::Response(JSONRPCResponse {
id: request.id,
result: serde_json::to_value(GetAccountResponse {
user_id: None,
workspace_routing: None,
account: None,
requires_openai_auth: false,
@@ -1769,6 +1803,7 @@ mod tests {
assert_eq!(
first_response,
GetAccountResponse {
user_id: None,
workspace_routing: None,
account: None,
requires_openai_auth: false,
-17
View File
@@ -178,8 +178,6 @@ pub struct RemoteAppServerRequestHandle {
enum SocketPeerPolicy {
ExplicitEndpoint,
#[cfg(windows)]
NonElevatedCurrentUser,
}
impl RemoteAppServerClient {
@@ -187,19 +185,6 @@ impl RemoteAppServerClient {
Self::connect_with_policy(args, SocketPeerPolicy::ExplicitEndpoint).await
}
/// Connects to an implicitly discovered Windows daemon, verifying its peer
/// token before the WebSocket handshake or any session requests.
#[cfg(windows)]
pub async fn connect_local_daemon(args: RemoteAppServerConnectArgs) -> IoResult<Self> {
if !matches!(args.endpoint, RemoteAppServerEndpoint::UnixSocket { .. }) {
return Err(IoError::new(
ErrorKind::InvalidInput,
"local daemon requires a Unix socket",
));
}
Self::connect_with_policy(args, SocketPeerPolicy::NonElevatedCurrentUser).await
}
async fn connect_with_policy(
args: RemoteAppServerConnectArgs,
peer_policy: SocketPeerPolicy,
@@ -810,8 +795,6 @@ async fn connect_unix_socket_endpoint(
})?;
match peer_policy {
SocketPeerPolicy::ExplicitEndpoint => {}
#[cfg(windows)]
SocketPeerPolicy::NonElevatedCurrentUser => stream.ensure_non_elevated_peer()?,
}
let websocket_config = remote_websocket_config();
let stream = timeout(
-3
View File
@@ -47,6 +47,3 @@ codex-utils-cargo-bin = { workspace = true }
pretty_assertions = { workspace = true }
tokio = { workspace = true, features = ["test-util"] }
tracing-subscriber = { workspace = true }
[target.'cfg(windows)'.dependencies]
windows-sys = { workspace = true, features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Console", "Win32_System_IO", "Win32_System_JobObjects", "Win32_Security", "Win32_Security_Authorization", "Win32_System_Threading"] }
@@ -1,7 +1,5 @@
mod pid;
pub(crate) mod stderr_log;
#[cfg(windows)]
pub(crate) mod windows;
use std::collections::BTreeMap;
use std::path::Path;
+1 -146
View File
@@ -4,7 +4,6 @@
#[path = "pid_identity.rs"]
mod identity;
#[cfg(any(unix, windows))]
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::io::SeekFrom;
@@ -16,14 +15,12 @@ use crate::managed_install::ExecutableIdentity;
use anyhow::Context;
use anyhow::Result;
use anyhow::bail;
#[cfg(any(unix, windows))]
use codex_app_server_transport::REMOTE_CONTROL_DISABLED_ENV_VAR;
use serde::Deserialize;
use serde::Serialize;
use tokio::fs;
use tokio::io::AsyncReadExt;
use tokio::io::AsyncSeekExt;
#[cfg(unix)]
use tokio::process::Command;
use tokio::time::sleep;
@@ -35,7 +32,6 @@ const START_TIMEOUT: Duration = Duration::from_secs(10);
const STDERR_LOG_TAIL_BYTES: u64 = 4096;
#[derive(Debug)]
#[cfg_attr(not(any(unix, windows)), allow(dead_code))]
pub(crate) struct PidBackend {
pub(super) feature_overrides: BTreeMap<String, bool>,
codex_bin: PathBuf,
@@ -84,7 +80,6 @@ enum PidFileState {
}
#[derive(Debug, Clone)]
#[cfg_attr(not(any(unix, windows)), allow(dead_code))]
enum PidCommandKind {
AppServer { remote_control_enabled: bool },
UpdateLoop { restore_release: Option<String> },
@@ -155,16 +150,10 @@ impl PidBackend {
}
}
#[cfg(any(unix, windows))]
pub(crate) async fn start(&self) -> Result<Option<u32>> {
self.start_inner(/*replacement*/ None).await
}
#[cfg(not(any(unix, windows)))]
pub(crate) async fn start(&self) -> Result<Option<u32>> {
bail!("pid-managed app-server startup is unsupported on this platform")
}
pub(crate) async fn stop(&self) -> Result<()> {
self.stop_with_grace(DEFAULT_SHUTDOWN_GRACE_SECONDS).await
}
@@ -186,42 +175,9 @@ impl PidBackend {
let started_at = tokio::time::Instant::now();
let force_after = Duration::from_secs(grace_seconds.into());
let deadline = started_at + force_after + STOP_FORCE_TIMEOUT;
#[cfg(unix)]
self.terminate_process(pid)?;
#[cfg(windows)]
let process = {
let Some(process) = super::windows::Process::open(pid)? else {
continue;
};
if process.start_time()? != record.process_start_time {
continue;
}
match self.command_kind {
PidCommandKind::AppServer { .. } => {
let codex_home = self
.pid_file
.parent()
.and_then(Path::parent)
.context("daemon pid path has no Codex home")?;
let socket_path =
codex_app_server_transport::app_server_control_socket_path(codex_home)?;
if let Err(err) =
crate::client::request_shutdown(socket_path.as_path(), pid).await
{
tracing::warn!(%pid, %err, "managed app-server shutdown request failed; waiting for force deadline");
}
}
PidCommandKind::UpdateLoop { .. } => {
fs::write(self.pid_file.with_extension("shutdown"), pid.to_string())
.await
.context("failed to request updater shutdown")?;
}
}
process
};
let mut forced = false;
loop {
#[cfg(unix)]
if let Ok(raw_pid) = libc::pid_t::try_from(pid)
&& raw_pid > 0
{
@@ -239,10 +195,7 @@ impl PidBackend {
}
if !forced && started_at.elapsed() >= force_after {
crate::diagnostics::event("shutdown_forced", serde_json::json!({ "pid": pid }));
#[cfg(unix)]
self.force_terminate_process(pid)?;
#[cfg(windows)]
process.terminate()?;
forced = true;
}
sleep(STOP_POLL_INTERVAL).await;
@@ -362,7 +315,6 @@ impl PidBackend {
Ok(reservation_lock)
}
#[cfg(any(unix, windows))]
async fn open_stderr_log(&self) -> Result<fs::File> {
let stderr_log_file = stderr_log_file_for_pid_file(&self.pid_file);
super::stderr_log::preserve(&stderr_log_file).await;
@@ -389,7 +341,6 @@ impl PidBackend {
})
}
#[cfg(any(unix, windows))]
fn command_args(&self) -> Vec<Cow<'_, str>> {
let mut args = match &self.command_kind {
PidCommandKind::AppServer {
@@ -425,7 +376,6 @@ impl PidBackend {
args
}
#[cfg(any(unix, windows))]
fn command_env(&self) -> Option<(&'static str, &'static str)> {
match self.command_kind {
PidCommandKind::AppServer {
@@ -441,14 +391,10 @@ impl PidBackend {
fn terminate_process(&self, pid: u32) -> Result<()> {
match self.command_kind {
PidCommandKind::AppServer { .. } => terminate_process(pid),
#[cfg(unix)]
PidCommandKind::UpdateLoop { .. } => terminate_process_group(pid),
#[cfg(not(unix))]
PidCommandKind::UpdateLoop { .. } => terminate_process(pid),
}
}
#[cfg(not(windows))]
fn force_terminate_process(&self, pid: u32) -> Result<()> {
match self.command_kind {
PidCommandKind::AppServer { .. } => force_terminate_process(pid),
@@ -525,7 +471,6 @@ async fn read_log_tail(path: &Path, byte_limit: u64) -> Result<Option<String>> {
Ok(Some(contents))
}
#[cfg(unix)]
fn process_exists(pid: u32) -> bool {
let Ok(pid) = libc::pid_t::try_from(pid) else {
return false;
@@ -534,7 +479,6 @@ fn process_exists(pid: u32) -> bool {
result == 0 || std::io::Error::last_os_error().raw_os_error() == Some(libc::EPERM)
}
#[cfg(unix)]
fn terminate_process(pid: u32) -> Result<()> {
let raw_pid = libc::pid_t::try_from(pid)
.with_context(|| format!("pid-managed app server pid {pid} is out of range"))?;
@@ -549,7 +493,6 @@ fn terminate_process(pid: u32) -> Result<()> {
Err(err).with_context(|| format!("failed to terminate pid-managed app server {pid}"))
}
#[cfg(unix)]
fn force_terminate_process(pid: u32) -> Result<()> {
let raw_pid = libc::pid_t::try_from(pid)
.with_context(|| format!("pid-managed app server pid {pid} is out of range"))?;
@@ -564,7 +507,6 @@ fn force_terminate_process(pid: u32) -> Result<()> {
Err(err).with_context(|| format!("failed to force terminate pid-managed app server {pid}"))
}
#[cfg(unix)]
fn terminate_process_group(pid: u32) -> Result<()> {
let raw_pid = libc::pid_t::try_from(pid)
.with_context(|| format!("pid-managed updater pid {pid} is out of range"))?;
@@ -579,7 +521,6 @@ fn terminate_process_group(pid: u32) -> Result<()> {
Err(err).with_context(|| format!("failed to terminate pid-managed updater group {pid}"))
}
#[cfg(unix)]
fn force_terminate_process_group(pid: u32) -> Result<()> {
let raw_pid = libc::pid_t::try_from(pid)
.with_context(|| format!("pid-managed updater pid {pid} is out of range"))?;
@@ -594,29 +535,12 @@ fn force_terminate_process_group(pid: u32) -> Result<()> {
Err(err).with_context(|| format!("failed to force terminate pid-managed updater group {pid}"))
}
#[cfg(not(any(unix, windows)))]
fn terminate_process(_pid: u32) -> Result<()> {
bail!("pid-managed app-server shutdown is unsupported on this platform")
}
#[cfg(not(any(unix, windows)))]
fn force_terminate_process(_pid: u32) -> Result<()> {
bail!("pid-managed app-server shutdown is unsupported on this platform")
}
#[cfg(not(any(unix, windows)))]
fn force_terminate_process_group(_pid: u32) -> Result<()> {
bail!("pid-managed updater shutdown is unsupported on this platform")
}
#[cfg(unix)]
async fn process_matches_record(record: &PidRecord) -> Result<bool> {
if !process_exists(record.pid) {
return Ok(false);
}
let details = async {
#[cfg(any(target_os = "linux", target_os = "macos"))]
if let Some(expected) = &record.process_identity {
return expected.matches_process(record.pid).await;
}
@@ -652,20 +576,13 @@ async fn process_matches_record(record: &PidRecord) -> Result<bool> {
}
}
#[cfg(not(any(unix, windows)))]
async fn process_matches_record(_record: &PidRecord) -> Result<bool> {
Ok(false)
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(not(any(unix, windows)), allow(dead_code))]
enum EmptyPidReservation {
Active,
Stale,
Record(PidRecord),
}
#[cfg(unix)]
fn try_lock_file(file: &fs::File) -> Result<bool> {
use std::os::fd::AsRawFd;
@@ -681,12 +598,6 @@ fn try_lock_file(file: &fs::File) -> Result<bool> {
Err(err).context("failed to lock pid reservation")
}
#[cfg(not(any(unix, windows)))]
fn try_lock_file(_file: &fs::File) -> Result<bool> {
bail!("pid-managed app-server startup is unsupported on this platform")
}
#[cfg(any(unix, windows))]
async fn reservation_lock_is_active(path: &Path) -> Result<bool> {
let file = match fs::OpenOptions::new()
.write(true)
@@ -707,12 +618,10 @@ async fn reservation_lock_is_active(path: &Path) -> Result<bool> {
probe_reservation_lock(file)
}
#[cfg(any(unix, windows))]
fn probe_reservation_lock(file: fs::File) -> Result<bool> {
if !try_lock_file(&file)? {
return Ok(true);
}
#[cfg(unix)]
{
use std::os::fd::AsRawFd;
@@ -726,12 +635,6 @@ fn probe_reservation_lock(file: fs::File) -> Result<bool> {
Ok(false)
}
#[cfg(not(any(unix, windows)))]
async fn reservation_lock_is_active(_path: &Path) -> Result<bool> {
Ok(false)
}
#[cfg(any(unix, windows))]
async fn inspect_empty_pid_reservation(
pid_path: &Path,
lock_path: &Path,
@@ -753,10 +656,8 @@ async fn inspect_empty_pid_reservation(
inspect_empty_pid_reservation_with_file(pid_path, file).await
}
#[cfg(unix)]
struct EmptyPidProbeLock(fs::File);
#[cfg(unix)]
impl Drop for EmptyPidProbeLock {
fn drop(&mut self) {
use std::os::fd::AsRawFd;
@@ -770,7 +671,6 @@ impl Drop for EmptyPidProbeLock {
}
}
#[cfg(any(unix, windows))]
async fn inspect_empty_pid_reservation_with_file(
pid_path: &Path,
file: fs::File,
@@ -778,7 +678,6 @@ async fn inspect_empty_pid_reservation_with_file(
if !try_lock_file(&file)? {
return Ok(EmptyPidReservation::Active);
}
#[cfg(unix)]
let _probe_lock = EmptyPidProbeLock(file);
let contents = match fs::read_to_string(pid_path).await {
@@ -801,20 +700,10 @@ async fn inspect_empty_pid_reservation_with_file(
Ok(EmptyPidReservation::Record(record))
}
#[cfg(not(any(unix, windows)))]
async fn inspect_empty_pid_reservation(
_pid_path: &Path,
_lock_path: &Path,
) -> Result<EmptyPidReservation> {
Ok(EmptyPidReservation::Stale)
}
#[cfg(unix)]
async fn read_process_start_time(pid: u32) -> Result<String> {
Ok(read_process_details(pid).await?.1)
}
#[cfg(unix)]
async fn read_process_details(pid: u32) -> Result<(String, String)> {
let output = Command::new("ps")
.args(["-p", &pid.to_string(), "-o", "stat=", "-o", "lstart="])
@@ -838,43 +727,9 @@ async fn read_process_details(pid: u32) -> Result<(String, String)> {
Ok((state.to_string(), start_time.to_string()))
}
#[cfg(all(test, any(unix, windows)))]
#[cfg(test)]
#[path = "pid_tests.rs"]
mod tests;
#[cfg(windows)]
use super::windows::try_lock_file;
#[cfg(windows)]
async fn read_process_start_time(pid: u32) -> Result<String> {
super::windows::Process::open(pid)?
.context("daemon process exited during startup")?
.start_time()
}
#[cfg(windows)]
async fn process_matches_record(record: &PidRecord) -> Result<bool> {
let Some(process) = super::windows::Process::open(record.pid)? else {
return Ok(false);
};
Ok(process.is_running()? && process.start_time()? == record.process_start_time)
}
#[cfg(windows)]
fn force_terminate_process(pid: u32) -> Result<()> {
if let Some(process) = super::windows::Process::open(pid)? {
process.terminate()?;
}
Ok(())
}
#[cfg(windows)]
use force_terminate_process as terminate_process;
#[cfg(windows)]
#[path = "pid_windows.rs"]
mod windows;
#[cfg(any(unix, windows))]
#[path = "pid_start.rs"]
mod start;
@@ -1,9 +1,7 @@
//! Native process identities and zombie state, independent of locale and timezone.
//! Boot IDs prevent records surviving reboot from matching reused process identifiers.
#[cfg(any(target_os = "linux", target_os = "macos", test))]
use anyhow::Context;
#[cfg(any(target_os = "linux", target_os = "macos", test))]
use anyhow::Result;
use serde::Deserialize;
use serde::Serialize;
@@ -28,7 +26,6 @@ pub(super) enum ProcessIdentity {
},
}
#[cfg(any(target_os = "linux", target_os = "macos"))]
impl ProcessIdentity {
pub(super) async fn matches_process(&self, pid: u32) -> Result<(bool, bool)> {
// A different boot proves staleness even when the reused PID is inaccessible.
@@ -65,7 +62,6 @@ impl ProcessIdentity {
}
}
#[cfg(any(target_os = "linux", target_os = "macos"))]
impl super::PidBackend {
pub(crate) async fn promote_legacy_identity(&self) -> Result<()> {
let _reservation = self.acquire_reservation_lock().await?;
@@ -25,7 +25,6 @@ fn reads_earlier_linux_identity_field() {
assert_eq!(serde_json::to_value(record).unwrap(), expected);
}
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[tokio::test]
async fn previous_boot_does_not_require_process_inspection() {
let (_, identity) = super::read_process_details(std::process::id())
@@ -4,8 +4,6 @@
//! Recover a deleted Unix cwd without changing workspace defaults for usable directories.
use super::PidBackend;
#[cfg(windows)]
use super::PidCommandKind;
use super::PidFileState;
use super::PidRecord;
use super::read_process_start_time;
@@ -20,28 +18,11 @@ use tokio::process::Command;
impl PidBackend {
pub(super) async fn start_inner(&self, replacement: Option<PidRecord>) -> Result<Option<u32>> {
#[cfg(windows)]
crate::backend::windows::ensure_not_elevated()?;
if let Some(parent) = self.pid_file.parent() {
codex_uds::prepare_private_socket_directory(parent)
.await
.with_context(|| format!("failed to create pid directory {}", parent.display()))?;
}
#[cfg(windows)]
let workdir = {
let workdir = self
.pid_file
.parent()
.context("daemon pid path has no parent")?
.join("workdir");
fs::create_dir_all(&workdir).await.with_context(|| {
format!(
"failed to create daemon working directory {}",
workdir.display()
)
})?;
workdir
};
let reservation_lock = self.acquire_reservation_lock().await?;
loop {
match fs::OpenOptions::new()
@@ -158,7 +139,6 @@ impl PidBackend {
.context("daemon pid path has no parent")?,
)?;
#[cfg(unix)]
{
unsafe {
command.pre_exec(|| {
@@ -170,50 +150,7 @@ impl PidBackend {
}
}
#[cfg(windows)]
{
use windows_sys::Win32::System::Threading::CREATE_BREAKAWAY_FROM_JOB;
use windows_sys::Win32::System::Threading::CREATE_NO_WINDOW;
use windows_sys::Win32::System::Threading::DETACHED_PROCESS;
// A Windows process pins its working directory for its lifetime.
// Keep both managed children out of the launching project's directory.
// Sandbox setup may broaden the cwd ACL, so do not use the private state directory.
command.current_dir(&workdir);
// Never retry inside the parent's Job Object: that would report a
// successful launch that dies when the terminal/SSH session closes.
command.creation_flags(CREATE_NO_WINDOW | DETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOB);
if matches!(self.command_kind, PidCommandKind::UpdateLoop { .. }) {
match fs::remove_file(self.pid_file.with_extension("ready")).await {
Ok(()) => {}
Err(err) if err.kind() == std::io::ErrorKind::NotFound => {}
Err(err) => return Err(err).context("failed to clear updater readiness"),
}
}
match self.command_kind {
PidCommandKind::AppServer { .. } => {
command.env(codex_app_server_transport::DAEMON_SHUTDOWN_SOCKET_ENV, "1");
}
PidCommandKind::UpdateLoop { .. } => {
let shutdown_file = self.pid_file.with_extension("shutdown");
match fs::remove_file(&shutdown_file).await {
Ok(()) => {}
Err(err) if err.kind() == std::io::ErrorKind::NotFound => {}
Err(err) => {
return Err(err).context("failed to clear updater shutdown request");
}
}
command.env(
codex_app_server_transport::DAEMON_SHUTDOWN_FILE_ENV,
shutdown_file,
);
}
}
}
let started = std::time::Instant::now();
#[cfg(windows)]
let child = super::super::windows::spawn_without_inheriting_stdio(&mut command);
#[cfg(not(windows))]
let child = command.spawn().map_err(anyhow::Error::from);
let child = crate::diagnostics::result("process_spawn", started, child);
let mut child = match child {
@@ -223,11 +160,7 @@ impl PidBackend {
let _ = fs::remove_file(&self.pid_file).await;
}
return Err(err).with_context(|| {
let job_hint = if cfg!(windows) {
" (the Windows host job must allow breakaway)"
} else {
""
};
let job_hint = "";
StartFailure::Spawn(format!(
"failed to spawn detached app-server process using {}{job_hint}",
self.codex_bin.display()
@@ -242,13 +175,10 @@ impl PidBackend {
let started = std::time::Instant::now();
let record = async {
let process_start_time = read_process_start_time(pid).await?;
#[cfg(any(target_os = "linux", target_os = "macos"))]
let process_identity = super::identity::read_process_details(pid)
.await
.ok()
.map(|(_, identity)| identity);
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
let process_identity = None;
anyhow::Ok(PidRecord {
pid,
process_start_time,
@@ -312,11 +242,6 @@ impl PidBackend {
format!("failed to publish pid file {}", self.pid_file.display())
});
}
#[cfg(windows)]
if matches!(self.command_kind, PidCommandKind::UpdateLoop { .. }) {
self.finish_updater_start(&record, replacement.as_ref())
.await?;
}
drop(reservation_lock);
Ok(Some(pid))
}
@@ -1,10 +1,8 @@
#[cfg(any(unix, windows))]
use std::process::Stdio;
use std::time::Duration;
use pretty_assertions::assert_eq;
use tempfile::TempDir;
#[cfg(any(unix, windows))]
use tokio::time::sleep;
use codex_app_server_transport::REMOTE_CONTROL_DISABLED_ENV_VAR;
@@ -14,33 +12,11 @@ use super::PidCommandKind;
use super::PidFileState;
use super::PidLogTail;
use super::PidRecord;
#[cfg(unix)]
use super::read_process_start_time;
use super::read_stderr_log_tail;
use super::stderr_log_file_for_pid_file;
use super::try_lock_file;
#[cfg(windows)]
fn is_elevated_test_process() -> anyhow::Result<bool> {
let output = std::process::Command::new("powershell.exe")
.args([
"-NoProfile",
"-NonInteractive",
"-Command",
"[Security.Principal.WindowsPrincipal]::new([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)",
])
.output()?;
anyhow::ensure!(
output.status.success(),
"administrator membership query failed"
);
match String::from_utf8(output.stdout)?.trim() {
"True" => Ok(true),
"False" => Ok(false),
other => anyhow::bail!("unexpected administrator membership: {other}"),
}
}
#[tokio::test]
async fn locked_empty_pid_file_is_treated_as_active_reservation() {
let temp_dir = TempDir::new().expect("temp dir");
@@ -100,7 +76,6 @@ async fn unlocked_empty_pid_file_is_treated_as_stale_reservation() {
assert!(!pid_file.exists());
}
#[cfg(unix)]
#[test]
fn reservation_probe_releases_lock_with_duplicated_handle() {
#[derive(Debug, Clone, Copy)]
@@ -259,16 +234,6 @@ async fn start_retries_stale_empty_pid_file_under_its_own_lock() {
);
let err = backend.start().await.expect_err("start");
#[cfg(windows)]
if is_elevated_test_process().expect("query administrator membership") {
assert!(err.to_string().contains("non-elevated terminal"));
assert_eq!(
tokio::fs::read(&backend.pid_file).await.unwrap(),
Vec::<u8>::new()
);
assert!(!backend.lock_file.exists());
return;
}
assert!(
err.to_string()
.starts_with("failed to spawn detached app-server process using ")
@@ -279,7 +244,6 @@ async fn start_retries_stale_empty_pid_file_under_its_own_lock() {
);
}
#[cfg(unix)]
#[tokio::test]
async fn legacy_launch_clears_recovery_best_effort() {
for snapshot_is_directory in [false, true] {
@@ -346,7 +310,6 @@ async fn stale_record_cleanup_preserves_replacement_record() {
);
}
#[cfg(unix)]
#[tokio::test]
async fn pid_record_captures_the_resolved_launch_binary() {
let temp = TempDir::new().expect("temp dir");
@@ -396,7 +359,6 @@ async fn pid_record_captures_the_resolved_launch_binary() {
backend.stop().await.expect("stop daemon");
}
#[cfg(unix)]
#[tokio::test]
async fn legacy_start_time_mismatch_preserves_record_and_process() {
let temp = TempDir::new().unwrap();
@@ -428,7 +390,6 @@ async fn legacy_start_time_mismatch_preserves_record_and_process() {
assert_eq!(std::fs::read(&backend.pid_file).unwrap(), contents);
}
#[cfg(unix)]
#[tokio::test]
async fn stop_reaps_untracked_app_server_child() {
let temp_dir = TempDir::new().expect("temp dir");
@@ -470,28 +431,18 @@ async fn stop_reaps_untracked_app_server_child() {
assert!(!pid_file.exists());
}
#[cfg(any(unix, windows))]
#[tokio::test]
async fn shutdown_grace_child() {
let Some(ready) = std::env::var_os("CODEX_TEST_SHUTDOWN_GRACE_READY") else {
return;
};
let ready = std::path::PathBuf::from(ready);
#[cfg(unix)]
let mut terminate = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())
.expect("install shutdown handler");
tokio::fs::write(&ready, "").await.expect("ready marker");
// Outlive the parent's stop deadline so this watchdog cannot look like a forced stop.
let _ = tokio::time::timeout(Duration::from_secs(/*secs*/ 30), async {
#[cfg(unix)]
terminate.recv().await;
#[cfg(windows)]
loop {
if ready.with_extension("shutdown").exists() {
break;
}
sleep(Duration::from_millis(10)).await;
}
if std::env::var_os("CODEX_TEST_SHUTDOWN_GRACE_EXIT").is_some() {
sleep(Duration::from_millis(150)).await;
tokio::fs::write(ready.with_extension("exited"), "")
@@ -504,7 +455,6 @@ async fn shutdown_grace_child() {
.await;
}
#[cfg(any(unix, windows))]
#[tokio::test]
async fn shutdown_grace_handles_process_exit() {
let temp = TempDir::new().expect("temp dir");
@@ -546,18 +496,11 @@ async fn shutdown_grace_handles_process_exit() {
)
.await
.expect("write pid file");
#[cfg(unix)]
let backend = PidBackend::new(
temp.path().join("codex"),
pid_file,
/*remote_control_enabled*/ false,
);
#[cfg(windows)]
let backend = PidBackend::new_update_loop(
temp.path().join("codex"),
pid_file,
/*restore_release*/ None,
);
// Cover the backend's full stop budget, plus scheduling headroom on busy runners.
let stop_timeout =
super::STOP_FORCE_TIMEOUT + Duration::from_secs(u64::from(grace_seconds) + 5);
@@ -577,7 +520,6 @@ async fn shutdown_grace_handles_process_exit() {
}
}
#[cfg(unix)]
#[tokio::test]
async fn stopping_updater_signals_its_installer_process_group() {
use std::os::unix::process::CommandExt;
@@ -644,7 +586,6 @@ async fn stopping_updater_signals_its_installer_process_group() {
}
}
#[cfg(unix)]
#[tokio::test]
async fn exited_unreaped_updater_is_reaped() {
let temp = TempDir::new().expect("temp dir");
@@ -652,15 +593,12 @@ async fn exited_unreaped_updater_is_reaped() {
.arg("60")
.spawn()
.expect("spawn updater shim");
#[cfg(any(target_os = "linux", target_os = "macos"))]
let process_identity = Some(
super::identity::read_process_details(child.id())
.await
.unwrap()
.1,
);
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
let process_identity = None;
let record = PidRecord {
pid: child.id(),
process_start_time: read_process_start_time(child.id())
@@ -783,7 +721,6 @@ async fn stale_creation_time_never_stops_reused_pid() {
temp.path().join("server.pid"),
/*remote_control_enabled*/ false,
);
#[cfg(any(target_os = "linux", target_os = "macos"))]
let identities = {
use super::identity::ProcessIdentity;
let (_, identity) = super::identity::read_process_details(std::process::id())
@@ -807,8 +744,6 @@ async fn stale_creation_time_never_stops_reused_pid() {
}
[Some(stale_time), Some(stale_epoch)]
};
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
let identities = [None];
for process_identity in identities {
let record = PidRecord {
pid: std::process::id(),
@@ -824,311 +759,6 @@ async fn stale_creation_time_never_stops_reused_pid() {
}
}
#[cfg(windows)]
#[tokio::test]
async fn managed_children_launch_in_workdir_without_changing_private_state_directory() {
if is_elevated_test_process().expect("query administrator membership") {
return;
}
let temp = TempDir::new().expect("temp dir");
let state_dir = temp.path().join("state");
let codex_bin = temp.path().join("codex.cmd");
tokio::fs::write(
&codex_bin,
"@echo off\r\n\
if \"%3\"==\"--help\" exit /b 1\r\n\
echo ready > launched.cwd\r\n\
if defined CODEX_DAEMON_SHUTDOWN_FILE (for %%F in (\"%CODEX_DAEMON_SHUTDOWN_FILE%\") do type nul > \"%%~dpnF.ready\")\r\n\
for /l %%i in (1,1,10000000) do @rem\r\n",
)
.await
.expect("write daemon fixture");
let backends = [
PidBackend::new(
codex_bin.clone(),
state_dir.join("app-server.pid"),
/*remote_control_enabled*/ false,
),
PidBackend::new_update_loop(
codex_bin,
state_dir.join("updater.pid"),
/*restore_release*/ None,
),
];
for backend in backends {
backend.start().await.expect("launch managed child");
let marker = state_dir.join("workdir/launched.cwd");
let launched_in_workdir = tokio::time::timeout(Duration::from_secs(5), async {
while !marker.exists() {
sleep(Duration::from_millis(10)).await;
}
})
.await;
backend
.stop_with_grace(/*grace_seconds*/ 0)
.await
.expect("stop managed child");
launched_in_workdir.expect("child did not write its relative marker in workdir");
codex_uds::prepare_private_socket_directory(&state_dir)
.await
.expect("state directory remains private");
assert!(!backend.pid_file.exists());
tokio::fs::remove_file(marker)
.await
.expect("remove marker before next child launch");
}
}
#[cfg(windows)]
#[tokio::test]
async fn failed_updater_handoff_preserves_predecessor_record() {
let elevated = is_elevated_test_process().expect("query administrator membership");
let temp = TempDir::new().expect("temp");
let state_dir = temp.path().join("state");
codex_uds::prepare_private_socket_directory(&state_dir)
.await
.expect("private state directory");
let backend = PidBackend::new_update_loop(
temp.path().join("missing-codex.exe"),
state_dir.join("updater.pid"),
/*restore_release*/ None,
);
let record = PidRecord {
pid: std::process::id(),
process_start_time: super::read_process_start_time(std::process::id())
.await
.unwrap(),
process_identity: None,
executable_identity: None,
};
for record in [
record.clone(),
PidRecord {
process_start_time: "stale".into(),
..record
},
] {
tokio::fs::write(&backend.pid_file, serde_json::to_vec(&record).unwrap())
.await
.unwrap();
let error = backend.replace_current_updater().await.unwrap_err();
if elevated {
assert!(error.to_string().contains("non-elevated terminal"));
} else {
// Windows may reject breakaway before reporting the missing executable.
// Both must reach process I/O rather than rejecting stale ownership.
assert!(error.root_cause().is::<std::io::Error>(), "{error:#}");
}
assert_eq!(
backend.read_pid_file_state().await.unwrap(),
PidFileState::Running(record)
);
}
}
#[cfg(windows)]
#[tokio::test]
async fn updater_readiness_and_post_publication_failure_preserve_ownership() {
use futures::FutureExt;
use tokio::io::AsyncWriteExt;
use windows_sys::Win32::Security::ImpersonateAnonymousToken;
use windows_sys::Win32::Security::RevertToSelf;
use windows_sys::Win32::System::Threading::GetCurrentThread;
let temp = TempDir::new().expect("temp");
let backend = PidBackend::new_update_loop(
temp.path().join("codex.exe"),
temp.path().join("updater.pid"),
/*restore_release*/ None,
);
let _lock = backend
.acquire_reservation_lock()
.await
.expect("reservation lock");
let mut predecessor_stderr = backend.open_stderr_log().await.expect("predecessor log");
predecessor_stderr
.write_all(&vec![b'x'; 512 * 1024])
.await
.unwrap();
predecessor_stderr.flush().await.unwrap();
let successor_stderr = backend.open_stderr_log().await.expect("successor log");
let ready = backend.pid_file.with_extension("ready");
let mut child = tokio::process::Command::new("powershell.exe")
.args([
"-NoProfile",
"-NonInteractive",
"-Command",
"[Console]::Error.WriteLine('successor startup'); [IO.File]::WriteAllText($env:CODEX_TEST_UPDATER_READY, ''); Start-Sleep 60",
])
.env("CODEX_TEST_UPDATER_READY", &ready)
.stderr(Stdio::from(successor_stderr.into_std().await))
.creation_flags(windows_sys::Win32::System::Threading::CREATE_NO_WINDOW)
.kill_on_drop(true)
.spawn()
.expect("successor fixture");
let pid = child.id().expect("pid");
let successor = PidRecord {
pid,
process_start_time: super::read_process_start_time(pid)
.await
.expect("creation time"),
process_identity: None,
executable_identity: None,
};
let predecessor = PidRecord {
pid: std::process::id(),
process_start_time: super::read_process_start_time(std::process::id())
.await
.expect("creation time"),
process_identity: None,
executable_identity: None,
};
tokio::fs::write(&backend.pid_file, serde_json::to_vec(&successor).unwrap())
.await
.unwrap();
backend
.finish_updater_start(&successor, Some(&predecessor))
.await
.expect("ready successor");
predecessor_stderr
.write_all(b"predecessor handoff complete\n")
.await
.unwrap();
predecessor_stderr.flush().await.unwrap();
let log_path = stderr_log_file_for_pid_file(&backend.pid_file);
let log = tokio::fs::read(&log_path).await.unwrap();
assert!(log.len() < 256 * 1024);
let log = String::from_utf8(log).expect("no stale-offset gap");
assert!(log.contains("successor startup"));
assert!(log.contains("predecessor handoff complete"));
assert!(!ready.exists());
assert_eq!(
backend.read_pid_file_state().await.unwrap(),
PidFileState::Running(successor.clone())
);
// If cleanup cannot even query the successor, leave its ownership intact.
std::thread::scope(|scope| {
scope
.spawn(|| {
assert_ne!(unsafe { ImpersonateAnonymousToken(GetCurrentThread()) }, 0);
let result = backend
.finish_updater_start(&successor, Some(&predecessor))
.now_or_never();
let reverted = unsafe { RevertToSelf() };
assert_ne!(reverted, 0);
let error = result
.expect("denied cleanup must not suspend")
.unwrap_err();
assert_eq!(
error
.downcast_ref::<std::io::Error>()
.unwrap()
.raw_os_error(),
Some(windows_sys::Win32::Foundation::ERROR_ACCESS_DENIED as i32)
);
})
.join()
.expect("anonymous cleanup check");
});
assert_eq!(
backend.read_pid_file_state().await.unwrap(),
PidFileState::Running(successor.clone())
);
let reused_pid = PidRecord {
process_start_time: "stale".into(),
..successor.clone()
};
assert!(
backend
.finish_updater_start(&reused_pid, Some(&predecessor))
.await
.is_err()
);
assert_eq!(
backend.read_pid_file_state().await.unwrap(),
PidFileState::Running(predecessor.clone())
);
assert!(
child.try_wait().unwrap().is_none(),
"PID reuse must not terminate another process"
);
tokio::fs::write(&backend.pid_file, serde_json::to_vec(&successor).unwrap())
.await
.unwrap();
// An invalid readiness path triggers cleanup while the successor is alive.
tokio::fs::create_dir(&ready).await.unwrap();
assert!(
backend
.finish_updater_start(&successor, Some(&predecessor))
.await
.is_err()
);
assert!(
child.try_wait().unwrap().is_some(),
"successor must exit before rollback"
);
assert_eq!(
backend.read_pid_file_state().await.unwrap(),
PidFileState::Running(predecessor)
);
}
#[cfg(windows)]
#[test]
fn inaccessible_pid_preserves_identity_check_error() {
use futures::FutureExt;
use windows_sys::Win32::Security::ImpersonateAnonymousToken;
use windows_sys::Win32::Security::RevertToSelf;
use windows_sys::Win32::System::Threading::GetCurrentThread;
// Isolate impersonation from Tokio workers and other tests. Query our own
// process anonymously instead of assuming a system PID is inaccessible.
std::thread::spawn(|| {
let record = PidRecord {
pid: std::process::id(),
process_start_time: "stale".into(),
process_identity: None,
executable_identity: None,
};
assert!(
crate::backend::windows::Process::open(record.pid)
.unwrap()
.is_some()
);
assert_ne!(unsafe { ImpersonateAnonymousToken(GetCurrentThread()) }, 0);
let opened = crate::backend::windows::Process::open(record.pid);
// Windows identity checks are synchronous; never suspend while impersonating.
let matches = super::process_matches_record(&record).now_or_never();
let reverted = unsafe { RevertToSelf() };
assert_ne!(reverted, 0);
let error = match opened {
Err(error) => error,
Ok(_) => panic!("anonymous caller unexpectedly queried the test process"),
};
assert_eq!(
error
.downcast_ref::<std::io::Error>()
.unwrap()
.raw_os_error(),
Some(windows_sys::Win32::Foundation::ERROR_ACCESS_DENIED as i32),
);
assert_eq!(
matches
.expect("identity check must not suspend")
.unwrap_err()
.downcast_ref::<std::io::Error>()
.unwrap()
.raw_os_error(),
Some(windows_sys::Win32::Foundation::ERROR_ACCESS_DENIED as i32),
);
})
.join()
.expect("anonymous identity check");
}
#[tokio::test]
async fn stderr_preservation_failure_does_not_prevent_opening_new_log() -> anyhow::Result<()> {
let home = TempDir::new()?;
@@ -1,119 +0,0 @@
//! Windows updater publication handshake. The predecessor holds the operation
//! and reservation locks until its successor initializes and acknowledges readiness.
use super::super::windows::Process;
use super::PidBackend;
use super::PidFileState;
use super::PidRecord;
use super::START_TIMEOUT;
use super::STOP_POLL_INTERVAL;
use super::process_matches_record;
use super::read_process_start_time;
use anyhow::Context;
use anyhow::Result;
use anyhow::bail;
use tokio::fs;
use tokio::time::sleep;
impl PidBackend {
pub(crate) async fn wait_for_ownership(&self) -> Result<()> {
let deadline = tokio::time::Instant::now() + START_TIMEOUT;
loop {
if let PidFileState::Running(record) = self.read_pid_file_state().await?
&& record.pid == std::process::id()
&& self.record_is_active(&record).await?
{
return Ok(());
}
if tokio::time::Instant::now() >= deadline {
bail!("updater was not published by its launcher");
}
sleep(STOP_POLL_INTERVAL).await;
}
}
pub(crate) async fn mark_ready(&self) -> Result<()> {
fs::write(self.pid_file.with_extension("ready"), b"")
.await
.context("failed to acknowledge updater startup")
}
// Keep pruning excluded until successor startup and any ownership rollback finish.
#[allow(clippy::await_holding_invalid_type)]
pub(crate) async fn replace_current_updater(&self) -> Result<()> {
// Retry busy pruning instead of waiting on the logging worker. Keep it paused
// before open_stderr_log() truncates the shared log and throughout startup.
let mut pruning_enabled = super::super::stderr_log::PRUNING_ENABLED
.try_lock()
.context("stderr pruning is busy; retry updater handoff")?;
let record = PidRecord {
pid: std::process::id(),
process_start_time: read_process_start_time(std::process::id()).await?,
process_identity: None,
executable_identity: None,
};
*pruning_enabled = false;
let result = self.start_inner(Some(record.clone())).await;
// Resume only after ownership is restored. Failed cleanup may leave the
// successor alive, and successful handoff leaves it in charge of retention.
if result.is_err()
&& matches!(
self.read_pid_file_state().await,
Ok(PidFileState::Running(previous)) if previous == record
)
{
*pruning_enabled = true;
}
result?;
Ok(())
}
pub(super) async fn finish_updater_start(
&self,
record: &PidRecord,
replacement: Option<&PidRecord>,
) -> Result<()> {
let temp_pid_file = self.pid_file.with_extension("pid.tmp");
let ready = self.pid_file.with_extension("ready");
let deadline = tokio::time::Instant::now() + START_TIMEOUT;
let startup = async {
loop {
if !process_matches_record(record).await? {
bail!("updater exited before becoming ready");
}
match fs::remove_file(&ready).await {
Ok(()) => return Ok(()),
Err(err) if err.kind() == std::io::ErrorKind::NotFound => {}
Err(err) => return Err(err.into()),
}
if tokio::time::Instant::now() >= deadline {
bail!("updater did not become ready");
}
sleep(STOP_POLL_INTERVAL).await;
}
}
.await;
if let Err(err) = startup {
if let Some(process) = Process::open(record.pid)?
&& process.start_time()? == record.process_start_time
{
process.terminate()?;
let deadline = tokio::time::Instant::now() + START_TIMEOUT;
while process.is_running()? {
if tokio::time::Instant::now() >= deadline {
bail!("failed updater did not exit; ownership was not restored");
}
sleep(STOP_POLL_INTERVAL).await;
}
}
if let Some(previous) = replacement {
fs::write(&temp_pid_file, serde_json::to_vec(previous)?).await?;
fs::rename(&temp_pid_file, &self.pid_file).await?;
} else {
let _ = fs::remove_file(&self.pid_file).await;
}
return Err(err);
}
Ok(())
}
}
@@ -104,7 +104,6 @@ impl Write for LogFile {
}
}
#[cfg(unix)]
fn enable_append() -> io::Result<()> {
use std::os::fd::AsRawFd;
@@ -121,47 +120,6 @@ fn enable_append() -> io::Result<()> {
Ok(())
}
#[cfg(windows)]
fn enable_append() -> io::Result<()> {
use std::os::windows::io::AsRawHandle;
use std::os::windows::io::FromRawHandle;
use std::os::windows::io::IntoRawHandle;
use std::os::windows::io::OwnedHandle;
use windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE;
use windows_sys::Win32::Storage::FileSystem::FILE_GENERIC_WRITE;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_DELETE;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_READ;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_WRITE;
use windows_sys::Win32::Storage::FileSystem::FILE_WRITE_DATA;
use windows_sys::Win32::Storage::FileSystem::ReOpenFile;
use windows_sys::Win32::System::Console::STD_ERROR_HANDLE;
use windows_sys::Win32::System::Console::SetStdHandle;
let stderr = std::io::stderr();
// SAFETY: stderr is borrowed and remains open; reopening does not truncate it.
let handle = unsafe {
ReOpenFile(
stderr.as_raw_handle(),
// Append-only access makes writes follow EOF after truncation.
FILE_GENERIC_WRITE & !FILE_WRITE_DATA,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
/*dwflagsandattributes*/ 0,
)
};
if handle == INVALID_HANDLE_VALUE {
return Err(io::Error::last_os_error());
}
// SAFETY: ReOpenFile returned a new, valid handle owned by this function.
let handle = unsafe { OwnedHandle::from_raw_handle(handle) };
// SAFETY: the append handle is valid and retained for the process lifetime on success.
if unsafe { SetStdHandle(STD_ERROR_HANDLE, handle.as_raw_handle()) } == 0 {
return Err(io::Error::last_os_error());
}
// The process owns its new stderr. Keep the borrowed original valid for cached users.
let _ = handle.into_raw_handle();
Ok(())
}
fn prune(path: &Path, pruning_enabled: &Mutex<bool>) -> io::Result<()> {
let Ok(enabled) = pruning_enabled.try_lock() else {
return Ok(());
@@ -4,7 +4,6 @@ use super::preserve;
use super::prune;
use pretty_assertions::assert_eq;
#[cfg(any(unix, windows))]
#[tokio::test]
async fn pruning_resets_the_write_position_of_a_legacy_nonappend_writer() -> anyhow::Result<()> {
use std::io::Write;
@@ -1,327 +0,0 @@
//! Windows process identity and file locks. Keep a process handle across shutdown
//! so PID reuse can never redirect forced termination to a different process.
//! Managed servers must not elevate ordinary clients sharing the account's socket.
//! Installer jobs contain extraction processes when an update is cancelled.
//! Detached launches stop the launcher's original stdio handles from propagating.
//! Launch probes distinguish job restrictions from other failures without running the binary.
use std::fmt;
use std::io;
use std::os::windows::io::AsRawHandle;
use std::os::windows::io::FromRawHandle;
use std::os::windows::io::OwnedHandle;
use std::os::windows::process::CommandExt;
use std::path::Path;
use std::process::Command;
use std::process::Stdio;
use anyhow::Context;
use anyhow::Result;
use windows_sys::Win32::Foundation::ERROR_ACCESS_DENIED;
use windows_sys::Win32::Foundation::ERROR_INVALID_HANDLE;
use windows_sys::Win32::Foundation::ERROR_INVALID_PARAMETER;
use windows_sys::Win32::Foundation::ERROR_LOCK_VIOLATION;
use windows_sys::Win32::Foundation::FILETIME;
use windows_sys::Win32::Foundation::HANDLE;
use windows_sys::Win32::Foundation::HANDLE_FLAG_INHERIT;
use windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE;
use windows_sys::Win32::Foundation::SetHandleInformation;
use windows_sys::Win32::Foundation::WAIT_OBJECT_0;
use windows_sys::Win32::Foundation::WAIT_TIMEOUT;
use windows_sys::Win32::Security::GetTokenInformation;
use windows_sys::Win32::Security::TOKEN_ELEVATION;
use windows_sys::Win32::Security::TOKEN_QUERY;
use windows_sys::Win32::Security::TokenElevation;
use windows_sys::Win32::Storage::FileSystem::LOCKFILE_EXCLUSIVE_LOCK;
use windows_sys::Win32::Storage::FileSystem::LOCKFILE_FAIL_IMMEDIATELY;
use windows_sys::Win32::Storage::FileSystem::LockFileEx;
use windows_sys::Win32::System::JobObjects::AssignProcessToJobObject;
use windows_sys::Win32::System::JobObjects::CreateJobObjectW;
use windows_sys::Win32::System::JobObjects::JOB_OBJECT_LIMIT_BREAKAWAY_OK;
use windows_sys::Win32::System::JobObjects::JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
use windows_sys::Win32::System::JobObjects::JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
use windows_sys::Win32::System::JobObjects::JobObjectExtendedLimitInformation;
use windows_sys::Win32::System::JobObjects::SetInformationJobObject;
use windows_sys::Win32::System::Threading::CREATE_BREAKAWAY_FROM_JOB;
use windows_sys::Win32::System::Threading::CREATE_SUSPENDED;
use windows_sys::Win32::System::Threading::DETACHED_PROCESS;
use windows_sys::Win32::System::Threading::GetCurrentProcess;
use windows_sys::Win32::System::Threading::GetProcessId;
use windows_sys::Win32::System::Threading::GetProcessTimes;
use windows_sys::Win32::System::Threading::OpenProcess;
use windows_sys::Win32::System::Threading::OpenProcessToken;
use windows_sys::Win32::System::Threading::PROCESS_ACCESS_RIGHTS;
use windows_sys::Win32::System::Threading::PROCESS_QUERY_LIMITED_INFORMATION;
use windows_sys::Win32::System::Threading::PROCESS_SYNCHRONIZE;
use windows_sys::Win32::System::Threading::PROCESS_TERMINATE;
use windows_sys::Win32::System::Threading::TerminateProcess;
use windows_sys::Win32::System::Threading::WaitForSingleObject;
pub(super) fn spawn_without_inheriting_stdio(
command: &mut tokio::process::Command,
) -> Result<tokio::process::Child> {
// The daemon must not inherit the launcher's output pipes: callers wait for
// them to close after the launcher exits. Leave the flags cleared so concurrent
// launches cannot inherit them either; Rust duplicates the child's chosen stdio.
for (name, handle) in [
("stdin", io::stdin().as_raw_handle()),
("stdout", io::stdout().as_raw_handle()),
("stderr", io::stderr().as_raw_handle()),
] {
if handle.is_null() || handle == INVALID_HANDLE_VALUE {
continue;
}
// SAFETY: these are borrowed standard handles; changing the inherit
// flag neither closes them nor changes their read/write access.
if unsafe {
SetHandleInformation(handle, HANDLE_FLAG_INHERIT, /*dwflags*/ 0)
} == 0
{
let error = io::Error::last_os_error();
// An already-closed handle cannot be inherited.
if error.raw_os_error() == Some(ERROR_INVALID_HANDLE as i32) {
continue;
}
return Err(error)
.with_context(|| format!("failed to clear launcher {name} inheritance"));
}
}
Ok(command.spawn()?)
}
/// Reports whether this process has administrator privileges, rather than
/// merely belonging to an administrator account.
pub fn is_elevated() -> Result<bool> {
let mut token = std::ptr::null_mut();
if unsafe { OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &mut token) } == 0 {
return Err(io::Error::last_os_error()).context("failed to query daemon launcher token");
}
let token = unsafe { OwnedHandle::from_raw_handle(token) };
let mut elevation: TOKEN_ELEVATION = unsafe { std::mem::zeroed() };
let mut returned = 0;
if unsafe {
GetTokenInformation(
token.as_raw_handle(),
TokenElevation,
(&mut elevation as *mut TOKEN_ELEVATION).cast(),
std::mem::size_of::<TOKEN_ELEVATION>() as u32,
&mut returned,
)
} == 0
{
return Err(io::Error::last_os_error())
.context("failed to query daemon launcher elevation");
}
Ok(elevation.TokenIsElevated != 0)
}
pub(crate) fn ensure_not_elevated() -> Result<()> {
anyhow::ensure!(
!is_elevated()?,
"start the Windows daemon from a non-elevated terminal; shared clients must not inherit administrator privileges"
);
Ok(())
}
/// A launch that only fails when asked to leave the launcher's Windows job.
/// Automatic CLI startup may use its embedded server; lifecycle operations
/// must still return this error before stopping an existing daemon.
#[derive(Debug)]
pub struct DetachedLaunchRestricted;
impl fmt::Display for DetachedLaunchRestricted {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(
"this Windows launcher prevents background processes from outliving it (for example, cargo run); build and run codex.exe directly to use the background server",
)
}
}
// Check that breakaway launch is permitted before stopping an existing daemon.
// An outer system job may remain attached; membership alone does not establish
// whether it will terminate the daemon. Suspend the probe before cleanup.
pub(crate) fn ensure_detached_launch(executable: &Path) -> Result<()> {
let mut command = Command::new(executable);
command
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.creation_flags(CREATE_SUSPENDED | DETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOB);
let (mut child, launch_result) = match command.spawn() {
Ok(child) => (child, Ok(())),
Err(err) if err.raw_os_error() == Some(ERROR_ACCESS_DENIED as i32) => {
// Access denied can also mean the file cannot be executed. Only
// classify a job restriction if removing breakaway makes it work.
// This diagnostic child stays suspended and is always reaped.
command.creation_flags(CREATE_SUSPENDED | DETACHED_PROCESS);
let child = match command.spawn() {
Ok(child) => child,
Err(_) => {
return Err(err).context(crate::telemetry::StartFailure::Spawn(
"cannot launch detached daemon".into(),
));
}
};
(child, Err(err).context(DetachedLaunchRestricted))
}
Err(err) => {
return Err(err).context(crate::telemetry::StartFailure::Spawn(
"cannot launch detached daemon".into(),
));
}
};
child
.kill()
.context("failed to terminate suspended launch probe")?;
child
.wait()
.context("failed to reap suspended launch probe")?;
launch_result
}
pub(super) struct Process(OwnedHandle);
impl Process {
pub(super) fn open(pid: u32) -> Result<Option<Self>> {
Self::open_with_access(pid, PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_SYNCHRONIZE)
}
fn open_with_access(pid: u32, access: PROCESS_ACCESS_RIGHTS) -> Result<Option<Self>> {
let handle = unsafe {
OpenProcess(access, /*binherithandle*/ 0, pid)
};
if handle.is_null() {
let err = io::Error::last_os_error();
return if err.raw_os_error() == Some(ERROR_INVALID_PARAMETER as i32) {
Ok(None)
} else {
Err(err).context("failed to open daemon process")
};
}
Ok(Some(Self(unsafe { OwnedHandle::from_raw_handle(handle) })))
}
pub(super) fn start_time(&self) -> Result<String> {
let mut created: FILETIME = unsafe { std::mem::zeroed() };
let mut exited = created;
let mut kernel = created;
let mut user = created;
if unsafe {
GetProcessTimes(
self.0.as_raw_handle(),
&mut created,
&mut exited,
&mut kernel,
&mut user,
)
} == 0
{
return Err(io::Error::last_os_error()).context("failed to query daemon creation time");
}
Ok(
((u64::from(created.dwHighDateTime) << 32) | u64::from(created.dwLowDateTime))
.to_string(),
)
}
pub(super) fn is_running(&self) -> Result<bool> {
match unsafe {
WaitForSingleObject(self.0.as_raw_handle(), /*dwmilliseconds*/ 0)
} {
WAIT_TIMEOUT => Ok(true),
WAIT_OBJECT_0 => Ok(false),
_ => Err(io::Error::last_os_error()).context("failed to wait for daemon process"),
}
}
pub(super) fn terminate(&self) -> Result<()> {
if !self.is_running()? {
return Ok(());
}
let pid = unsafe { GetProcessId(self.0.as_raw_handle()) };
let Some(target) = Self::open_with_access(
pid,
PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_SYNCHRONIZE | PROCESS_TERMINATE,
)?
else {
return Ok(());
};
// Keep the original identity handle alive and validate the handle that
// will actually be terminated, rather than trusting a second PID lookup.
if target.start_time()? != self.start_time()? || !target.is_running()? {
return Ok(());
}
if unsafe {
TerminateProcess(target.0.as_raw_handle(), /*uexitcode*/ 1)
} == 0
{
return Err(io::Error::last_os_error()).context("failed to terminate daemon process");
}
Ok(())
}
}
pub(crate) fn try_lock_file(file: &tokio::fs::File) -> Result<bool> {
let mut overlapped = unsafe { std::mem::zeroed() };
if unsafe {
LockFileEx(
file.as_raw_handle(),
LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY,
/*dwreserved*/ 0,
/*nnumberofbytestolocklow*/ 1,
/*nnumberofbytestolockhigh*/ 0,
&mut overlapped,
)
} != 0
{
return Ok(true);
}
let err = io::Error::last_os_error();
if err.raw_os_error() == Some(ERROR_LOCK_VIOLATION as i32) {
return Ok(false);
}
Err(err).context("failed to lock daemon state")
}
// Keep installer descendants bounded by the updater's lifetime, while allowing
// app-server launches and successor updaters to break away from this job.
pub(crate) fn updater_job() -> Result<OwnedHandle> {
process_job(unsafe { GetCurrentProcess() })
}
/// Called before writing the installer script, while PowerShell is waiting on stdin.
pub(crate) fn installer_job(child: &tokio::process::Child) -> Result<OwnedHandle> {
let process = child
.raw_handle()
.context("installer process handle is unavailable")?;
process_job(process)
}
fn process_job(process: HANDLE) -> Result<OwnedHandle> {
let job = unsafe { CreateJobObjectW(std::ptr::null(), std::ptr::null()) };
if job.is_null() {
return Err(io::Error::last_os_error()).context("failed to create updater job");
}
let owned = unsafe { OwnedHandle::from_raw_handle(job) };
let mut limits: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = unsafe { std::mem::zeroed() };
limits.BasicLimitInformation.LimitFlags =
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE | JOB_OBJECT_LIMIT_BREAKAWAY_OK;
if unsafe {
SetInformationJobObject(
job,
JobObjectExtendedLimitInformation,
(&limits as *const JOBOBJECT_EXTENDED_LIMIT_INFORMATION).cast(),
std::mem::size_of_val(&limits) as u32,
)
} == 0
|| unsafe { AssignProcessToJobObject(job, process) } == 0
{
return Err(io::Error::last_os_error())
.context("failed to contain updater installer processes");
}
Ok(owned)
}
#[cfg(test)]
#[path = "windows_tests.rs"]
mod tests;
@@ -1,365 +0,0 @@
use super::Process;
use pretty_assertions::assert_eq;
use std::os::windows::io::AsRawHandle;
use std::os::windows::io::FromRawHandle;
use std::os::windows::io::OwnedHandle;
use std::os::windows::process::CommandExt;
use std::process::Stdio;
use std::time::Duration;
use tokio::io::AsyncReadExt;
use windows_sys::Win32::Foundation::ERROR_ACCESS_DENIED;
use windows_sys::Win32::Foundation::HANDLE_FLAG_INHERIT;
use windows_sys::Win32::Foundation::SetHandleInformation;
use windows_sys::Win32::System::JobObjects::IsProcessInJob;
use windows_sys::Win32::System::Threading::CREATE_NO_WINDOW;
use windows_sys::Win32::System::Threading::DETACHED_PROCESS;
use windows_sys::Win32::System::Threading::TerminateProcess;
#[tokio::test]
async fn captured_stdio_closes_while_child_is_alive() {
const TEST: &str = "backend::windows::tests::captured_stdio_closes_while_child_is_alive";
const ROLE: &str = "CODEX_TEST_STDIO_ROLE";
const HOME: &str = "CODEX_TEST_STDIO_HOME";
let executable = std::env::current_exe().expect("test executable");
if let Ok(role) = std::env::var(ROLE) {
let home = std::path::PathBuf::from(std::env::var_os(HOME).expect("test home"));
if role == "child" {
eprintln!("child stderr");
std::fs::write(home.join("ready"), []).unwrap();
tokio::time::sleep(Duration::from_secs(30)).await;
return;
}
let handles = [
std::io::stdout().as_raw_handle(),
std::io::stderr().as_raw_handle(),
];
for handle in handles {
assert_ne!(
unsafe { SetHandleInformation(handle, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT) },
0
);
}
let mut command = tokio::process::Command::new(executable);
command
.args(["--exact", TEST, "--nocapture"])
.env(ROLE, "child")
// The CI job may forbid breakaway; it does not affect stdio inheritance.
.creation_flags(DETACHED_PROCESS)
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(std::fs::File::create(home.join("child.log")).unwrap());
let child = super::spawn_without_inheriting_stdio(&mut command).unwrap();
let pid = child.id().unwrap();
let started = Process::open(pid).unwrap().unwrap().start_time().unwrap();
std::fs::write(
home.join("pid"),
serde_json::to_vec(&(pid, started)).unwrap(),
)
.unwrap();
println!("launcher stdout");
eprintln!("launcher stderr");
return;
}
let home = tempfile::tempdir().unwrap();
let mut launcher = tokio::process::Command::new(executable)
.args(["--exact", TEST, "--nocapture"])
.env(ROLE, "launcher")
.env(HOME, home.path())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.kill_on_drop(true)
.spawn()
.unwrap();
let status = tokio::time::timeout(Duration::from_secs(10), launcher.wait())
.await
.expect("launcher exit")
.unwrap();
let (pid, started): (u32, String) =
serde_json::from_slice(&std::fs::read(home.path().join("pid")).unwrap()).unwrap();
let child = Process::open(pid).unwrap().expect("live child");
assert_eq!(
child.start_time().unwrap(),
started,
"fixture PID was reused"
);
let mut stdout = String::new();
let mut stderr = String::new();
let captured = tokio::time::timeout(Duration::from_secs(5), async {
let ready = home.path().join("ready");
while !ready.exists() {
tokio::time::sleep(Duration::from_millis(25)).await;
}
tokio::try_join!(
launcher
.stdout
.as_mut()
.unwrap()
.read_to_string(&mut stdout),
launcher
.stderr
.as_mut()
.unwrap()
.read_to_string(&mut stderr),
)
})
.await;
let still_running = child.is_running();
child.terminate().expect("cleanup child");
tokio::time::timeout(Duration::from_secs(5), async {
while child.is_running().unwrap() {
tokio::time::sleep(Duration::from_millis(25)).await;
}
})
.await
.expect("child exit after cleanup");
captured.expect("launcher output must close").unwrap();
assert!(status.success(), "{stderr}");
assert!(
still_running.unwrap(),
"child exited before its launcher output closed"
);
assert!(stdout.contains("launcher stdout"));
assert!(stderr.contains("launcher stderr"));
assert!(
std::fs::read_to_string(home.path().join("child.log"))
.unwrap()
.contains("child stderr")
);
}
#[test]
fn detached_launch_preflight_rejects_restrictive_job() {
const CHILD: &str = "CODEX_TEST_RESTRICTIVE_LAUNCH_JOB";
let executable = std::env::current_exe().expect("test executable");
if std::env::var_os(CHILD).is_some() {
let job = unsafe { super::CreateJobObjectW(std::ptr::null(), std::ptr::null()) };
assert!(!job.is_null());
let job = unsafe {
<std::os::windows::io::OwnedHandle as std::os::windows::io::FromRawHandle>::from_raw_handle(job)
};
assert_ne!(
unsafe {
super::AssignProcessToJobObject(job.as_raw_handle(), super::GetCurrentProcess())
},
0
);
// A new job does not permit breakaway. Reject before any lifecycle mutation.
let err = super::ensure_detached_launch(&executable).expect_err("breakaway forbidden");
assert!(
err.is::<super::DetachedLaunchRestricted>(),
"expected a classified job restriction: {err:#}"
);
// File access failures must still fail normally, even in a restricted
// job: a CLI must not hide corrupt or inaccessible installations.
let temp = tempfile::tempdir().expect("test directory");
let err =
super::ensure_detached_launch(temp.path()).expect_err("directory is not an executable");
assert!(!err.is::<super::DetachedLaunchRestricted>(), "{err:#}");
return;
}
let output = std::process::Command::new(executable)
.args([
"--exact",
"backend::windows::tests::detached_launch_preflight_rejects_restrictive_job",
"--nocapture",
])
.env(CHILD, "1")
.output()
.expect("isolated job test");
assert!(
output.status.success(),
"{}",
String::from_utf8_lossy(&output.stderr)
);
assert!(String::from_utf8_lossy(&output.stdout).contains("1 passed"));
}
#[test]
fn detached_launch_preflight_allows_residual_job() {
const CHILD: &str = "CODEX_TEST_RESIDUAL_LAUNCH_JOB";
let executable = std::env::current_exe().expect("test executable");
if std::env::var_os(CHILD).is_some() {
let mut jobs = Vec::new();
for inner in [false, true] {
let job = unsafe { super::CreateJobObjectW(std::ptr::null(), std::ptr::null()) };
assert!(!job.is_null());
let job = unsafe { OwnedHandle::from_raw_handle(job) };
if inner {
let mut limits: super::JOBOBJECT_EXTENDED_LIMIT_INFORMATION =
unsafe { std::mem::zeroed() };
limits.BasicLimitInformation.LimitFlags = super::JOB_OBJECT_LIMIT_BREAKAWAY_OK;
assert_ne!(
unsafe {
super::SetInformationJobObject(
job.as_raw_handle(),
super::JobObjectExtendedLimitInformation,
(&limits as *const super::JOBOBJECT_EXTENDED_LIMIT_INFORMATION).cast(),
std::mem::size_of_val(&limits) as u32,
)
},
0
);
}
assert_ne!(
unsafe {
super::AssignProcessToJobObject(job.as_raw_handle(), super::GetCurrentProcess())
},
0
);
jobs.push(job);
}
let mut probe = std::process::Command::new(&executable)
.creation_flags(
super::CREATE_SUSPENDED
| super::DETACHED_PROCESS
| super::CREATE_BREAKAWAY_FROM_JOB,
)
.spawn()
.expect("breakaway probe");
let mut in_outer = 0;
let mut in_inner = 0;
let outer_checked = unsafe {
IsProcessInJob(
probe.as_raw_handle(),
jobs[0].as_raw_handle(),
&mut in_outer,
)
};
let inner_checked = unsafe {
IsProcessInJob(
probe.as_raw_handle(),
jobs[1].as_raw_handle(),
&mut in_inner,
)
};
probe.kill().expect("terminate probe");
probe.wait().expect("reap probe");
assert_ne!(outer_checked, 0);
assert_ne!(inner_checked, 0);
assert_ne!(in_outer, 0, "probe must retain its outer job");
assert_eq!(in_inner, 0, "probe must leave its inner job");
super::ensure_detached_launch(&executable).expect("residual job must be accepted");
if let Err(err) = super::ensure_not_elevated() {
assert!(err.to_string().contains("non-elevated terminal"));
return;
}
let temp = tempfile::tempdir().expect("temp dir");
let script = temp.path().join("codex.cmd");
std::fs::write(
&script,
"@echo off\r\nif \"%3\"==\"--help\" exit /b 1\r\necho ready > \"%~dp0ready\"\r\nfor /l %%i in (1,1,10000000) do @rem\r\n",
)
.expect("write daemon fixture");
let backend = crate::backend::pid::PidBackend::new(
script,
temp.path().join("state").join("daemon.pid"),
/*remote_control_enabled*/ false,
);
let runtime = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.expect("runtime");
let pid = runtime
.block_on(backend.start())
.expect("daemon launch")
.expect("new daemon pid");
let process = Process::open(pid)
.expect("open daemon")
.expect("live daemon");
let deadline = std::time::Instant::now() + std::time::Duration::from_secs(5);
while !temp.path().join("ready").exists() && std::time::Instant::now() < deadline {
std::thread::sleep(std::time::Duration::from_millis(50));
}
let ready = temp.path().join("ready").exists();
let outer_checked = unsafe {
IsProcessInJob(
process.0.as_raw_handle(),
jobs[0].as_raw_handle(),
&mut in_outer,
)
};
let inner_checked = unsafe {
IsProcessInJob(
process.0.as_raw_handle(),
jobs[1].as_raw_handle(),
&mut in_inner,
)
};
process.terminate().expect("terminate daemon fixture");
let deadline = std::time::Instant::now() + std::time::Duration::from_secs(5);
while process.is_running().expect("daemon liveness") && std::time::Instant::now() < deadline
{
std::thread::sleep(std::time::Duration::from_millis(50));
}
assert!(!process.is_running().expect("daemon liveness"));
assert!(ready, "daemon fixture did not start");
assert_ne!(outer_checked, 0);
assert_ne!(inner_checked, 0);
assert_ne!(in_outer, 0, "daemon must retain its outer job");
assert_eq!(in_inner, 0, "daemon must leave its inner job");
return;
}
let output = std::process::Command::new(executable)
.args([
"--exact",
"backend::windows::tests::detached_launch_preflight_allows_residual_job",
"--nocapture",
])
.env(CHILD, "1")
.output()
.expect("isolated job test");
assert!(
output.status.success(),
"{}\n{}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);
assert!(String::from_utf8_lossy(&output.stdout).contains("1 passed"));
}
#[tokio::test]
async fn identity_queries_do_not_require_termination_access() {
let mut child = tokio::process::Command::new("powershell.exe")
.args([
"-NoProfile",
"-NonInteractive",
"-Command",
"Start-Sleep 60",
])
.creation_flags(CREATE_NO_WINDOW)
.kill_on_drop(true)
.spawn()
.expect("child");
let process = Process::open(child.id().expect("pid"))
.expect("query handle")
.expect("live process");
assert!(!process.start_time().expect("creation time").is_empty());
assert!(process.is_running().expect("liveness"));
// Check the rights on the actual query handle, independent of privileges
// that could let the caller reopen the process with termination access.
assert_eq!(
unsafe {
TerminateProcess(process.0.as_raw_handle(), /*uexitcode*/ 1)
},
0
);
assert_eq!(
std::io::Error::last_os_error().raw_os_error(),
Some(ERROR_ACCESS_DENIED as i32)
);
assert!(
process
.is_running()
.expect("query must not terminate child")
);
child
.kill()
.await
.expect("cleanup through original spawn handle");
}
@@ -7,7 +7,6 @@ use std::process::Command;
use anyhow::Result;
pub(crate) fn set_working_directory(command: &mut Command, state_dir: &Path) -> Result<()> {
#[cfg(unix)]
let cwd_missing = match std::env::current_dir() {
Ok(_) => false,
Err(err) if err.kind() == std::io::ErrorKind::NotFound => true,
@@ -32,8 +31,6 @@ pub(crate) fn set_working_directory(command: &mut Command, state_dir: &Path) ->
}
// Preserve process-scoped paths before changing cwd; CA names match CUSTOM_CA_ENV_KEYS.
for name in [
#[cfg(windows)]
"CODEX_SQLITE_HOME",
"CODEX_CA_CERTIFICATE",
"SSL_CERT_FILE",
"REQUESTS_CA_BUNDLE",
@@ -82,11 +79,8 @@ pub(crate) fn set_working_directory(command: &mut Command, state_dir: &Path) ->
.collect::<std::io::Result<Vec<_>>>()?;
command.env("SSL_CERT_DIR", std::env::join_paths(paths)?);
}
#[cfg(unix)]
if cwd_missing {
command.current_dir(state_dir);
}
#[cfg(windows)]
command.current_dir(state_dir);
Ok(())
}
+1 -23
View File
@@ -74,28 +74,6 @@ async fn connect_at(socket_path: &Path, url: &str) -> Result<WebSocketStream<Uni
Ok(websocket)
}
#[cfg(windows)]
pub(crate) async fn request_shutdown(socket_path: &Path, pid: u32) -> Result<()> {
timeout(CONTROL_SOCKET_RESPONSE_TIMEOUT, async {
let mut websocket = connect_at(socket_path, "ws://localhost/daemon/shutdown").await?;
websocket
.send(Message::Text(pid.to_string().into()))
.await?;
let reply = websocket
.next()
.await
.context("shutdown socket closed without acknowledgment")??;
anyhow::ensure!(
matches!(reply, Message::Text(ack) if ack == pid.to_string()),
"shutdown acknowledgment did not match the managed process {pid}"
);
websocket.close(None).await?;
Ok(())
})
.await
.context("timed out waiting for managed app-server shutdown acknowledgment")?
}
pub(crate) async fn initialize<S>(
websocket: &mut WebSocketStream<S>,
experimental_api: bool,
@@ -183,7 +161,7 @@ fn parse_version_from_user_agent(user_agent: &str) -> Result<String> {
Ok(version.to_string())
}
#[cfg(all(test, unix))]
#[cfg(test)]
mod tests {
use pretty_assertions::assert_eq;
+1 -12
View File
@@ -25,7 +25,6 @@ impl Drop for InstallLock {
pub(crate) async fn acquire_install_lock(root: &Path) -> Result<InstallLock> {
let lock = root.join("install.lock");
let deadline = tokio::time::Instant::now() + Duration::from_secs(30);
#[cfg(unix)]
let use_lockf = {
// Match the installer so both processes coordinate on the same lock.
let choice = tokio::process::Command::new("/bin/sh")
@@ -95,14 +94,8 @@ pub(crate) async fn acquire_install_lock(root: &Path) -> Result<InstallLock> {
};
let mut options = OpenOptions::new();
options.create(true).truncate(false).write(true);
#[cfg(windows)]
{
use std::os::windows::fs::OpenOptionsExt;
options.share_mode(0);
}
loop {
let acquired = options.open(&lock);
#[cfg(unix)]
let acquired = acquired.and_then(|file| {
{
use std::os::fd::AsRawFd;
@@ -125,11 +118,7 @@ pub(crate) async fn acquire_install_lock(root: &Path) -> Result<InstallLock> {
_directory_owner: None,
});
}
Err(error)
if error.kind() == std::io::ErrorKind::WouldBlock
|| cfg!(windows)
&& (error.raw_os_error() == Some(32)
|| error.kind() == std::io::ErrorKind::PermissionDenied) => {}
Err(error) if error.kind() == std::io::ErrorKind::WouldBlock => {}
Err(error) => return Err(error).context("failed to acquire daemon installer lock"),
}
if tokio::time::Instant::now() >= deadline {
-4
View File
@@ -24,8 +24,6 @@ pub async fn start_with_features_classified(
features: &BTreeMap<String, bool>,
) -> Result<LifecycleOutput, StartError> {
ensure_supported_platform()?;
#[cfg(windows)]
crate::backend::windows::ensure_not_elevated()?;
let mut daemon = Daemon::from_environment()?;
daemon.log_diagnostics = true;
let _operation_lock = daemon.acquire_operation_lock().await?;
@@ -40,8 +38,6 @@ pub async fn start_with_features_classified(
/// then verify effective server compatibility after this operation completes.
pub async fn restart_with_features(features: &BTreeMap<String, bool>) -> Result<LifecycleOutput> {
ensure_supported_platform()?;
#[cfg(windows)]
crate::backend::windows::ensure_not_elevated()?;
let daemon = Daemon::from_environment()?;
let _operation_lock = daemon.acquire_operation_lock().await?;
let selected = daemon.current_installation()?;
+9 -69
View File
@@ -2,12 +2,6 @@
mod backend;
mod background_command;
#[cfg(windows)]
pub use backend::windows::DetachedLaunchRestricted;
#[cfg(windows)]
pub use backend::windows::is_elevated;
#[cfg(windows)]
use backend::windows::try_lock_file;
mod client;
mod diagnostics;
mod install_lock;
@@ -42,7 +36,6 @@ use codex_app_server_protocol::RemoteControlPairingStartResponse;
use codex_app_server_transport::app_server_control_socket_path;
use codex_utils_home_dir::find_codex_home;
use managed_install::managed_codex_bin;
#[cfg(any(unix, windows))]
use managed_install::managed_codex_version;
use serde::Serialize;
use settings::DaemonSettings;
@@ -52,13 +45,7 @@ use telemetry::StartFailure;
use tokio::time::sleep;
const START_POLL_INTERVAL: Duration = Duration::from_millis(50);
// An older updater can pass background policy to a replacement daemon, so retain
// the longer readiness allowance during upgrades on macOS. On Linux, a cold
// start from a rotational disk can take more than ten seconds.
#[cfg(any(target_os = "macos", target_os = "linux"))]
const START_TIMEOUT: Duration = Duration::from_secs(30);
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
const START_TIMEOUT: Duration = Duration::from_secs(10);
// Leave room for the longest graceful stop, forced-exit check, and restart.
const OPERATION_LOCK_TIMEOUT: Duration =
Duration::from_secs(MAX_SHUTDOWN_GRACE_SECONDS as u64 + 75);
@@ -72,7 +59,9 @@ const STATE_DIR_NAME: &str = "app-server-daemon";
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum LifecycleCommand {
Start,
Start {
feature_overrides: BTreeMap<String, bool>,
},
Restart {
feature_overrides: BTreeMap<String, bool>,
},
@@ -212,7 +201,6 @@ pub struct RemoteControlOutput {
pub app_server_version: Option<String>,
}
#[cfg(any(unix, windows))]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum RestartIfRunningOutcome {
Busy,
@@ -222,7 +210,6 @@ pub(crate) enum RestartIfRunningOutcome {
Restarted,
}
#[cfg(any(unix, windows))]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum RestartMode {
IfVersionChanged,
@@ -230,7 +217,6 @@ pub(crate) enum RestartMode {
Always,
}
#[cfg(any(unix, windows))]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum RestartDecision {
NotReady,
@@ -240,28 +226,17 @@ enum RestartDecision {
pub async fn run(command: LifecycleCommand) -> Result<LifecycleOutput> {
ensure_supported_platform()?;
#[cfg(windows)]
if matches!(
command,
LifecycleCommand::Start | LifecycleCommand::Restart { .. }
) {
backend::windows::ensure_not_elevated()?;
}
// Keep daemon package preparation off callers' async stack frames.
Box::pin(Daemon::from_environment()?.run(command)).await
}
pub async fn bootstrap(options: BootstrapOptions) -> Result<BootstrapOutput> {
ensure_supported_platform()?;
#[cfg(windows)]
backend::windows::ensure_not_elevated()?;
Box::pin(Daemon::from_environment()?.bootstrap(options)).await
}
pub async fn ensure_remote_control_ready() -> Result<RemoteControlReadyOutput> {
ensure_supported_platform()?;
#[cfg(windows)]
backend::windows::ensure_not_elevated()?;
Box::pin(Daemon::from_environment()?.ensure_remote_control_ready()).await
}
@@ -288,8 +263,6 @@ pub async fn start_remote_control_pairing() -> Result<RemoteControlPairingStartR
pub async fn set_remote_control(mode: RemoteControlMode) -> Result<RemoteControlOutput> {
ensure_supported_platform()?;
#[cfg(windows)]
backend::windows::ensure_not_elevated()?;
Box::pin(Daemon::from_environment()?.set_remote_control(mode)).await
}
@@ -298,8 +271,6 @@ pub async fn run_pid_update_loop(
restore_release: Option<String>,
) -> Result<()> {
ensure_supported_platform()?;
#[cfg(windows)]
backend::windows::ensure_not_elevated()?;
update_loop::run(http_client_factory, restore_release).await
}
@@ -321,23 +292,13 @@ pub async fn update(
http_client_factory: codex_http_client::HttpClientFactory,
) -> Result<UpdateOutput> {
ensure_supported_platform()?;
#[cfg(windows)]
backend::windows::ensure_not_elevated()?;
update_loop::request_manual_update(&Daemon::from_environment()?, http_client_factory).await
}
#[cfg(any(unix, windows))]
fn ensure_supported_platform() -> Result<()> {
Ok(())
}
#[cfg(not(any(unix, windows)))]
fn ensure_supported_platform() -> Result<()> {
Err(anyhow!(
"codex app-server daemon lifecycle is only supported on Unix and Windows platforms"
))
}
#[derive(Clone)]
struct Daemon {
// Feature-aware TUI startup owns a live terminal. Direct lifecycle commands
@@ -423,8 +384,8 @@ impl Daemon {
let _operation_lock = self.acquire_operation_lock().await?;
let selected = self.current_installation()?;
match command {
LifecycleCommand::Start => selected
.start(&BTreeMap::new())
LifecycleCommand::Start { feature_overrides } => selected
.start(&feature_overrides)
.await
.map_err(|err| err.error),
LifecycleCommand::Restart { feature_overrides } => {
@@ -553,7 +514,6 @@ impl Daemon {
.await)
}
#[cfg(any(unix, windows))]
pub(crate) async fn try_restart_if_running(
&self,
mode: RestartMode,
@@ -603,8 +563,6 @@ impl Daemon {
}
RestartDecision::AlreadyCurrent => RestartIfRunningOutcome::AlreadyCurrent,
RestartDecision::Restart => {
#[cfg(windows)]
backend::windows::ensure_detached_launch(managed_codex_bin)?;
if let Err(err) = thread_recovery::discard_pending(self) {
let _ = stderr_writer().write_all(format!(
"warning: failed to clear stale daemon recovery before update: {err}\n"
@@ -899,7 +857,6 @@ impl Daemon {
backend::pid_update_loop_backend(self.backend_paths(&settings))
.stop()
.await?;
#[cfg(unix)]
{
use std::os::unix::fs::FileTypeExt;
@@ -925,7 +882,6 @@ impl Daemon {
backend.start().await?;
let info = self.wait_until_ready().await?;
let auto_update_enabled = managed.ensure_managed_updater(&settings).await?;
#[cfg(unix)]
// Older automatic updaters have no manual request socket to wait for.
if auto_update_enabled
&& managed_install::supports_daemon_command(
@@ -1097,8 +1053,6 @@ impl Daemon {
fn ensure_managed_codex_bin(&self) -> Result<()> {
if self.managed_codex_bin.is_file() {
#[cfg(windows)]
backend::windows::ensure_detached_launch(&self.managed_codex_bin)?;
return Ok(());
}
@@ -1108,16 +1062,10 @@ impl Daemon {
))
}
#[cfg(any(unix, windows))]
async fn managed_codex_version_best_effort(&self) -> Option<String> {
managed_codex_version(&self.managed_codex_bin).await.ok()
}
#[cfg(not(any(unix, windows)))]
async fn managed_codex_version_best_effort(&self) -> Option<String> {
None
}
fn backend_paths(&self, settings: &DaemonSettings) -> BackendPaths {
self.backend_paths_with_bin(settings, &self.managed_codex_bin)
}
@@ -1161,7 +1109,6 @@ impl Daemon {
async fn open_operation_lock_file(&self) -> Result<tokio::fs::File> {
if let Some(parent) = self.operation_lock_file.parent() {
#[cfg(unix)]
if let Some(home) = parent.parent() {
tokio::fs::create_dir_all(home).await?;
}
@@ -1240,7 +1187,6 @@ fn already_remote_control_status(mode: RemoteControlMode) -> RemoteControlStatus
}
}
#[cfg(any(unix, windows))]
fn restart_decision(
mode: RestartMode,
info: Option<&client::ProbeInfo>,
@@ -1260,7 +1206,6 @@ fn restart_decision(
}
}
#[cfg(unix)]
fn try_lock_file(file: &tokio::fs::File) -> Result<bool> {
use std::os::fd::AsRawFd;
@@ -1276,12 +1221,7 @@ fn try_lock_file(file: &tokio::fs::File) -> Result<bool> {
Err(err).context("failed to lock daemon operation")
}
#[cfg(not(any(unix, windows)))]
fn try_lock_file(_file: &tokio::fs::File) -> Result<bool> {
Ok(true)
}
#[cfg(all(test, any(unix, windows)))]
#[cfg(test)]
mod tests {
use pretty_assertions::assert_eq;
use tempfile::TempDir;
@@ -1298,7 +1238,6 @@ mod tests {
use super::RestartMode;
use super::restart_decision;
use crate::client::ProbeInfo;
#[cfg(unix)]
use crate::settings::DaemonSettings;
#[test]
@@ -1503,13 +1442,14 @@ mod tests {
)
.expect("legacy saved threads");
daemon
.run(super::LifecycleCommand::Start)
.run(super::LifecycleCommand::Start {
feature_overrides: Default::default(),
})
.await
.expect_err("missing backend binary");
assert!(!daemon.recovery_file().expect("recovery path").exists());
}
#[cfg(unix)]
#[tokio::test]
async fn managed_local_backend_counts_as_bootstrapped_without_updater() {
let home = TempDir::new().expect("home");
@@ -61,9 +61,7 @@ pub(crate) fn managed_codex_bin(codex_home: &Path) -> PathBuf {
let current = root.join("current");
let packaged = current.join("bin").join(managed_codex_file_name());
let legacy = current.join(managed_codex_file_name());
if packaged.is_file()
|| !legacy.is_file() && (cfg!(windows) || root.ends_with("app-server-daemon"))
{
if packaged.is_file() || !legacy.is_file() && (root.ends_with("app-server-daemon")) {
packaged
} else {
legacy
@@ -123,8 +121,6 @@ pub(crate) async fn supports_daemon_update_loop(codex_bin: &Path) -> bool {
/// Probe an internal daemon command without running a long-lived process.
pub(crate) async fn supports_daemon_command(codex_bin: &Path, args: &[&str]) -> bool {
let mut command = Command::new(codex_bin);
#[cfg(windows)]
command.creation_flags(windows_sys::Win32::System::Threading::CREATE_NO_WINDOW);
timeout(
Duration::from_secs(5),
command
@@ -151,8 +147,6 @@ pub(crate) async fn resolved_managed_codex_bin(codex_bin: &Path) -> Result<PathB
pub(crate) async fn managed_codex_version(codex_bin: &Path) -> Result<String> {
let mut command = Command::new(codex_bin);
#[cfg(windows)]
command.creation_flags(windows_sys::Win32::System::Threading::CREATE_NO_WINDOW);
let output = command
.arg("--version")
.kill_on_drop(true)
@@ -224,23 +218,15 @@ pub(crate) fn executable_identity_from_reader(
pub(crate) fn path_digest(path: &Path) -> [u8; 32] {
let mut hasher = blake3::Hasher::new();
#[cfg(unix)]
{
use std::os::unix::ffi::OsStrExt;
hasher.update(path.as_os_str().as_bytes());
}
#[cfg(windows)]
{
use std::os::windows::ffi::OsStrExt;
for unit in path.as_os_str().encode_wide() {
hasher.update(&unit.to_le_bytes());
}
}
*hasher.finalize().as_bytes()
}
fn managed_codex_file_name() -> &'static str {
if cfg!(windows) { "codex.exe" } else { "codex" }
"codex"
}
fn parse_codex_version(output: &str) -> Result<String> {
@@ -54,7 +54,6 @@ fn discovers_package_and_legacy_installs() {
home.path().join("packages/app-server-daemon")
);
#[cfg(unix)]
{
let dedicated = home.path().join("packages/app-server-daemon");
std::fs::write(&dedicated, b"not a directory").expect("unreadable selection");
@@ -62,7 +61,6 @@ fn discovers_package_and_legacy_installs() {
}
}
#[cfg(unix)]
#[test]
fn updater_only_runs_for_stable_installer_owned_releases() {
let home = tempfile::TempDir::new().expect("home");
@@ -111,7 +109,6 @@ fn updater_only_runs_for_stable_installer_owned_releases() {
));
}
#[cfg(unix)]
#[tokio::test]
async fn older_managed_binary_does_not_claim_updater_support() {
let temp = tempfile::TempDir::new().expect("home");
@@ -101,8 +101,6 @@ pub(crate) async fn request(daemon: &Daemon) -> Result<UpdateOutput> {
};
let mut response = Vec::new();
let transport = async {
#[cfg(windows)]
connection.ensure_non_elevated_peer()?;
connection.write_all(b"update\n").await?;
connection
.take(MAX_RESPONSE_BYTES)
@@ -185,10 +183,6 @@ pub(super) async fn handle_request(
terminate: &mut Signal,
trigger: UpdateTrigger<'_>,
) -> Result<RequestDisposition> {
#[cfg(windows)]
if connection.ensure_non_elevated_peer().is_err() {
return Ok(RequestDisposition::Unchanged);
}
let mut request = [0; 7];
if !matches!(
timeout(Duration::from_secs(5), connection.read_exact(&mut request)).await,
+1 -17
View File
@@ -38,16 +38,12 @@ pub(super) async fn run(http: &impl InstallerHttp, legacy: &Daemon) -> Result<Up
if running.is_none() && client::probe(&legacy.socket_path).await.is_ok() {
return super::manual_update::unsupported(legacy).await;
}
#[cfg(unix)]
let mut terminate = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())?;
let cancellation = async {
#[cfg(unix)]
tokio::select! {
_ = terminate.recv() => {},
_ = tokio::signal::ctrl_c() => {},
}
#[cfg(windows)]
let _ = tokio::signal::ctrl_c().await;
Some(())
};
let mut cancellation = std::pin::pin!(cancellation);
@@ -60,7 +56,6 @@ pub(super) async fn run(http: &impl InstallerHttp, legacy: &Daemon) -> Result<Up
"the published installer does not support daemon migration yet; the legacy installation was left unchanged"
);
eprintln!("Preparing the daemon update in {}...", root.display());
#[cfg(unix)]
{
if matches!(
run_installer_script(
@@ -75,11 +70,6 @@ pub(super) async fn run(http: &impl InstallerHttp, legacy: &Daemon) -> Result<Up
return Err(std::io::Error::from(std::io::ErrorKind::Interrupted).into());
}
}
#[cfg(windows)]
tokio::select! {
result = run_installer_script(&script, InstallerMode::Migration, &root) => { result?; },
_ = &mut cancellation => return Err(std::io::Error::from(std::io::ErrorKind::Interrupted).into()),
}
let _install_lock = acquire_install_lock(&root).await?;
let pending = root.join(".migration-current");
@@ -94,11 +84,7 @@ pub(super) async fn run(http: &impl InstallerHttp, legacy: &Daemon) -> Result<Up
&& std::fs::read_to_string(root.join("auto-update-version"))? == name.to_string_lossy(),
"installer did not prepare a latest-channel daemon package"
);
let entrypoint = if cfg!(windows) {
"bin/codex.exe"
} else {
"bin/codex"
};
let entrypoint = "bin/codex";
let binary = release.join(entrypoint);
let version = managed_install::managed_codex_version(&binary).await?;
anyhow::ensure!(
@@ -114,8 +100,6 @@ pub(super) async fn run(http: &impl InstallerHttp, legacy: &Daemon) -> Result<Up
.await,
"the latest production release does not support daemon migration yet; the legacy daemon was left running"
);
#[cfg(windows)]
backend::windows::ensure_detached_launch(&binary)?;
anyhow::ensure!(
selected_release(legacy)? == previous,
"daemon selection changed; retry the update"
@@ -48,8 +48,6 @@ pub async fn update_from_cli(
confirm: impl FnOnce(&InstallRequest) -> Result<bool>,
) -> Result<Option<crate::UpdateOutput>> {
crate::ensure_supported_platform()?;
#[cfg(windows)]
crate::backend::windows::ensure_not_elevated()?;
let daemon = Daemon::from_environment()?;
let settings = daemon.load_settings().await?;
let source = InstallContext::current().package_layout.as_ref();
@@ -157,15 +155,9 @@ async fn prepare_from_package(
let version = manifest.version.to_string();
let target = platform_target()?;
let mut metadata: serde_json::Value = serde_json::from_slice(&manifest_bytes)?;
let entrypoint = if cfg!(windows) {
"bin/codex.exe"
} else {
"bin/codex"
};
let entrypoint = "bin/codex";
let source_entrypoint = metadata["entrypoint"].as_str().unwrap_or_default();
let winget = cfg!(windows)
&& metadata["layoutVersion"] == 1
&& source_entrypoint == format!("codex-{target}.exe");
let winget = false;
anyhow::ensure!(
metadata["target"] == target && (source_entrypoint == entrypoint || winget),
"the CLI package does not match this platform or executable"
@@ -250,19 +242,6 @@ async fn prepare_from_package(
// source. Hash the final tree for reuse, since it now differs from the source.
let digest = if winget {
std::fs::create_dir_all(stage.path().join("bin"))?;
#[cfg(windows)]
for (from, to) in [
(staged_exe, Path::new(entrypoint)),
(
Path::new("codex-code-mode-host.exe"),
Path::new("bin/codex-code-mode-host.exe"),
),
] {
windows::publish_release(&stage.path().join(from), &stage.path().join(to)).await?;
if let Some(digest) = staged_digests.remove(from) {
staged_digests.insert(to.to_path_buf(), digest);
}
}
let voice_path = stage.path().join("codex-resources/voice/manifest.json");
if voice_path.try_exists()? {
let mut voice: serde_json::Value =
@@ -309,13 +288,9 @@ async fn prepare_from_package(
"an existing daemon release has different contents; refusing to overwrite it"
);
} else {
#[cfg(unix)]
if !stage.path().join("codex").exists() {
std::os::unix::fs::symlink("bin/codex", stage.path().join("codex"))?;
}
#[cfg(windows)]
windows::publish_release(stage.path(), &release).await?;
#[cfg(not(windows))]
std::fs::rename(stage.path(), &release)?;
}
let release = release.canonicalize()?;
@@ -334,12 +309,6 @@ async fn prepare_from_package(
&& (backend.is_some() || crate::client::probe(&daemon.socket_path).await.is_err()),
"daemon package location or socket ownership changed while preparing its package; retry the command"
);
#[cfg(windows)]
if backend.is_some() {
crate::backend::windows::ensure_detached_launch(&release.join(entrypoint))?;
}
#[cfg(windows)]
windows::validate_selection(&root)?;
if mode == InstallMode::Replace {
let stopped = async {
crate::backend::pid_update_loop_backend(daemon.backend_paths(settings))
@@ -388,15 +357,12 @@ async fn prepare_from_package(
std::fs::remove_file(marker)?;
}
if previous_release.as_deref() != Some(release.as_path()) {
#[cfg(unix)]
{
let temporary = tempfile::TempDir::new_in(&root)?;
let link = temporary.path().join("current");
std::os::unix::fs::symlink(&release, &link)?;
std::fs::rename(link, root.join("current"))?;
}
#[cfg(windows)]
windows::select_release(&root, &release)?;
if let Err(error) =
crate::release_pruning::record_selection(&root, previous_release.as_deref())
{
@@ -438,8 +404,7 @@ fn package_tree(
while let Some(path) = paths.pop() {
let relative = path.strip_prefix(root)?;
// The Unix installer adds this alias outside the package layout.
if cfg!(unix)
&& relative == Path::new("codex")
if relative == Path::new("codex")
&& std::fs::read_link(&path).ok().as_deref() == Some(Path::new("bin/codex"))
{
continue;
@@ -486,7 +451,6 @@ fn package_tree(
};
hasher.update(b"file");
hasher.update(digest.as_bytes());
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
hasher.update(&(metadata.permissions().mode() & 0o777).to_le_bytes());
@@ -505,28 +469,15 @@ fn stable_version(value: &str) -> Option<semver::Version> {
}
fn validate_package(root: &Path, entrypoint: &str) -> Result<()> {
let code_mode_host = Path::new(entrypoint).with_file_name(if cfg!(windows) {
"codex-code-mode-host.exe"
} else {
"codex-code-mode-host"
});
let code_mode_host = Path::new(entrypoint).with_file_name("codex-code-mode-host");
let code_mode_host = code_mode_host.to_string_lossy();
let mut names = vec![
"codex-package.json",
entrypoint,
code_mode_host.as_ref(),
if cfg!(windows) {
"codex-path/rg.exe"
} else {
"codex-path/rg"
},
"codex-path/rg",
];
if cfg!(windows) {
names.extend([
"codex-resources/codex-command-runner.exe",
"codex-resources/codex-windows-sandbox-setup.exe",
]);
} else if cfg!(target_os = "linux") {
if cfg!(target_os = "linux") {
names.push("codex-resources/bwrap");
}
for name in names {
@@ -535,7 +486,6 @@ fn validate_package(root: &Path, entrypoint: &str) -> Result<()> {
"local Codex package is missing {name}; reinstall the CLI or use the standalone installer"
));
}
#[cfg(unix)]
if name != "codex-package.json" {
use std::os::unix::fs::PermissionsExt;
if std::fs::metadata(root.join(name))?.permissions().mode() & 0o111 == 0 {
@@ -562,10 +512,6 @@ fn platform_target() -> Result<&'static str> {
}
}
#[cfg(windows)]
#[path = "prepare_install_windows.rs"]
mod windows;
#[cfg(test)]
#[path = "prepare_install_tests.rs"]
mod tests;
@@ -1,5 +1,4 @@
//! Covers complete-package staging, conservative selection, and legacy preservation.
#![cfg(unix)]
use std::collections::BTreeMap;
use super::InstallMode;
@@ -1,212 +0,0 @@
//! Publishes and selects Windows managed releases despite transient filesystem contention.
use std::os::windows::ffi::OsStrExt;
use std::os::windows::fs::OpenOptionsExt;
use std::os::windows::io::AsRawHandle;
use std::os::windows::process::CommandExt;
use std::path::Path;
use std::process::Command;
use std::time::Duration;
use anyhow::Context;
use anyhow::Result;
use windows_sys::Win32::Foundation::ERROR_SHARING_VIOLATION;
use windows_sys::Win32::Storage::FileSystem::FILE_FLAG_BACKUP_SEMANTICS;
use windows_sys::Win32::Storage::FileSystem::FILE_FLAG_OPEN_REPARSE_POINT;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_DELETE;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_READ;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_WRITE;
use windows_sys::Win32::System::IO::DeviceIoControl;
use windows_sys::Win32::System::Threading::CREATE_NO_WINDOW;
const PUBLISH_RELEASE_RETRY_INTERVAL: Duration = Duration::from_millis(50);
const PUBLISH_RELEASE_RETRY_LIMIT: usize = 100;
pub(super) async fn publish_release(stage: &Path, release: &Path) -> Result<()> {
let mut retries = 0;
loop {
match std::fs::rename(stage, release) {
Ok(()) => return Ok(()),
// Executable scanners can briefly hold newly staged files without delete sharing.
Err(error)
if retries < PUBLISH_RELEASE_RETRY_LIMIT
&& (error.kind() == std::io::ErrorKind::PermissionDenied
|| error.raw_os_error() == Some(ERROR_SHARING_VIOLATION as i32)) =>
{
retries += 1;
tokio::time::sleep(PUBLISH_RELEASE_RETRY_INTERVAL).await;
}
Err(error) => {
return Err(error).with_context(|| {
format!(
"failed to publish managed daemon release from {} to {}",
stage.display(),
release.display()
)
});
}
}
}
}
pub(super) fn select_release(root: &Path, release: &Path) -> Result<()> {
select_release_with(root, release, retarget_junction)
}
fn select_release_with(
root: &Path,
release: &Path,
retarget: impl FnOnce(&Path, &Path) -> Result<()>,
) -> Result<()> {
let release = release.canonicalize()?;
let current = root.join("current");
if current.symlink_metadata().is_err() {
let temporary = tempfile::TempDir::new_in(root)?;
let junction = temporary.path().join("current");
std::fs::create_dir(&junction)?;
return match retarget(&junction, &release) {
Ok(()) => Ok(std::fs::rename(junction, current)?),
Err(error) if is_permission_denied(&error) => install_junction(root, &release)
.with_context(|| format!("failed to create managed daemon junction after native creation was denied: {error:#}")),
Err(error) => Err(error),
};
}
validate_selection(root)?;
match retarget(&current, &release) {
Ok(()) => Ok(()),
Err(error) if is_permission_denied(&error) => {
install_junction(root, &release).with_context(|| format!("failed to replace managed daemon junction after retargeting was denied: {error:#}"))
}
Err(error) => Err(error),
}
}
fn is_permission_denied(error: &anyhow::Error) -> bool {
error
.downcast_ref::<std::io::Error>()
.is_some_and(|error| error.kind() == std::io::ErrorKind::PermissionDenied)
}
fn install_junction(root: &Path, release: &Path) -> Result<()> {
let temporary = tempfile::TempDir::new_in(root)?;
let junction = temporary.path().join("current");
let current = root.join("current");
let replacing = current.symlink_metadata().is_ok();
if replacing {
validate_selection(root)?;
}
// Some Windows policies deny in-process reparse-point mutation while allowing the system
// junction creator. Pass paths through the environment so cmd metacharacters stay quoted.
let system_root = std::env::var_os("SystemRoot").context("SystemRoot is not set")?;
let command_shell = Path::new(&system_root).join("System32").join("cmd.exe");
anyhow::ensure!(
command_shell.is_absolute(),
"SystemRoot must be an absolute path"
);
let output = Command::new(command_shell)
.env("CODEX_DAEMON_JUNCTION_LINK", &junction)
.env("CODEX_DAEMON_JUNCTION_TARGET", release)
.args(["/d", "/s", "/e:on", "/v:off", "/c"])
.raw_arg(r#""mklink /J "%CODEX_DAEMON_JUNCTION_LINK%" "%CODEX_DAEMON_JUNCTION_TARGET%"""#)
.creation_flags(CREATE_NO_WINDOW)
.output()
.context("failed to run cmd.exe to create managed daemon junction")?;
anyhow::ensure!(
output.status.success(),
"cmd.exe could not create managed daemon junction (status {}): stdout: {}; stderr: {}",
output.status,
String::from_utf8_lossy(&output.stdout).trim(),
String::from_utf8_lossy(&output.stderr).trim()
);
if !replacing {
std::fs::rename(junction, current)?;
return Ok(());
}
let previous = temporary.path().join("previous");
std::fs::rename(&current, &previous)?;
if let Err(error) = std::fs::rename(&junction, &current) {
if let Err(restore_error) = std::fs::rename(&previous, &current) {
let preserved = temporary.keep();
anyhow::bail!(
"failed to replace managed daemon junction: {error}; also failed to restore the previous junction from {}: {restore_error}",
preserved.display()
);
}
return Err(error).context("failed to replace managed daemon junction");
}
if let Err(error) = std::fs::remove_dir(previous) {
tracing::warn!(
%error,
"failed to remove previous managed daemon junction"
);
}
Ok(())
}
fn retarget_junction(current: &Path, release: &Path) -> Result<()> {
// Use the same mount-point reparse operation as the standalone installer.
// Retargeting in place keeps current available to concurrent readers.
const FSCTL_SET_REPARSE_POINT: u32 = 0x0009_00a4;
const IO_REPARSE_TAG_MOUNT_POINT: u32 = 0xa000_0003;
const GENERIC_WRITE: u32 = 0x4000_0000;
let release: Vec<u16> = release.as_os_str().encode_wide().collect();
let prefix: Vec<u16> = r"\\?\".encode_utf16().collect();
let release = release.strip_prefix(prefix.as_slice()).unwrap_or(&release);
let substitute: Vec<u8> = r"\??\"
.encode_utf16()
.chain(release.iter().copied())
.flat_map(u16::to_le_bytes)
.collect();
u16::try_from(substitute.len() + 20).context("managed release path is too long")?;
let length = substitute.len() as u16;
// REPARSE_DATA_BUFFER: an 8-byte header, then four u16 byte offsets/lengths
// for substitute and print names. The UTF-16 path buffer starts at byte 16;
// both names have a trailing NUL, and the print name is empty.
let mut data = vec![0; substitute.len() + 20];
data[0..4].copy_from_slice(&IO_REPARSE_TAG_MOUNT_POINT.to_le_bytes());
data[4..6].copy_from_slice(&(length + 12).to_le_bytes());
data[10..12].copy_from_slice(&length.to_le_bytes());
data[12..14].copy_from_slice(&(length + 2).to_le_bytes());
data[16..16 + substitute.len()].copy_from_slice(&substitute);
let handle = std::fs::OpenOptions::new()
.access_mode(GENERIC_WRITE)
.share_mode(FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE)
.custom_flags(FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT)
.open(current)?;
let mut returned = 0;
if unsafe {
DeviceIoControl(
handle.as_raw_handle(),
FSCTL_SET_REPARSE_POINT,
data.as_ptr().cast(),
data.len() as u32,
std::ptr::null_mut(),
0,
&mut returned,
std::ptr::null_mut(),
)
} == 0
{
return Err(std::io::Error::last_os_error())
.context("failed to retarget managed daemon junction");
}
Ok(())
}
pub(super) fn validate_selection(root: &Path) -> Result<()> {
let current = root.join("current");
if matches!(current.symlink_metadata(), Err(error) if error.kind() == std::io::ErrorKind::NotFound)
{
return Ok(());
}
anyhow::ensure!(
current.canonicalize()?.parent() == Some(root.join("releases").canonicalize()?.as_path()),
"refusing to replace a daemon selection outside its releases directory"
);
Ok(())
}
#[cfg(test)]
#[path = "prepare_install_windows_tests.rs"]
mod tests;
@@ -1,60 +0,0 @@
//! Verifies Windows package publication and selection without requiring an elevated daemon.
use anyhow::Context;
use pretty_assertions::assert_eq;
use std::os::windows::fs::OpenOptionsExt;
use std::time::Duration;
use windows_sys::Win32::Storage::FileSystem::FILE_FLAG_BACKUP_SEMANTICS;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_READ;
use windows_sys::Win32::Storage::FileSystem::FILE_SHARE_WRITE;
#[tokio::test]
async fn publishing_release_retries_transient_access_denied() {
let home = tempfile::TempDir::new().unwrap();
let stage = home.path().join(".staging");
let release = home.path().join("release");
std::fs::create_dir(&stage).unwrap();
std::fs::write(stage.join("payload"), b"complete").unwrap();
let directory = std::fs::OpenOptions::new()
.read(true)
.share_mode(FILE_SHARE_READ | FILE_SHARE_WRITE)
.custom_flags(FILE_FLAG_BACKUP_SEMANTICS)
.open(&stage)
.unwrap();
let holder = tokio::spawn(async move {
tokio::time::sleep(Duration::from_millis(150)).await;
drop(directory);
});
super::publish_release(&stage, &release).await.unwrap();
holder.await.unwrap();
assert_eq!(std::fs::read(release.join("payload")).unwrap(), b"complete");
}
#[cfg(windows)]
#[test]
fn daemon_junction_can_be_created_retargeted_and_replaced_without_cli_links() {
let home = tempfile::TempDir::new().unwrap();
let root = home
.path()
.join("home & 100% ready!/packages/app-server-daemon");
for (version, native_denied) in [("first", true), ("second", false), ("third", true)] {
let release = root.join("releases").join(version);
std::fs::create_dir_all(&release).unwrap();
if native_denied {
super::select_release_with(&root, &release, |_, _| {
Err(std::io::Error::from(std::io::ErrorKind::PermissionDenied))
.context("failed to retarget managed daemon junction")
})
.unwrap();
} else {
super::select_release(&root, &release).unwrap();
}
assert_eq!(
root.join("current").canonicalize().unwrap(),
release.canonicalize().unwrap()
);
}
assert!(!root.with_file_name("standalone").exists());
}
@@ -6,8 +6,6 @@ use std::path::Path;
use anyhow::Context;
use anyhow::Result;
#[cfg(windows)]
use windows_sys::Win32::Storage::FileSystem as winfs;
use crate::Daemon;
use crate::backend;
@@ -21,7 +19,6 @@ struct Manifest {
entrypoint: String,
}
#[cfg(unix)]
fn selection_identity(current: &Path) -> Result<String> {
use std::os::unix::fs::MetadataExt;
let meta = current.symlink_metadata()?;
@@ -34,45 +31,6 @@ fn selection_identity(current: &Path) -> Result<String> {
))
}
#[cfg(windows)]
fn selection_identity(current: &Path) -> Result<String> {
use std::os::windows::fs::OpenOptionsExt;
use std::os::windows::io::AsRawHandle;
use windows_sys::Win32::System::IO::DeviceIoControl;
let file = std::fs::OpenOptions::new()
.access_mode(winfs::FILE_READ_ATTRIBUTES)
.share_mode(winfs::FILE_SHARE_READ | winfs::FILE_SHARE_WRITE | winfs::FILE_SHARE_DELETE)
.custom_flags(winfs::FILE_FLAG_BACKUP_SEMANTICS | winfs::FILE_FLAG_OPEN_REPARSE_POINT)
.open(current)?;
// FSCTL_READ_FILE_USN_DATA, with default V2 record version. The input is always
// "current", so 1024 bytes accommodates its journal record including the file name.
let mut record = [0u8; 1024];
let mut returned = 0;
if unsafe {
DeviceIoControl(
file.as_raw_handle(),
0x0009_00eb,
std::ptr::null(),
0,
record.as_mut_ptr().cast(),
record.len() as u32,
&raw mut returned,
std::ptr::null_mut(),
)
} == 0
{
return Err(std::io::Error::last_os_error().into());
}
let usn = i64::from_le_bytes(record[24..32].try_into()?);
anyhow::ensure!(
returned >= 32 && u16::from_le_bytes(record[4..6].try_into()?) == 2 && usn > 0,
"no reliable daemon selection journal record"
);
let file_id = u64::from_le_bytes(record[8..16].try_into()?);
Ok(format!("{file_id:x} {usn:x}"))
}
/// Call after changing the selection, while holding the installer lock.
pub(crate) fn record_selection(root: &Path, previous: Option<&Path>) -> Result<()> {
let current = root.join("current");
@@ -98,16 +56,6 @@ fn owned_mount(path: &Path) -> Result<u64> {
meta.is_dir() || meta.is_file(),
"not an ordinary package entry"
);
#[cfg(windows)]
{
use std::os::windows::fs::MetadataExt;
anyhow::ensure!(
meta.file_attributes() & winfs::FILE_ATTRIBUTE_REPARSE_POINT == 0,
"package entry is a reparse point"
);
// Volume mount points on Windows are reparse points.
Ok(0)
}
#[cfg(target_os = "linux")]
{
use std::os::fd::AsRawFd;
@@ -124,7 +72,7 @@ fn owned_mount(path: &Path) -> Result<u64> {
.parse()
.context("invalid package mount")
}
#[cfg(all(unix, not(target_os = "linux")))]
#[cfg(not(target_os = "linux"))]
{
use std::os::unix::fs::MetadataExt;
Ok(meta.dev())
@@ -224,8 +172,6 @@ pub(crate) async fn prune(daemon: &Daemon, root: &Path, settings: &DaemonSetting
}
let mut pending = vec![path.clone()];
while let Some(child) = pending.pop() {
// The Unix installer adds this alias; it never traverses outside the release.
#[cfg(unix)]
if child == path.join("codex")
&& std::fs::read_link(&child).ok().as_deref() == Some(Path::new("bin/codex"))
{
@@ -373,7 +373,7 @@ impl From<RemoteControlStatusChangedNotification> for RemoteControlReadyStatus {
}
}
#[cfg(all(test, unix))]
#[cfg(test)]
mod tests {
use anyhow::Result;
use codex_app_server_protocol::JSONRPCError;
@@ -12,10 +12,6 @@ pub struct StartError {
impl StartError {
pub fn failure_reason(&self) -> &'static str {
#[cfg(windows)]
if self.error.is::<crate::DetachedLaunchRestricted>() {
return "spawn";
}
match self.error.downcast_ref::<StartFailure>() {
Some(StartFailure::Spawn(_)) => "spawn",
Some(StartFailure::EarlyChildExit(_)) => "early_child_exit",
+1 -92
View File
@@ -3,7 +3,6 @@
use std::collections::VecDeque;
use std::io::Write;
use std::path::Path;
#[cfg(unix)]
use std::process::Command as StdCommand;
use std::process::Stdio;
use std::sync::Arc;
@@ -16,16 +15,12 @@ use codex_http_client::ClientRouteClass;
use codex_http_client::HttpClientFactory;
use codex_http_client::RouteAwareClientPool;
use futures::FutureExt;
#[cfg(unix)]
use std::os::unix::process::CommandExt;
use tokio::io::AsyncReadExt;
use tokio::io::AsyncWriteExt;
use tokio::process::Command;
#[cfg(unix)]
use tokio::signal::unix::Signal;
#[cfg(unix)]
use tokio::signal::unix::SignalKind;
#[cfg(unix)]
use tokio::signal::unix::signal;
use tokio::time::Instant;
use tokio::time::sleep;
@@ -37,7 +32,6 @@ use crate::RestartMode;
use crate::managed_install::ExecutableIdentity;
use crate::managed_install::executable_identity;
use crate::managed_install::resolved_managed_codex_bin;
#[cfg(any(target_os = "linux", target_os = "macos", windows))]
use crate::settings::DaemonSettings;
use crate::settings::UpdaterSettings;
@@ -71,10 +65,7 @@ const RESTART_RETRY_INTERVAL: Duration = Duration::from_millis(50);
// envelope, and the worst-case six-byte JSON escape for every captured byte.
const INSTALLER_STDERR_TAIL_BYTES: usize = 2 * 1024;
const INSTALLER_STDERR_DRAIN_TIMEOUT: Duration = Duration::from_secs(1);
#[cfg(unix)]
const INSTALL_URL: &str = "https://chatgpt.com/codex/install.sh";
#[cfg(windows)]
const INSTALL_URL: &str = "https://chatgpt.com/codex/install.ps1";
pub(crate) async fn run(
http_client_factory: HttpClientFactory,
@@ -101,10 +92,8 @@ async fn run_with_http(
running_updater_identity: &ExecutableIdentity,
mut restore_release: Option<String>,
) -> Result<()> {
#[cfg(unix)]
let mut terminate =
signal(SignalKind::terminate()).context("failed to install updater shutdown handler")?;
#[cfg(any(target_os = "linux", target_os = "macos"))]
{
let paths = daemon.backend_paths(&DaemonSettings::default());
for backend in [
@@ -115,17 +104,6 @@ async fn run_with_http(
let _ = backend.promote_legacy_identity().await;
}
}
#[cfg(windows)]
let updater = {
// Updater ownership needs only paths, not settings that may be mid-edit.
crate::backend::pid_update_loop_backend(daemon.backend_paths(&DaemonSettings::default()))
};
#[cfg(windows)]
updater.wait_for_ownership().await?;
#[cfg(windows)]
let mut terminate = Signal;
#[cfg(windows)]
let _installer_job = crate::backend::windows::updater_job()?;
let socket_path = daemon.manual_update_socket_path();
codex_uds::prepare_private_socket_directory(
socket_path
@@ -133,19 +111,9 @@ async fn run_with_http(
.context("updater socket has no parent")?,
)
.await?;
#[cfg(unix)]
let (listener, _socket_guard) =
codex_app_server_transport::bind_private_daemon_socket(&socket_path).await?;
#[cfg(windows)]
let listener = {
if socket_path.exists() {
tokio::fs::remove_file(&socket_path).await?;
}
codex_uds::UnixListener::bind(&socket_path).await?
};
let mut listener = Some(listener);
#[cfg(windows)]
updater.mark_ready().await?;
let needs_managed_handoff =
match resolved_managed_codex_bin(&daemon.current_managed_codex_bin()?).await {
Ok(managed_bin) => executable_identity(&managed_bin)
@@ -279,7 +247,6 @@ async fn adopt_managed_updater(
if !crate::managed_install::supports_daemon_update_loop(&managed_bin).await {
return Ok(UpdateLoopControl::Stop);
}
#[cfg(unix)]
{
let _ = listener;
reexec_managed_updater(
@@ -291,25 +258,6 @@ async fn adopt_managed_updater(
)
.map(|_| UpdateLoopControl::Stop)
}
#[cfg(windows)]
{
let replacement = crate::backend::pid_update_loop_backend(
daemon.backend_paths_with_bin(&daemon.load_settings().await?, &managed_bin),
);
listener.take();
if let Err(err) = replacement.replace_current_updater().await {
// A failed replacement may still own the PID if its cleanup could
// not terminate the successor. Never reopen our request socket then.
replacement.wait_for_ownership().await?;
let socket_path = daemon.manual_update_socket_path();
if socket_path.exists() {
tokio::fs::remove_file(&socket_path).await?;
}
*listener = Some(codex_uds::UnixListener::bind(&socket_path).await?);
return Err(err);
}
Ok(UpdateLoopControl::Stop)
}
}
async fn sleep_or_terminate(duration: Duration, terminate: &mut Signal) -> bool {
@@ -405,7 +353,6 @@ async fn update_once(
"daemon package root changed during the update; retry the command"
);
let started = std::time::Instant::now();
#[cfg(unix)]
if matches!(
crate::diagnostics::result(
"installer_run",
@@ -416,11 +363,6 @@ async fn update_once(
) {
return Ok((UpdateLoopControl::Stop, None));
}
#[cfg(windows)]
tokio::select! {
result = run_installer_script(&script, installer_mode, &package_root) => { crate::diagnostics::result("installer_run", started, result)?; },
_ = terminate.recv() => return Ok((UpdateLoopControl::Stop, None)),
}
anyhow::ensure!(
trigger == UpdateTrigger::Scheduled || daemon.is_stable_standalone_release()?,
"installer did not select a stable latest release; retry the update"
@@ -553,7 +495,6 @@ async fn current_updater_identity() -> Result<ExecutableIdentity> {
executable_identity(&current_exe).await
}
#[cfg(unix)]
pub(crate) fn reexec_managed_updater(managed_codex_bin: &Path, state_dir: &Path) -> Result<()> {
let mut command = StdCommand::new(managed_codex_bin);
command.args(["app-server", "daemon", "pid-update-loop"]);
@@ -577,23 +518,14 @@ async fn run_installer_script(
script: &[u8],
mode: InstallerMode<'_>,
package_root: &Path,
#[cfg(unix)] terminate: impl std::future::Future<Output = Option<()>>,
terminate: impl std::future::Future<Output = Option<()>>,
) -> Result<UpdateLoopControl> {
#[cfg(unix)]
let mut command = {
let mut command = Command::new("/bin/sh");
command.arg("-s");
command.process_group(0);
command
};
#[cfg(windows)]
let mut command = {
let mut command = Command::new("powershell.exe");
command.creation_flags(windows_sys::Win32::System::Threading::CREATE_NO_WINDOW);
command.args(["-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", "[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false); try { Invoke-Expression ([Console]::In.ReadToEnd()) } catch { Write-Error $_; exit 1 }"])
.kill_on_drop(true);
command
};
let (latest_guard, current_guard, previous_release, defer_selection) = match mode {
InstallerMode::Update(release) => ("1", "0", release, "0"),
InstallerMode::RestoreProduction(release) => ("0", "1", release, "0"),
@@ -662,23 +594,16 @@ async fn run_installer_script(
}
}
});
#[cfg(windows)]
let _installer_job = crate::backend::windows::installer_job(&child)?;
let mut stdin = child
.stdin
.take()
.context("standalone Codex updater stdin was unavailable")?;
#[cfg(unix)]
let mut terminate = std::pin::pin!(terminate);
#[cfg(unix)]
let write_result = tokio::select! {
result = stdin.write_all(script) => Some(result),
_ = &mut terminate => None,
};
#[cfg(windows)]
let write_result = Some(stdin.write_all(script).await);
drop(stdin);
#[cfg(unix)]
if write_result.is_none() {
cancel_installer(&mut child, package_root).await;
stderr_task.abort();
@@ -688,7 +613,6 @@ async fn run_installer_script(
stderr_task.abort();
return Err(err).context("failed to pass standalone Codex updater to shell");
}
#[cfg(unix)]
let status = tokio::select! {
result = child.wait() => result,
_ = &mut terminate => {
@@ -696,8 +620,6 @@ async fn run_installer_script(
return Ok(UpdateLoopControl::Stop);
}
};
#[cfg(windows)]
let status = child.wait().await;
let status = match status {
Ok(status) => status,
Err(err) => {
@@ -725,7 +647,6 @@ async fn run_installer_script(
}
}
#[cfg(unix)]
async fn cancel_installer(child: &mut tokio::process::Child, package_root: &Path) {
let Some(pid) = child.id().and_then(|pid| libc::pid_t::try_from(pid).ok()) else {
return;
@@ -795,15 +716,3 @@ impl InstallerHttp for RouteAwareClientPool {
#[cfg(test)]
#[path = "update_loop_tests.rs"]
mod tests;
#[cfg(windows)]
struct Signal;
#[cfg(windows)]
impl Signal {
async fn recv(&mut self) -> Option<()> {
// An unreadable control path must stop the updater rather than disable shutdown.
let _ = codex_app_server_transport::daemon_shutdown_signal().await;
Some(())
}
}
@@ -1,28 +1,19 @@
use std::sync::Mutex;
#[cfg(unix)]
use std::time::Duration;
use pretty_assertions::assert_eq;
#[cfg(unix)]
use tempfile::TempDir;
use super::INSTALL_URL;
use super::InstallerHttp;
use super::InstallerResponse;
use super::fetch_installer_script;
#[cfg(unix)]
use super::manual_update::run as manual_update_once;
#[cfg(unix)]
use crate::Daemon;
#[cfg(unix)]
use crate::RestartIfRunningOutcome;
#[cfg(unix)]
use crate::UpdateOutput;
#[cfg(unix)]
use crate::UpdateStatus;
#[cfg(unix)]
use crate::managed_install::executable_identity;
#[cfg(unix)]
use crate::managed_install::executable_identity_from_reader;
#[tokio::test]
@@ -51,7 +42,6 @@ async fn installer_fetch_rejects_non_success_status() {
assert_eq!(http.requested_urls(), vec![INSTALL_URL.to_string()]);
}
#[cfg(unix)]
#[test]
fn updater_reexec_preserves_paths_and_recovers_deleted_working_directory() {
use std::os::unix::ffi::OsStrExt;
@@ -155,7 +145,6 @@ fn updater_reexec_preserves_paths_and_recovers_deleted_working_directory() {
}
}
#[cfg(unix)]
#[test]
fn updater_reexec_child() {
use std::os::unix::process::CommandExt;
@@ -194,7 +183,6 @@ struct FakeInstallerHttp {
requested_urls: Mutex<Vec<String>>,
}
#[cfg(unix)]
#[tokio::test]
async fn explicit_update_migrates_running_and_stopped_installations() {
for (running, local) in [(false, false), (true, false), (false, true), (true, true)] {
@@ -372,7 +360,6 @@ impl InstallerHttp for FakeInstallerHttp {
}
}
#[cfg(unix)]
#[tokio::test]
async fn cancelling_installer_stops_children_and_releases_fallback_lock() {
let home = tempfile::TempDir::new().expect("home");
@@ -417,7 +404,6 @@ async fn cancelling_installer_stops_children_and_releases_fallback_lock() {
assert!(!delayed.exists());
}
#[cfg(unix)]
fn manual_update_daemon(home: &TempDir) -> (Daemon, String) {
let target = if cfg!(target_os = "macos") {
format!("{}-apple-darwin", std::env::consts::ARCH)
@@ -453,13 +439,11 @@ fn manual_update_daemon(home: &TempDir) -> (Daemon, String) {
)
}
#[cfg(unix)]
fn test_terminate() -> tokio::signal::unix::Signal {
tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())
.expect("install test signal handler")
}
#[cfg(unix)]
#[tokio::test]
async fn manual_request_retries_after_updater_replacement() {
use tokio::io::AsyncReadExt;
@@ -513,7 +497,6 @@ async fn manual_request_retries_after_updater_replacement() {
server.await.expect("replacement task");
}
#[cfg(unix)]
#[tokio::test]
async fn manual_request_accepts_maximum_installer_stderr_detail() {
use tokio::io::AsyncReadExt;
@@ -553,7 +536,6 @@ async fn manual_request_accepts_maximum_installer_stderr_detail() {
server.await.expect("server task");
}
#[cfg(unix)]
#[tokio::test]
async fn manual_request_recovers_when_one_shot_updater_exits() {
use tokio::io::AsyncReadExt;
@@ -591,7 +573,6 @@ async fn manual_request_recovers_when_one_shot_updater_exits() {
server.await.expect("updater task");
}
#[cfg(unix)]
#[tokio::test]
async fn unsupported_request_preserves_updater_schedule() {
use tokio::io::AsyncReadExt;
@@ -667,7 +648,6 @@ async fn unsupported_request_preserves_updater_schedule() {
worker.abort();
}
#[cfg(unix)]
async fn test_control_server(
daemon: &Daemon,
home: &std::path::Path,
@@ -716,7 +696,6 @@ async fn test_control_server(
})
}
#[cfg(unix)]
#[tokio::test]
async fn scheduled_no_op_preserves_daemon_and_hands_off_stale_updater() {
let home = TempDir::new().expect("home");
@@ -776,7 +755,6 @@ async fn scheduled_no_op_preserves_daemon_and_hands_off_stale_updater() {
server.abort();
}
#[cfg(unix)]
#[tokio::test]
async fn scheduled_resource_only_update_restarts_daemon() {
let home = TempDir::new().expect("home");
@@ -823,13 +801,11 @@ async fn scheduled_resource_only_update_restarts_daemon() {
server.abort();
}
#[cfg(unix)]
#[tokio::test]
async fn manual_update_restarts_managed_daemon_with_automatic_updates_disabled() {
check_manual_update_restart("standalone").await;
}
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[tokio::test]
async fn readiness_waits_for_a_slow_managed_daemon() {
let home = TempDir::new().unwrap();
@@ -858,7 +834,6 @@ async fn readiness_waits_for_a_slow_managed_daemon() {
assert_eq!(ready.unwrap().app_server_version, "1.0.0");
}
#[cfg(unix)]
#[tokio::test]
async fn daemon_start_and_restart_preserve_launch_features() {
for features in [
@@ -934,7 +909,6 @@ async fn daemon_start_and_restart_preserve_launch_features() {
}
}
#[cfg(unix)]
#[tokio::test]
async fn confirmed_feature_restart_preserves_ownership_and_skips_matching_settings() {
use crate::LifecycleStatus;
@@ -1002,13 +976,11 @@ async fn confirmed_feature_restart_preserves_ownership_and_skips_matching_settin
}
}
#[cfg(unix)]
#[tokio::test]
async fn manual_update_restarts_local_daemon_with_automatic_updates_disabled() {
check_manual_update_restart("app-server-daemon").await;
}
#[cfg(unix)]
async fn check_manual_update_restart(package_directory: &str) {
use tokio::io::AsyncReadExt;
use tokio::io::AsyncWriteExt;
@@ -1176,48 +1148,6 @@ async fn check_manual_update_restart(package_directory: &str) {
server.abort();
}
#[cfg(windows)]
#[tokio::test]
async fn powershell_installer_is_noninteractive_and_reports_script_failure() {
let valid = FakeInstallerHttp::new(InstallerResponse::Success(
br#"
function Test-Installer {
if ($env:CODEX_NON_INTERACTIVE -ne '1') { throw 'interactive installer' }
if ($env:CODEX_INSTALL_DAEMON_ONLY -ne '1') { throw 'wrong package destination' }
if ($env:CODEX_INSTALL_IF_CURRENT -ne '1' -or $env:CODEX_INSTALL_IF_LATEST -ne '0') { throw 'wrong update guard' }
}
Test-Installer
"#
.to_vec(),
));
let script = super::fetch_installer_script(&valid)
.await
.expect("fetch installer");
super::run_installer_script(
&script,
super::InstallerMode::RestoreProduction("0.150.0-x86_64-pc-windows-msvc"),
std::path::Path::new("packages/app-server-daemon"),
)
.await
.expect("installer succeeds");
let failing = FakeInstallerHttp::new(InstallerResponse::Success(
b"throw ([string][char]0x00E9 + 'chec installation')".to_vec(),
));
let script = super::fetch_installer_script(&failing)
.await
.expect("fetch failing installer");
let error = super::run_installer_script(
&script,
super::InstallerMode::RestoreProduction("0.150.0-x86_64-pc-windows-msvc"),
std::path::Path::new("packages/app-server-daemon"),
)
.await
.err()
.expect("installer should fail");
assert!(error.to_string().contains("échec installation"));
}
#[cfg(unix)]
#[tokio::test]
async fn installer_failure_includes_stderr() {
let script = format!(
@@ -1238,7 +1168,6 @@ async fn installer_failure_includes_stderr() {
assert!(!error.contains("discard me"));
}
#[cfg(unix)]
#[tokio::test]
async fn installer_failure_preserves_stderr_before_drain_timeout() {
let error = tokio::time::timeout(
@@ -1257,7 +1186,6 @@ async fn installer_failure_preserves_stderr_before_drain_timeout() {
assert!(error.to_string().contains("installer failed"));
}
#[cfg(unix)]
#[tokio::test]
async fn update_rejects_a_package_root_change_during_download() {
struct ChangingRoot<'a>(&'a std::path::Path);
@@ -1289,7 +1217,6 @@ async fn update_rejects_a_package_root_change_during_download() {
assert!(error.to_string().contains("package root changed"));
}
#[cfg(unix)]
#[tokio::test]
async fn daemon_owned_updates_require_and_request_an_isolated_installer() {
let home = TempDir::new().unwrap();
+76 -2
View File
@@ -1678,6 +1678,36 @@
],
"type": "object"
},
"GatewayOAuthLoginParams": {
"description": "Authorize a configured provider without changing the default or any thread's provider.",
"properties": {
"deviceAuth": {
"description": "Select device authorization when the server advertises support for it.",
"type": "boolean"
},
"modelProvider": {
"description": "Defaults to the current provider when omitted.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"GatewayOAuthReadParams": {
"description": "Read credential readiness for a configured provider without starting browser login.",
"properties": {
"modelProvider": {
"description": "Defaults to the current provider when omitted.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"GcpProviderId": {
"enum": [
"gcp"
@@ -2459,6 +2489,13 @@
"integer",
"null"
]
},
"modelProvider": {
"description": "List models for this configured provider instead of the app-server default.",
"type": [
"string",
"null"
]
}
},
"type": "object"
@@ -8178,7 +8215,14 @@
"type": "string"
},
"params": {
"type": "null"
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthReadParams"
},
{
"type": "null"
}
]
}
},
"required": [
@@ -8201,7 +8245,14 @@
"type": "string"
},
"params": {
"type": "null"
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthLoginParams"
},
{
"type": "null"
}
]
}
},
"required": [
@@ -8615,6 +8666,29 @@
"title": "Account/logoutRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"account/securitySetup/read"
],
"title": "Account/securitySetup/readRequestMethod",
"type": "string"
},
"params": {
"type": "null"
}
},
"required": [
"id",
"method"
],
"title": "Account/securitySetup/readRequest",
"type": "object"
},
{
"properties": {
"id": {
@@ -177,6 +177,58 @@
],
"type": "object"
},
"AgentMessageDisplay": {
"description": "A presentation instruction for Chat to apply to this answer when recovering history.",
"properties": {
"action": {
"description": "Unknown actions must be left for the producing client to handle.",
"type": "string"
},
"blockType": {
"type": [
"string",
"null"
]
},
"checkTrustedContacts": {
"type": [
"boolean",
"null"
]
},
"cyberTrustedAccess": {
"type": [
"boolean",
"null"
]
}
},
"required": [
"action"
],
"type": "object"
},
"AgentMessageModeration": {
"properties": {
"display": {
"anyOf": [
{
"$ref": "#/definitions/AgentMessageDisplay"
},
{
"type": "null"
}
]
},
"moderated": {
"type": "boolean"
}
},
"required": [
"moderated"
],
"type": "object"
},
"AgentPath": {
"type": "string"
},
@@ -677,6 +729,13 @@
],
"type": "string"
},
{
"description": "The workspace's inference hook explicitly denied this request.",
"enum": [
"inferenceHookDenied"
],
"type": "string"
},
{
"additionalProperties": false,
"properties": {
@@ -1958,6 +2017,13 @@
"null"
]
},
"loginId": {
"description": "Identifies the completed device login attempt.",
"type": [
"string",
"null"
]
},
"providerId": {
"type": "string"
},
@@ -4750,6 +4816,17 @@
],
"default": null
},
"moderation": {
"anyOf": [
{
"$ref": "#/definitions/AgentMessageModeration"
},
{
"type": "null"
}
],
"default": null
},
"phase": {
"anyOf": [
{
@@ -1850,7 +1850,14 @@
"type": "string"
},
"params": {
"type": "null"
"anyOf": [
{
"$ref": "#/definitions/v2/GatewayOAuthReadParams"
},
{
"type": "null"
}
]
}
},
"required": [
@@ -1873,7 +1880,14 @@
"type": "string"
},
"params": {
"type": "null"
"anyOf": [
{
"$ref": "#/definitions/v2/GatewayOAuthLoginParams"
},
{
"type": "null"
}
]
}
},
"required": [
@@ -2287,6 +2301,29 @@
"title": "Account/logoutRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/v2/RequestId"
},
"method": {
"enum": [
"account/securitySetup/read"
],
"title": "Account/securitySetup/readRequestMethod",
"type": "string"
},
"params": {
"type": "null"
}
},
"required": [
"id",
"method"
],
"title": "Account/securitySetup/readRequest",
"type": "object"
},
{
"properties": {
"id": {
@@ -7002,6 +7039,48 @@
],
"type": "string"
},
"AccountSecuritySetupAction": {
"properties": {
"label": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"label",
"url"
],
"type": "object"
},
"AccountSecuritySetupNotice": {
"properties": {
"accountId": {
"type": "string"
},
"action": {
"$ref": "#/definitions/v2/AccountSecuritySetupAction"
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"accountId",
"action",
"description",
"title",
"userId"
],
"type": "object"
},
"AccountSession": {
"properties": {
"displayName": {
@@ -7329,6 +7408,37 @@
"title": "AgentMessageDeltaNotification",
"type": "object"
},
"AgentMessageDisplay": {
"description": "A presentation instruction for Chat to apply to this answer when recovering history.",
"properties": {
"action": {
"description": "Unknown actions must be left for the producing client to handle.",
"type": "string"
},
"blockType": {
"type": [
"string",
"null"
]
},
"checkTrustedContacts": {
"type": [
"boolean",
"null"
]
},
"cyberTrustedAccess": {
"type": [
"boolean",
"null"
]
}
},
"required": [
"action"
],
"type": "object"
},
"AgentMessageInputContent": {
"oneOf": [
{
@@ -7373,6 +7483,27 @@
}
]
},
"AgentMessageModeration": {
"properties": {
"display": {
"anyOf": [
{
"$ref": "#/definitions/v2/AgentMessageDisplay"
},
{
"type": "null"
}
]
},
"moderated": {
"type": "boolean"
}
},
"required": [
"moderated"
],
"type": "object"
},
"AgentPath": {
"type": "string"
},
@@ -8794,6 +8925,13 @@
],
"type": "string"
},
{
"description": "The workspace's inference hook explicitly denied this request.",
"enum": [
"inferenceHookDenied"
],
"type": "string"
},
{
"additionalProperties": false,
"properties": {
@@ -13163,6 +13301,13 @@
"null"
]
},
"loginId": {
"description": "Identifies the completed device login attempt.",
"type": [
"string",
"null"
]
},
"providerId": {
"type": "string"
},
@@ -13177,11 +13322,72 @@
"title": "GatewayOAuthChangedNotification",
"type": "object"
},
"GatewayOAuthLoginParams": {
"description": "Authorize a configured provider without changing the default or any thread's provider.",
"properties": {
"deviceAuth": {
"description": "Select device authorization when the server advertises support for it.",
"type": "boolean"
},
"modelProvider": {
"description": "Defaults to the current provider when omitted.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"GatewayOAuthLoginResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"prompt": {
"anyOf": [
{
"$ref": "#/definitions/v2/GatewayOAuthPrompt"
},
{
"type": "null"
}
]
}
},
"title": "GatewayOAuthLoginResponse",
"type": "object"
},
"GatewayOAuthPrompt": {
"properties": {
"loginId": {
"type": "string"
},
"userCode": {
"type": "string"
},
"verificationUrl": {
"type": "string"
}
},
"required": [
"loginId",
"userCode",
"verificationUrl"
],
"type": "object"
},
"GatewayOAuthReadParams": {
"description": "Read credential readiness for a configured provider without starting browser login.",
"properties": {
"modelProvider": {
"description": "Defaults to the current provider when omitted.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"GatewayOAuthReadResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Current effective gateway policy and credential readiness; never contains credentials.",
@@ -13212,6 +13418,11 @@
}
],
"description": "Null when the effective provider does not use gateway OAuth."
},
"supportsDeviceAuth": {
"default": false,
"description": "Whether the administrator configured a device authorization endpoint.",
"type": "boolean"
}
},
"required": [
@@ -13332,6 +13543,14 @@
},
"requiresOpenaiAuth": {
"type": "boolean"
},
"userId": {
"default": null,
"description": "ChatGPT user ID belonging to this account response, when available.",
"type": [
"string",
"null"
]
}
},
"required": [
@@ -13340,6 +13559,24 @@
"title": "GetAccountResponse",
"type": "object"
},
"GetAccountSecuritySetupResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Optional security reminder bound to the account that fetched it. Unavailable or ineligible accounts return no notice; this read never changes account security.",
"properties": {
"notice": {
"anyOf": [
{
"$ref": "#/definitions/v2/AccountSecuritySetupNotice"
},
{
"type": "null"
}
]
}
},
"title": "GetAccountSecuritySetupResponse",
"type": "object"
},
"GetAccountTokenUsageParams": {
"properties": {
"threadId": {
@@ -16270,6 +16507,13 @@
"integer",
"null"
]
},
"modelProvider": {
"description": "List models for this configured provider instead of the app-server default.",
"type": [
"string",
"null"
]
}
},
"title": "ModelListParams",
@@ -16879,6 +17123,30 @@
],
"type": "string"
},
"NullableGatewayOAuthLoginParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/definitions/v2/GatewayOAuthLoginParams"
},
{
"type": "null"
}
],
"title": "Nullable_GatewayOAuthLoginParams"
},
"NullableGatewayOAuthReadParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/definitions/v2/GatewayOAuthReadParams"
},
{
"type": "null"
}
],
"title": "Nullable_GatewayOAuthReadParams"
},
"NullableGetAccountRateLimitsParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
@@ -17660,7 +17928,7 @@
]
},
"defaultPrompt": {
"description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.",
"description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 512 characters per entry.",
"items": {
"type": "string"
},
@@ -19173,6 +19441,16 @@
"$ref": "#/definitions/v2/UserInput"
},
"type": "array"
},
"responsesapiClientMetadata": {
"additionalProperties": {
"type": "string"
},
"description": "Metadata retained with this input, including across reconnect and restoration.",
"type": [
"object",
"null"
]
}
},
"required": [
@@ -23357,6 +23635,17 @@
],
"default": null
},
"moderation": {
"anyOf": [
{
"$ref": "#/definitions/v2/AgentMessageModeration"
},
{
"type": "null"
}
],
"default": null
},
"phase": {
"anyOf": [
{
@@ -154,6 +154,48 @@
],
"type": "string"
},
"AccountSecuritySetupAction": {
"properties": {
"label": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"label",
"url"
],
"type": "object"
},
"AccountSecuritySetupNotice": {
"properties": {
"accountId": {
"type": "string"
},
"action": {
"$ref": "#/definitions/AccountSecuritySetupAction"
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"accountId",
"action",
"description",
"title",
"userId"
],
"type": "object"
},
"AccountSession": {
"properties": {
"displayName": {
@@ -481,6 +523,37 @@
"title": "AgentMessageDeltaNotification",
"type": "object"
},
"AgentMessageDisplay": {
"description": "A presentation instruction for Chat to apply to this answer when recovering history.",
"properties": {
"action": {
"description": "Unknown actions must be left for the producing client to handle.",
"type": "string"
},
"blockType": {
"type": [
"string",
"null"
]
},
"checkTrustedContacts": {
"type": [
"boolean",
"null"
]
},
"cyberTrustedAccess": {
"type": [
"boolean",
"null"
]
}
},
"required": [
"action"
],
"type": "object"
},
"AgentMessageInputContent": {
"oneOf": [
{
@@ -525,6 +598,27 @@
}
]
},
"AgentMessageModeration": {
"properties": {
"display": {
"anyOf": [
{
"$ref": "#/definitions/AgentMessageDisplay"
},
{
"type": "null"
}
]
},
"moderated": {
"type": "boolean"
}
},
"required": [
"moderated"
],
"type": "object"
},
"AgentPath": {
"type": "string"
},
@@ -3594,7 +3688,14 @@
"type": "string"
},
"params": {
"type": "null"
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthReadParams"
},
{
"type": "null"
}
]
}
},
"required": [
@@ -3617,7 +3718,14 @@
"type": "string"
},
"params": {
"type": "null"
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthLoginParams"
},
{
"type": "null"
}
]
}
},
"required": [
@@ -4031,6 +4139,29 @@
"title": "Account/logoutRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"account/securitySetup/read"
],
"title": "Account/securitySetup/readRequestMethod",
"type": "string"
},
"params": {
"type": "null"
}
},
"required": [
"id",
"method"
],
"title": "Account/securitySetup/readRequest",
"type": "object"
},
{
"properties": {
"id": {
@@ -4575,6 +4706,13 @@
],
"type": "string"
},
{
"description": "The workspace's inference hook explicitly denied this request.",
"enum": [
"inferenceHookDenied"
],
"type": "string"
},
{
"additionalProperties": false,
"properties": {
@@ -9055,6 +9193,13 @@
"null"
]
},
"loginId": {
"description": "Identifies the completed device login attempt.",
"type": [
"string",
"null"
]
},
"providerId": {
"type": "string"
},
@@ -9069,11 +9214,72 @@
"title": "GatewayOAuthChangedNotification",
"type": "object"
},
"GatewayOAuthLoginParams": {
"description": "Authorize a configured provider without changing the default or any thread's provider.",
"properties": {
"deviceAuth": {
"description": "Select device authorization when the server advertises support for it.",
"type": "boolean"
},
"modelProvider": {
"description": "Defaults to the current provider when omitted.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"GatewayOAuthLoginResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"prompt": {
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthPrompt"
},
{
"type": "null"
}
]
}
},
"title": "GatewayOAuthLoginResponse",
"type": "object"
},
"GatewayOAuthPrompt": {
"properties": {
"loginId": {
"type": "string"
},
"userCode": {
"type": "string"
},
"verificationUrl": {
"type": "string"
}
},
"required": [
"loginId",
"userCode",
"verificationUrl"
],
"type": "object"
},
"GatewayOAuthReadParams": {
"description": "Read credential readiness for a configured provider without starting browser login.",
"properties": {
"modelProvider": {
"description": "Defaults to the current provider when omitted.",
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"GatewayOAuthReadResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Current effective gateway policy and credential readiness; never contains credentials.",
@@ -9104,6 +9310,11 @@
}
],
"description": "Null when the effective provider does not use gateway OAuth."
},
"supportsDeviceAuth": {
"default": false,
"description": "Whether the administrator configured a device authorization endpoint.",
"type": "boolean"
}
},
"required": [
@@ -9224,6 +9435,14 @@
},
"requiresOpenaiAuth": {
"type": "boolean"
},
"userId": {
"default": null,
"description": "ChatGPT user ID belonging to this account response, when available.",
"type": [
"string",
"null"
]
}
},
"required": [
@@ -9232,6 +9451,24 @@
"title": "GetAccountResponse",
"type": "object"
},
"GetAccountSecuritySetupResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Optional security reminder bound to the account that fetched it. Unavailable or ineligible accounts return no notice; this read never changes account security.",
"properties": {
"notice": {
"anyOf": [
{
"$ref": "#/definitions/AccountSecuritySetupNotice"
},
{
"type": "null"
}
]
}
},
"title": "GetAccountSecuritySetupResponse",
"type": "object"
},
"GetAccountTokenUsageParams": {
"properties": {
"threadId": {
@@ -12231,6 +12468,13 @@
"integer",
"null"
]
},
"modelProvider": {
"description": "List models for this configured provider instead of the app-server default.",
"type": [
"string",
"null"
]
}
},
"title": "ModelListParams",
@@ -12840,6 +13084,30 @@
],
"type": "string"
},
"NullableGatewayOAuthLoginParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthLoginParams"
},
{
"type": "null"
}
],
"title": "Nullable_GatewayOAuthLoginParams"
},
"NullableGatewayOAuthReadParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthReadParams"
},
{
"type": "null"
}
],
"title": "Nullable_GatewayOAuthReadParams"
},
"NullableGetAccountRateLimitsParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
@@ -13621,7 +13889,7 @@
]
},
"defaultPrompt": {
"description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.",
"description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 512 characters per entry.",
"items": {
"type": "string"
},
@@ -15134,6 +15402,16 @@
"$ref": "#/definitions/UserInput"
},
"type": "array"
},
"responsesapiClientMetadata": {
"additionalProperties": {
"type": "string"
},
"description": "Metadata retained with this input, including across reconnect and restoration.",
"type": [
"object",
"null"
]
}
},
"required": [
@@ -21060,6 +21338,17 @@
],
"default": null
},
"moderation": {
"anyOf": [
{
"$ref": "#/definitions/AgentMessageModeration"
},
{
"type": "null"
}
],
"default": null
},
"phase": {
"anyOf": [
{
@@ -25,6 +25,13 @@
],
"type": "string"
},
{
"description": "The workspace's inference hook explicitly denied this request.",
"enum": [
"inferenceHookDenied"
],
"type": "string"
},
{
"additionalProperties": false,
"properties": {
@@ -25,6 +25,13 @@
"null"
]
},
"loginId": {
"description": "Identifies the completed device login attempt.",
"type": [
"string",
"null"
]
},
"providerId": {
"type": "string"
},
@@ -1,5 +1,38 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"GatewayOAuthPrompt": {
"properties": {
"loginId": {
"type": "string"
},
"userCode": {
"type": "string"
},
"verificationUrl": {
"type": "string"
}
},
"required": [
"loginId",
"userCode",
"verificationUrl"
],
"type": "object"
}
},
"properties": {
"prompt": {
"anyOf": [
{
"$ref": "#/definitions/GatewayOAuthPrompt"
},
{
"type": "null"
}
]
}
},
"title": "GatewayOAuthLoginResponse",
"type": "object"
}
@@ -39,6 +39,11 @@
}
],
"description": "Null when the effective provider does not use gateway OAuth."
},
"supportsDeviceAuth": {
"default": false,
"description": "Whether the administrator configured a device authorization endpoint.",
"type": "boolean"
}
},
"required": [
@@ -159,6 +159,14 @@
},
"requiresOpenaiAuth": {
"type": "boolean"
},
"userId": {
"default": null,
"description": "ChatGPT user ID belonging to this account response, when available.",
"type": [
"string",
"null"
]
}
},
"required": [
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"AccountSecuritySetupAction": {
"properties": {
"label": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"label",
"url"
],
"type": "object"
},
"AccountSecuritySetupNotice": {
"properties": {
"accountId": {
"type": "string"
},
"action": {
"$ref": "#/definitions/AccountSecuritySetupAction"
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"accountId",
"action",
"description",
"title",
"userId"
],
"type": "object"
}
},
"description": "Optional security reminder bound to the account that fetched it. Unavailable or ineligible accounts return no notice; this read never changes account security.",
"properties": {
"notice": {
"anyOf": [
{
"$ref": "#/definitions/AccountSecuritySetupNotice"
},
{
"type": "null"
}
]
}
},
"title": "GetAccountSecuritySetupResponse",
"type": "object"
}
@@ -11,6 +11,58 @@
],
"type": "string"
},
"AgentMessageDisplay": {
"description": "A presentation instruction for Chat to apply to this answer when recovering history.",
"properties": {
"action": {
"description": "Unknown actions must be left for the producing client to handle.",
"type": "string"
},
"blockType": {
"type": [
"string",
"null"
]
},
"checkTrustedContacts": {
"type": [
"boolean",
"null"
]
},
"cyberTrustedAccess": {
"type": [
"boolean",
"null"
]
}
},
"required": [
"action"
],
"type": "object"
},
"AgentMessageModeration": {
"properties": {
"display": {
"anyOf": [
{
"$ref": "#/definitions/AgentMessageDisplay"
},
{
"type": "null"
}
]
},
"moderated": {
"type": "boolean"
}
},
"required": [
"moderated"
],
"type": "object"
},
"AsyncUserInputQuestion": {
"additionalProperties": false,
"properties": {
@@ -886,6 +938,17 @@
],
"default": null
},
"moderation": {
"anyOf": [
{
"$ref": "#/definitions/AgentMessageModeration"
},
{
"type": "null"
}
],
"default": null
},
"phase": {
"anyOf": [
{
Loaded 100 of 2718 files, more files were not shown because too many files have changed in this diff. Show more