Commit Graph
5765 Commits
Author SHA1 Message Date
rhan-oai d256ae0602 [codex-analytics] add steering metadata 2026-04-06 11:08:39 -07:00
rhan-oai c1b77ebb69 [codex-analytics] add queued submission metadata 2026-04-06 11:08:39 -07:00
rhan-oai 0d9875fe53 [codex-analytics] add token usage metadata 2026-04-06 11:08:39 -07:00
rhan-oai 389ad76a24 [codex-analytics] feature plumbing and emittance 2026-04-06 11:08:39 -07:00
rhan-oai bbb42eb94f [codex-analytics] add protocol-native turn timestamps 2026-04-06 11:08:39 -07:00
rhan-oai eae5b6bb06 merge commit for archive created by Sapling 2026-04-06 10:23:02 -07:00
rhan-oai 065c840299 [codex-analytics] denormalize thread metadata onto turn events 2026-04-06 10:20:07 -07:00
rhan-oai aa6b3938e4 [codex-analytics] add steering metadata 2026-04-06 10:20:07 -07:00
rhan-oai 17575bdcb5 [codex-analytics] add queued submission metadata 2026-04-06 10:20:07 -07:00
rhan-oai 204abb4d5c [codex-analytics] add token usage metadata 2026-04-06 10:20:07 -07:00
rhan-oai ff81c834f9 [codex-analytics] feature plumbing and emittance 2026-04-06 10:20:07 -07:00
rhan-oai 577abcf681 [codex-analytics] add protocol-native turn timestamps 2026-04-06 10:20:07 -07:00
joeytrasatti-openai 4ce97cef02 [codex-backend] Make thread metadata updates tolerate pending backfill (#16877)
### Summary
Fix `thread/metadata/update` so it can still patch stored thread
metadata when the list/backfill-gated `get_state_db(...)` path is
unavailable.

What was happening:
- The app logs showed `thread/metadata/update` failing with `sqlite
state db unavailable for thread ...`.
- This was not isolated to one bad thread. Once the failure started for
a user, branch metadata updates failed 100% of the time for that user.
- Reports were staggered across users, which points at local app-server
/ local SQLite state rather than one global server-side failure.
- Turns could still start immediately after the metadata update failed,
which suggests the thread itself was valid and the failure was in the
metadata endpoint DB-handle path.

The fix:
- Keep using the loaded thread state DB and the normal
`get_state_db(...)` fallback first.
- If that still returns `None`, open `StateRuntime::init(...)` directly
for this targeted metadata update path.
- Log the direct state runtime init error if that final fallback also
fails, so future reports have the real DB-open cause instead of only the
generic unavailable error.
- Add a regression test where the DB exists but backfill is not
complete, and verify `thread/metadata/update` can still repair the
stored rollout thread and patch `gitInfo`.

Relevant context / suspect PRs:
- #16434 changed state DB startup to run auto-vacuum / incremental
vacuum. This is the most suspicious timing match for per-user, staggered
local SQLite availability failures.
- #16433 dropped the old log table from the state DB, also near the
timing window.
- #13280 introduced this endpoint and made it rely on SQLite for git
metadata without resuming the thread.
- #14859 and #14888 added/consumed persisted model + reasoning effort
metadata. I checked these because of the new thread metadata fields, but
this failure happens before the endpoint reaches thread-row update/load
logic, so they seem less likely as the direct cause.

### Testing
- `cargo fmt -- --config imports_granularity=Item` completed; local
stable rustfmt emitted warnings that `imports_granularity` is unstable
- `cargo test -p codex-app-server thread_metadata_update`
- `git diff --check`
2026-04-06 13:07:19 -04:00
rhan-oai 590e3b4f8b merge commit for archive created by Sapling 2026-04-06 09:47:21 -07:00
rhan-oai 8d1b68fce5 [codex-analytics] denormalize thread metadata onto turn events 2026-04-06 09:47:08 -07:00
Eric Traut 54dbbb839e (tui): Decode percent-escaped bare local file links (#16810)
Addresses #16622

Problem: bare local file links in TUI markdown render percent-encoded
path bytes literally, unlike file:// links.

Solution: decode bare path targets before local-path expansion and add
regression coverage for spaces and Unicode.
2026-04-06 08:52:18 -07:00
Eric Traut f44eb29181 Annotate skill doc reads with skill names (#16813)
Addresses #16303

Problem: Skill doc reads render as plain `Read SKILL.md`, so the TUI
hides which skill was opened.

Solution: Best-effort annotate exact `SKILL.md` reads with the matching
loaded skill name from `skills_all` before rendering exec cells.

Before:
```
• Explored
  └ Read SKILL.md
```

After:
```
• Explored
  └ Read SKILL.md (pr-babysitter skill)
```
2026-04-06 08:51:34 -07:00
Eric Traut 4294031a93 Fix resume picker timestamp labels and stability (#16822)
Problem: The resume picker used awkward "Created at" and "Updated at"
headers, and its relative timestamps changed while navigating because
they were recomputed on each redraw.

Solution: Rename the headers to "Created" and "Updated", and anchor
relative timestamp formatting to the picker load time so the displayed
ages stay stable while browsing.
2026-04-06 08:51:13 -07:00
Eric Traut fb41a79f37 [regression] Fix ephemeral turn backfill in exec (#16795)
Addresses #16781

Problem: `codex exec --ephemeral` backfilled empty `turn/completed`
items with `thread/read(includeTurns=true)`, which app-server rejects
for ephemeral threads.

This is a regression introduced in the recent conversion of "exec" to
use app server rather than call the core directly.

Solution: Skip turn-item backfill for ephemeral exec threads while
preserving the existing recovery path for non-ephemeral sessions.
2026-04-06 08:45:58 -07:00
Eric Traut ab58141e22 Fix TUI fast mode toggle regression (#16833)
Addresses #16832

Problem: After `/fast on`, the TUI omitted an explicit service-tier
clear on later turns, so `/fast off` left app-server sessions stuck on
`priority` until restart.

Solution: Always submit the current service tier with user turns,
including an explicit clear when Fast mode is off, and add a regression
test for the `/fast on` -> `/fast off` flow.
2026-04-06 08:43:35 -07:00
Eric Traut 82b061afb2 Fix CJK word navigation in the TUI composer (#16829)
Addresses #16584

Problem: TUI word-wise cursor movement treated entire CJK runs as a
single word, so Option/Alt+Left and Right skipped too far when editing
East Asian text.

Solution: Use Unicode word-boundary segments within each non-whitespace
run so CJK text advances one segment at a time while preserving
separator and delete-word behavior, and add regression coverage for CJK
and mixed-script navigation.

Testing: Manually tested solution by pasting text that includes CJK
characters into the composer and confirmed that keyboard navigation
worked correctly (after confirming it didn't prior to the change).
2026-04-06 08:37:42 -07:00
Thibault Sottiaux 624c69e840 [codex] add response proxy subagent header test (#16876)
This adds end-to-end coverage for `responses-api-proxy` request dumps
when Codex spawns a subagent and validates that the `x-codex-window-id`
and `x-openai-subagent` are properly set.
2026-04-06 08:18:46 -07:00
Eric Traut e65ee38579 Clarify codex exec approval help (#16888)
Addresses #13614

Problem: `codex exec --help` implied that `--full-auto` also changed
exec approval mode, even though non-interactive exec stays headless and
does not support interactive approval prompts.

Solution: clarify the `--full-auto` help text so it only describes the
sandbox behavior it actually enables for `codex exec`.
2026-04-05 23:31:15 -07:00
Eric Traut d9b899309d Fix misleading codex exec help usage (#16881)
Addresses #15535

Problem: `codex exec --help` advertised a second positional `[COMMAND]`
even though `exec` only accepts a prompt or a subcommand.

Solution: Override the `exec` usage string so the help output shows the
two supported invocation forms instead of the phantom positional.
2026-04-05 22:09:19 -07:00
rhan-oai c4d63a79c5 merge commit for archive created by Sapling 2026-04-05 18:23:39 -07:00
rhan-oai 01aa292c4f [codex-analytics] denormalize thread metadata onto turn events 2026-04-05 17:04:36 -07:00
rhan-oai 9b94ed7395 [codex-analytics] add steering metadata 2026-04-05 16:08:29 -07:00
rhan-oai ad50902d2c [codex-analytics] add queued submission metadata 2026-04-05 16:08:29 -07:00
rhan-oai 5faf7cfe4f [codex-analytics] add token usage metadata 2026-04-05 16:08:28 -07:00
rhan-oai 4570e5d894 [codex-analytics] feature plumbing and emittance 2026-04-05 16:08:28 -07:00
rhan-oai 9098a3fb8c [codex-analytics] add protocol-native turn timestamps 2026-04-05 16:08:28 -07:00
rhan-oai 74638d0cec Merge e6cb482993 into sapling-pr-archive-rhan-oai 2026-04-05 15:52:58 -07:00
rhan-oai e6cb482993 [codex-analytics] denormalize thread metadata onto turn events 2026-04-05 15:52:39 -07:00
rhan-oai 6fb7268e70 merge commit for archive created by Sapling 2026-04-05 15:41:20 -07:00
rhan-oai 7757cb9880 [codex-analytics] denormalize thread metadata onto turn events 2026-04-05 15:12:13 -07:00
Eric Traut b5edeb98a0 Fix flaky permissions escalation test on Windows (#16825)
Problem: `rejects_escalated_permissions_when_policy_not_on_request`
retried a real shell command after asserting the escalation rejection,
so Windows CI could fail on command startup timing instead of approval
behavior.

Solution: Keep the rejection assertion, verify no turn permissions were
granted, and assert through exec-policy evaluation that the same command
would be allowed without escalation instead of timing a subprocess.
2026-04-05 10:51:01 -07:00
Eric Traut 152b676597 Fix flaky test relating to metadata remote URL (#16823)
This test was flaking on Windows.

Problem: The Windows CI test for turn metadata compared git remote URLs
byte-for-byte even though equivalent remotes can be formatted
differently across Git code paths.

Solution: Normalize the expected and actual origin URLs in the test by
trimming whitespace, removing a trailing slash, and stripping a trailing
.git suffix before comparing.
2026-04-05 10:50:29 -07:00
rhan-oai 0abae510ba [codex-analytics] add steering metadata 2026-04-04 20:59:01 -07:00
rhan-oai 49b920cf4a [codex-analytics] add queued submission metadata 2026-04-04 20:59:01 -07:00
rhan-oai 44463cb72b [codex-analytics] add token usage metadata 2026-04-04 20:59:01 -07:00
rhan-oai d3d94c376c [codex-analytics] feature plumbing and emittance 2026-04-04 20:59:01 -07:00
rhan-oai 88730f6749 [codex-analytics] add protocol-native turn timestamps 2026-04-04 20:59:01 -07:00
rhan-oai 0b4a4fd6d7 merge commit for archive created by Sapling 2026-04-04 20:35:50 -07:00
rhan-oai ea0620c428 [codex-analytics] add protocol-native turn timestamps 2026-04-04 20:35:10 -07:00
rhan-oai fb39dcb5c3 merge commit for archive created by Sapling 2026-04-04 17:58:08 -07:00
rhan-oai 69a26ef398 [codex-analytics] add steering metadata 2026-04-04 17:57:33 -07:00
rhan-oai 902d44e832 [codex-analytics] add queued submission metadata 2026-04-04 17:57:33 -07:00
rhan-oai 5d1e1f8b28 [codex-analytics] add token usage metadata 2026-04-04 17:57:33 -07:00
rhan-oai 744310afcd [codex-analytics] feature plumbing and emittance 2026-04-04 17:57:33 -07:00
rhan-oai 73cdd36498 [codex-analytics] add protocol-native turn timestamps 2026-04-04 17:57:33 -07:00