Commit Graph
5765 Commits
Author SHA1 Message Date
rhan-oai 849f379028 [codex-analytics] add token usage metadata 2026-04-06 14:46:13 -07:00
rhan-oai 46bfa52228 [codex-analytics] feature plumbing and emittance 2026-04-06 14:46:13 -07:00
rhan-oai 5aec095559 [codex-analytics] add protocol-native turn timestamps 2026-04-06 14:46:13 -07:00
rhan-oai e4d62495df Merge c10e642b9d into sapling-pr-archive-rhan-oai 2026-04-06 14:38:27 -07:00
rhan-oai cc53e0a88f merge commit for archive created by Sapling 2026-04-06 14:31:45 -07:00
joeytrasatti-openai 03c07956cf Revert "[codex-backend] Make thread metadata updates tolerate pending backfill" (#16923)
Reverts openai/codex#16877
2026-04-06 21:25:05 +00:00
rhan-oai c10e642b9d [codex-analytics] denormalize thread metadata onto turn events 2026-04-06 14:23:25 -07:00
rhan-oai a548a383cb [codex-analytics] add steering metadata 2026-04-06 14:23:25 -07:00
rhan-oai 3364e5711d [codex-analytics] add queued submission metadata 2026-04-06 14:23:25 -07:00
rhan-oai 0d848f34d4 [codex-analytics] add token usage metadata 2026-04-06 14:23:25 -07:00
rhan-oai 23f327c304 [codex-analytics] feature plumbing and emittance 2026-04-06 14:22:49 -07:00
rhan-oai 81394bede0 [codex-analytics] add protocol-native turn timestamps 2026-04-06 14:22:49 -07:00
Matthew Zeng 756ba8baae Fix clippy warning (#16939)
- [x] Fix clippy warning
2026-04-06 14:08:55 -07:00
rhan-oai 56ed421c37 merge commit for archive created by Sapling 2026-04-06 13:54:38 -07:00
rhan-oai 71db64b48a [codex-analytics] feature plumbing and emittance 2026-04-06 13:52:25 -07:00
rhan-oai bab096c2b1 [codex-analytics] add protocol-native turn timestamps 2026-04-06 13:50:42 -07:00
rhan-oai 98c8f049da Merge 70a1fb26bc into sapling-pr-archive-rhan-oai 2026-04-06 13:14:49 -07:00
rhan-oai 70a1fb26bc [codex-analytics] denormalize thread metadata onto turn events 2026-04-06 13:13:44 -07:00
rhan-oai 9e7e31966f [codex-analytics] add steering metadata 2026-04-06 13:13:44 -07:00
rhan-oai 59cfda78e2 [codex-analytics] add queued submission metadata 2026-04-06 13:13:44 -07:00
rhan-oai 472c15a74b [codex-analytics] add token usage metadata 2026-04-06 13:13:44 -07:00
rhan-oai 031eb880e7 [codex-analytics] feature plumbing and emittance 2026-04-06 13:13:44 -07:00
rhan-oai 6d273dd348 [codex-analytics] add protocol-native turn timestamps 2026-04-06 13:13:44 -07:00
Ruslan Nigmatullin 1525bbdb9a app-server: centralize AuthManager initialization (#16764)
Extract a shared helper that builds AuthManager from Config and applies
the forced ChatGPT workspace override in one place.

Create the shared AuthManager at MessageProcessor call sites so that
upcoming new transport's initialization can reuse the same handle, and
keep only external auth refresher wiring inside `MessageProcessor`.

Remove the now-unused `AuthManager::shared_with_external_auth` helper.
2026-04-06 12:46:55 -07:00
rhan-oai 15df7e9936 Merge e6908c1171 into sapling-pr-archive-rhan-oai 2026-04-06 12:28:57 -07:00
rhan-oai 6e17b89587 merge commit for archive created by Sapling 2026-04-06 12:28:06 -07:00
rhan-oai e6908c1171 [codex-analytics] denormalize thread metadata onto turn events 2026-04-06 12:26:33 -07:00
rhan-oai f3bafdcad9 [codex-analytics] add protocol-native turn timestamps 2026-04-06 12:26:33 -07:00
rhan-oai 4289d3b130 [codex-analytics] add steering metadata 2026-04-06 12:26:33 -07:00
rhan-oai 98de5a3fe6 [codex-analytics] add queued submission metadata 2026-04-06 12:26:33 -07:00
rhan-oai c2d5e2ab97 [codex-analytics] add token usage metadata 2026-04-06 12:26:33 -07:00
rhan-oai a695f27378 [codex-analytics] feature plumbing and emittance 2026-04-06 12:26:33 -07:00
starr-openaiandCodex 46b7e4fb2c build: restore lzma-sys Bazel wiring for devbox codex run (#16744)
## Summary
- restore the `#16634` `lzma-sys` / `xz` Bazel wiring that was reverted
from `main`
- re-enable direct Bazel linkage to `@xz//:lzma` with the `lzma-sys`
build script disabled
- restore the matching `MODULE.bazel.lock` entries

## Why
`origin/main` currently builds `//codex-rs/cli:cli` on a devbox, but
`bazel run //codex-rs/cli:codex -- --version` fails at link time on the
same remote path. Restoring `#16634` fixes that repro.

## Validation
- on `origin/main`: `bazel build --bes_backend= --bes_results_url=
//codex-rs/cli:cli` passed
- on `origin/main`: `bazel run --bes_backend= --bes_results_url=
//codex-rs/cli:codex -- --version` failed on `dev`
- after this patch on the same `dev` mirror: `bazel run --bes_backend=
--bes_results_url= //codex-rs/cli:codex -- --version` passed and printed
`codex 0.0.0`

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-06 12:21:58 -07:00
Owen Lin 9bb813353e fix(sqlite): don't hard fail migrator if DB is newer (#16924)
## Description

This PR makes the SQLite state runtime tolerate databases that have
already been migrated by a newer Codex binary.

Today, if an older CLI sees migration versions in `_sqlx_migrations`
that it doesn't know about, startup fails. This change relaxes that
check for the runtime migrators we use in `codex-state` so older
binaries can keep opening the DB in that case.

## Why

We can end up with mixed-version CLIs running against the same local
state DB. In that setup, treating "the database is ahead of me" as a
hard error is unnecessarily strict and breaks the older client even when
the migration history is otherwise fine.

## Follow-up

We still clean up versioned `state_*.sqlite` and `logs_*.sqlite` files
during init, so older binaries can treat newer DB files as legacy. That
should probably be tightened separately if we want mixed-version local
usage to be fully safe.
2026-04-06 12:16:31 -07:00
Owen Lin bd30bad96f fix(guardian): fix ordering of guardian events (#16462)
Guardian events were emitted a bit out of order for CommandExecution
items. This would make it hard for the frontend to render a guardian
auto-review, which has this payload:
```
pub struct ItemGuardianApprovalReviewStartedNotification {
    pub thread_id: String,
    pub turn_id: String,
    pub target_item_id: String,
    pub review: GuardianApprovalReview,
    // FYI this is no longer a json blob
    pub action: Option<JsonValue>,
}
```

There is a `target_item_id` the auto-approval review is referring to,
but the actual item had not been emitted yet.

Before this PR:
- `item/autoApprovalReview/started`
- `item/autoApprovalReview/completed`, and if approved...
- `item/started`
- `item/completed`

After this PR:
- `item/started`
- `item/autoApprovalReview/started`
- `item/autoApprovalReview/completed`
- `item/completed`

This lines up much better with existing patterns (i.e. human review in
`Default mode`, where app-server would send a server request to prompt
for user approval after `item/started`), and makes it easier for clients
to render what guardian is actually reviewing.

We do this following a similar pattern as `FileChange` (aka apply patch)
items, where we create a FileChange item and emit `item/started` if we
see the apply patch approval request, before the actual apply patch call
runs.
2026-04-06 19:14:27 +00:00
rhan-oai cc2c57d57c merge commit for archive created by Sapling 2026-04-06 12:07:51 -07:00
Ruslan Nigmatullin 4eabc3dcb1 bazel: Enable --experimental_remote_downloader (#16928)
This should allow bazel to properly cache external deps.
2026-04-06 12:07:19 -07:00
Ruslan Nigmatullin 0225479f0d bazel: Always save bazel repository cache (#16926)
This should improve the cache hit ratio for external deps and such
2026-04-06 12:06:58 -07:00
Owen Lin 2b4cc221df fix(bazel): fix simdutf (#16925)
## Summary

This changes our V8 Bazel wiring so `simdutf` no longer comes from a
live `git_repository` fetch against Chromium's Googlesource host.

Instead, we pull `simdutf` from a pinned GitHub release archive and keep
the V8 `simdutf` target wired through the external repo. The
archive-backed target is set up to match the way V8 consumes `simdutf`
today, including the amalgamated `src/simdutf.cpp` entrypoint and the
internal files it includes.

## Why

CI was intermittently failing while Bazel tried to fetch:

`https://chromium.googlesource.com/chromium/src/third_party/simdutf/`

That fetch was returning HTTP 429s, which then fan out into failures in
the Bazel jobs, the SDK job, and the argument-comment lint jobs since
they all go through the same dependency resolution path.

## What changed

- replaced the `simdutf` `git_repository` in the patched V8 module deps
with a pinned `http_archive`
- pointed that archive at `simdutf` `v7.7.0` on GitHub
- added the archive hash so the fetch is deterministic
- kept the V8 BUILD patch pointing `:simdutf` at the external
`@simdutf//:simdutf` target
- configured the Bazel `cc_library` for the archive to use the
amalgamated `src/simdutf.cpp` source plus the internal headers / textual
includes it depends on

## Validation

- ran `bazel build @v8//:simdutf`
- confirmed the target builds successfully with the new archive-backed
wiring
2026-04-06 11:56:54 -07:00
rhan-oai 40945d497f [codex-analytics] add protocol-native turn timestamps 2026-04-06 11:55:09 -07:00
rhan-oai 14476dd0e5 merge commit for archive created by Sapling 2026-04-06 11:23:18 -07:00
rhan-oai 00b893b76c [codex-analytics] denormalize thread metadata onto turn events 2026-04-06 11:21:17 -07:00
rhan-oai b68ec54eb3 [codex-analytics] add steering metadata 2026-04-06 11:21:17 -07:00
rhan-oai a47c5b2ab8 [codex-analytics] add queued submission metadata 2026-04-06 11:21:17 -07:00
rhan-oai 888236ec85 [codex-analytics] add token usage metadata 2026-04-06 11:21:17 -07:00
rhan-oai 9743b13634 [codex-analytics] feature plumbing and emittance 2026-04-06 11:21:17 -07:00
rhan-oai 12d351fff9 [codex-analytics] add protocol-native turn timestamps 2026-04-06 11:21:17 -07:00
Owen Lin ded559680d feat(requirements): support allowed_approval_reviewers (#16701)
## Description

Add requirements.toml support for `allowed_approvals_reviewers =
["user", "guardian_subagent"]`, so admins can now restrict the use of
guardian mode.

Note: If a user sets a reviewer that isn’t allowed by requirements.toml,
config loading falls back to the first allowed reviewer and emits a
startup warning.

The table below describes the possible admin controls.
| Admin intent | `requirements.toml` | User `config.toml` | End result |
|---|---|---|---|
| Leave Guardian optional | omit `allowed_approvals_reviewers` or set
`["user", "guardian_subagent"]` | user chooses `approvals_reviewer =
"user"` or `"guardian_subagent"` | Guardian off for `user`, on for
`guardian_subagent` + `approval_policy = "on-request"` |
| Force Guardian off | `allowed_approvals_reviewers = ["user"]` | any
user value | Effective reviewer is `user`; Guardian off |
| Force Guardian on | `allowed_approvals_reviewers =
["guardian_subagent"]` and usually `allowed_approval_policies =
["on-request"]` | any user reviewer value; user should also have
`approval_policy = "on-request"` unless policy is forced | Effective
reviewer is `guardian_subagent`; Guardian on when effective approval
policy is `on-request` |
| Allow both, but default to manual if user does nothing |
`allowed_approvals_reviewers = ["user", "guardian_subagent"]` | omit
`approvals_reviewer` | Effective reviewer is `user`; Guardian off |
| Allow both, and user explicitly opts into Guardian |
`allowed_approvals_reviewers = ["user", "guardian_subagent"]` |
`approvals_reviewer = "guardian_subagent"` and `approval_policy =
"on-request"` | Guardian on |
| Invalid admin config | `allowed_approvals_reviewers = []` | anything |
Config load error |
2026-04-06 11:11:44 -07:00
rhan-oai e25689bbed merge commit for archive created by Sapling 2026-04-06 11:11:39 -07:00
rhan-oai 1865f543ab [codex-analytics] denormalize thread metadata onto turn events 2026-04-06 11:08:39 -07:00