Commit Graph
5640 Commits
Author SHA1 Message Date
rhan-oai 6564c4e772 merge commit for archive created by Sapling 2026-04-10 16:02:30 -07:00
rhan-oai e2cc7faac6 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 16:00:26 -07:00
rhan-oai b2b81bde9b [codex-analytics] add steering metadata 2026-04-10 16:00:19 -07:00
rhan-oai f5f5501319 merge commit for archive created by Sapling 2026-04-10 15:45:59 -07:00
rhan-oai 3a931e4a74 [codex-analytics] add steering metadata 2026-04-10 15:43:07 -07:00
rhan-oai bf02586efd merge commit for archive created by Sapling 2026-04-10 15:39:21 -07:00
rhan-oai 60c2461b82 [codex-analytics] add steering metadata 2026-04-10 15:38:28 -07:00
rhan-oai 5269188c55 Merge c83f69b09e into sapling-pr-archive-rhan-oai 2026-04-10 15:29:27 -07:00
rhan-oai c83f69b09e [codex-analytics] add steering metadata 2026-04-10 15:27:37 -07:00
rhan-oai 08d37fefab merge commit for archive created by Sapling 2026-04-10 15:17:54 -07:00
rhan-oai 7021d18218 [codex-analytics] add steering metadata 2026-04-10 15:08:39 -07:00
rhan-oai 25244aa5f5 Merge f71df46ada into sapling-pr-archive-rhan-oai 2026-04-10 14:42:11 -07:00
rhan-oai 32d1704205 merge commit for archive created by Sapling 2026-04-10 14:40:34 -07:00
rhan-oai 290c485ab5 [codex-analytics] add token usage metadata 2026-04-10 14:38:25 -07:00
rhan-oai f71df46ada [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 14:38:25 -07:00
rhan-oai b18388f2e6 [codex-analytics] add steering metadata 2026-04-10 14:38:25 -07:00
rhan-oai 2e21934e10 [codex-analytics] feature plumbing and emittance 2026-04-10 14:38:18 -07:00
rhan-oai 8af0af0000 merge commit for archive created by Sapling 2026-04-10 14:26:37 -07:00
rhan-oai f42998d852 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 14:24:52 -07:00
rhan-oai f00fe86b78 [codex-analytics] add steering metadata 2026-04-10 14:24:52 -07:00
rhan-oai 9323523020 [codex-analytics] add token usage metadata 2026-04-10 14:24:52 -07:00
rhan-oai d91bd51ff9 [codex-analytics] feature plumbing and emittance 2026-04-10 14:24:52 -07:00
rhan-oai a5a281c5a1 Merge 169d814006 into sapling-pr-archive-rhan-oai 2026-04-10 14:17:19 -07:00
rhan-oai 169d814006 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 14:15:53 -07:00
rhan-oai 6123f210f4 Merge aa2b4665c7 into sapling-pr-archive-rhan-oai 2026-04-10 14:08:59 -07:00
rhan-oai a1405eb1d7 [codex-analytics] add steering metadata 2026-04-10 14:07:57 -07:00
rhan-oai aa2b4665c7 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 14:07:57 -07:00
rhan-oai e7c81347bf [codex-analytics] add token usage metadata 2026-04-10 14:07:57 -07:00
rhan-oai 8dba615a8b [codex-analytics] feature plumbing and emittance 2026-04-10 14:07:57 -07:00
rhan-oai 8005c858f9 merge commit for archive created by Sapling 2026-04-10 13:38:58 -07:00
rhan-oai bcc8196c4f [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 13:37:25 -07:00
rhan-oai 1a060ac1c9 [codex-analytics] add steering metadata 2026-04-10 13:37:25 -07:00
rhan-oai 5076c1158b [codex-analytics] add token usage metadata 2026-04-10 13:37:25 -07:00
rhan-oai bc876c3c10 [codex-analytics] feature plumbing and emittance 2026-04-10 13:37:25 -07:00
rhan-oai 5779be314a [codex-analytics] add compaction analytics event (#17155)
- event for compaction analytics
- introduces thread-connection and thread metadata caches for data
denormalization, expected to be useful for denormalization onto core
emitted events in general
- threads analytics event client into core (mirrors approved
implementation in #16640)
- denormalizes key thread metadata: thread_source, subagent_source,
parent_thread_id, as well as app-server client and runtime metadata)
- compaction strategy defaults to memento, forward compatible with
expected prefill_compaction strategy

1. Manual standalone compact, local
`INFO | 2026-04-09 17:35:50 | codex_backend.routers.analytics_events |
analytics_events.track_analytics_events:526 | Tracked
codex_compaction_event event params={'thread_id':
'019d74d0-5cfb-70c0-bef9-165c3bf9b2df', 'turn_id':
'019d74d0-d7f6-7c81-acc6-aae2030243d6', 'product_surface': 'codex',
'app_server_client': {'product_client_id': 'CODEX_CLI', 'client_name':
'codex-tui', 'client_version': '0.0.0', 'rpc_transport': 'in_process',
'experimental_api_enabled': True}, 'runtime': {'codex_rs_version':
'0.0.0', 'runtime_os': 'macos', 'runtime_os_version': '26.4.0',
'runtime_arch': 'aarch64'}, 'trigger': 'manual', 'reason':
'user_requested', 'implementation': 'responses', 'phase':
'standalone_turn', 'strategy': 'memento', 'status': 'completed',
'active_context_tokens_before': 20170, 'active_context_tokens_after':
4830, 'started_at': 1775781337, 'completed_at': 1775781350,
'thread_source': 'user', 'subagent_source': None, 'parent_thread_id':
None, 'error': None, 'duration_ms': 13524} | `

2. Auto pre-turn compact, local
`INFO | 2026-04-09 17:37:30 | codex_backend.routers.analytics_events |
analytics_events.track_analytics_events:526 | Tracked
codex_compaction_event event params={'thread_id':
'019d74d2-45ef-71d1-9c93-23cc0c13d988', 'turn_id':
'019d74d2-7b42-7372-9f0e-c0da3f352328', 'product_surface': 'codex',
'app_server_client': {'product_client_id': 'CODEX_CLI', 'client_name':
'codex-tui', 'client_version': '0.0.0', 'rpc_transport': 'in_process',
'experimental_api_enabled': True}, 'runtime': {'codex_rs_version':
'0.0.0', 'runtime_os': 'macos', 'runtime_os_version': '26.4.0',
'runtime_arch': 'aarch64'}, 'trigger': 'auto', 'reason':
'context_limit', 'implementation': 'responses', 'phase': 'pre_turn',
'strategy': 'memento', 'status': 'completed',
'active_context_tokens_before': 20063, 'active_context_tokens_after':
4822, 'started_at': 1775781444, 'completed_at': 1775781449,
'thread_source': 'user', 'subagent_source': None, 'parent_thread_id':
None, 'error': None, 'duration_ms': 5497} | `

3. Auto mid-turn compact, local
`INFO | 2026-04-09 17:38:28 | codex_backend.routers.analytics_events |
analytics_events.track_analytics_events:526 | Tracked
codex_compaction_event event params={'thread_id':
'019d74d3-212f-7a20-8c0a-4816a978675e', 'turn_id':
'019d74d3-3ee1-7462-89f6-2ffbeefcd5e3', 'product_surface': 'codex',
'app_server_client': {'product_client_id': 'CODEX_CLI', 'client_name':
'codex-tui', 'client_version': '0.0.0', 'rpc_transport': 'in_process',
'experimental_api_enabled': True}, 'runtime': {'codex_rs_version':
'0.0.0', 'runtime_os': 'macos', 'runtime_os_version': '26.4.0',
'runtime_arch': 'aarch64'}, 'trigger': 'auto', 'reason':
'context_limit', 'implementation': 'responses', 'phase': 'mid_turn',
'strategy': 'memento', 'status': 'completed',
'active_context_tokens_before': 20325, 'active_context_tokens_after':
14641, 'started_at': 1775781500, 'completed_at': 1775781508,
'thread_source': 'user', 'subagent_source': None, 'parent_thread_id':
None, 'error': None, 'duration_ms': 7507} | `

4. Remote /responses/compact, manual standalone
`INFO | 2026-04-09 17:40:20 | codex_backend.routers.analytics_events |
analytics_events.track_analytics_events:526 | Tracked
codex_compaction_event event params={'thread_id':
'019d74d4-7a11-78a1-89f7-0535a1149416', 'turn_id':
'019d74d4-e087-7183-9c20-b1e40b7578c0', 'product_surface': 'codex',
'app_server_client': {'product_client_id': 'CODEX_CLI', 'client_name':
'codex-tui', 'client_version': '0.0.0', 'rpc_transport': 'in_process',
'experimental_api_enabled': True}, 'runtime': {'codex_rs_version':
'0.0.0', 'runtime_os': 'macos', 'runtime_os_version': '26.4.0',
'runtime_arch': 'aarch64'}, 'trigger': 'manual', 'reason':
'user_requested', 'implementation': 'responses_compact', 'phase':
'standalone_turn', 'strategy': 'memento', 'status': 'completed',
'active_context_tokens_before': 23461, 'active_context_tokens_after':
6171, 'started_at': 1775781601, 'completed_at': 1775781620,
'thread_source': 'user', 'subagent_source': None, 'parent_thread_id':
None, 'error': None, 'duration_ms': 18971} | `
2026-04-10 13:03:54 -07:00
rhan-oai fb1e0bcd15 merge commit for archive created by Sapling 2026-04-10 12:58:40 -07:00
rhan-oai c36ffd6555 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 12:26:37 -07:00
Ahmed IbrahimandCodex 029fc63d13 Strengthen realtime backend delegation prompt (#17363)
Encourages realtime prompt handling to delegate user requests to the
backend agent by default when repo inspection, commands, implementation,
or validation may help.

Co-authored-by: Codex <noreply@openai.com>
2026-04-10 12:14:33 -07:00
rhan-oai 24c54673fe Merge c815dc6870 into sapling-pr-archive-rhan-oai 2026-04-10 11:49:16 -07:00
rhan-oai c815dc6870 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 11:45:41 -07:00
rhan-oai b940eee9ab [codex-analytics] add steering metadata 2026-04-10 11:37:58 -07:00
rhan-oai 761d713d78 merge commit for archive created by Sapling 2026-04-10 11:20:31 -07:00
rhan-oai 0294922b78 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 11:16:21 -07:00
rhan-oai 2b2db7bb97 [codex-analytics] add steering metadata 2026-04-10 11:16:21 -07:00
jif-oai 87328976f6 fix: main (#17352) 2026-04-10 18:14:42 +01:00
Ahmed IbrahimandCodex 2e81eac004 Queue Realtime V2 response.create while active (#17306)
Builds on #17264.

- queues Realtime V2 `response.create` while an active response is open,
then flushes it after `response.done` or `response.cancelled`
- requests `response.create` after background agent final output and
steering acknowledgements
- adds app-server integration coverage for all `response.create` paths

Validation:
- `just fmt`
- `cargo check -p codex-app-server --tests`
- `git diff --check`
- CI green

---------

Co-authored-by: Codex <noreply@openai.com>
2026-04-10 09:09:13 -07:00
Owen Lin 88165e179a feat(guardian): send only transcript deltas on guardian followups (#17269)
## Description

We reuse a guardian thread for a given user thread when we can. However,
we had always sent the full transcript history every time we made a
followup review request to an existing guardian thread.

This is especially bad for long guardian threads since we keep
re-appending old transcript entries instead of just what has changed.
The fix is to just send what's new.

**Caveat**: Whenever a thread is compacted or rolled back, we fall back
to sending the full transcript to guardian again since the thread's
history has been modified. However in the happy path we get a nice
optimization.

## Before
Initial guardian review sends the full parent transcript:

```
The following is the Codex agent history whose request action you are assessing...
>>> TRANSCRIPT START
[1] user: Please check the repo visibility and push the docs fix if needed.
[2] tool gh_repo_view call: {"repo":"openai/codex"}
[3] tool gh_repo_view result: repo visibility: public
[4] assistant: The repo is public; I now need approval to push the docs fix.
>>> TRANSCRIPT END
The Codex agent has requested the following action:
>>> APPROVAL REQUEST START
...
>>> APPROVAL REQUEST END
```

And a followup to the same guardian thread would send the full
transcript again (including items 1-4 we already sent):
```
The following is the Codex agent history whose request action you are assessing...
>>> TRANSCRIPT START
[1] user: Please check the repo visibility and push the docs fix if needed.
[2] tool gh_repo_view call: {"repo":"openai/codex"}
[3] tool gh_repo_view result: repo visibility: public
[4] assistant: The repo is public; I now need approval to push the docs fix.
[5] user: Please push the second docs fix too.
[6] assistant: I need approval for the second docs fix.
>>> TRANSCRIPT END
The Codex agent has requested the following action:
>>> APPROVAL REQUEST START
...
>>> APPROVAL REQUEST END
```

## After
Initial guardian review sends the full parent transcript (this is
unchanged):

```
The following is the Codex agent history whose request action you are assessing...
>>> TRANSCRIPT START
[1] user: Please check the repo visibility and push the docs fix if needed.
[2] tool gh_repo_view call: {"repo":"openai/codex"}
[3] tool gh_repo_view result: repo visibility: public
[4] assistant: The repo is public; I now need approval to push the docs fix.
>>> TRANSCRIPT END
The Codex agent has requested the following action:
>>> APPROVAL REQUEST START
...
>>> APPROVAL REQUEST END
```

But a followup now sends:
```
The following is the Codex agent history added since your last approval assessment. Continue the same review conversation...
>>> TRANSCRIPT DELTA START
[5] user: Please push the second docs fix too.
[6] assistant: I need approval for the second docs fix.
>>> TRANSCRIPT DELTA END
The Codex agent has requested the following next action:
>>> APPROVAL REQUEST START
...
>>> APPROVAL REQUEST END
```
2026-04-10 07:48:44 -07:00
jif-oai d39a722865 feat: description multi-agent v2 (#17338) 2026-04-10 15:31:32 +01:00
jif-oai 8d58899297 fix: MCP leaks in app-server (#17223)
The disconnect path now reuses the same teardown flow as explicit
unsubscribe, and the thread-state bookkeeping consistently reports only
threads that lost their last subscriber

https://github.com/openai/codex/issues/16895
2026-04-10 15:31:26 +01:00
jif-oai 8035cb03f1 feat: make rollout recorder reliable against errors (#17214)
The rollout writer now keeps an owned/monitored task handle, returns
real Result acks for flush/persist/shutdown, retries failed flushes by
reopening the rollout file, and keeps buffered items until they are
successfully written. Session flushes are now real durability barriers
for fork/rollback/read-after-write paths, while turn completion surfaces
a warning if the rollout still cannot be saved after recovery.
2026-04-10 14:12:33 +01:00