Commit Graph

5654 Commits

Author SHA1 Message Date
rhan-oai
1e2562bd92 merge commit for archive created by Sapling 2026-04-10 17:00:04 -07:00
rhan-oai
65767d6418 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 16:53:46 -07:00
rhan-oai
ba4058c916 [codex-analytics] add steering metadata 2026-04-10 16:53:46 -07:00
rhan-oai
2a16ce9e0d [codex-analytics] add token usage metadata 2026-04-10 16:53:46 -07:00
rhan-oai
6a83f5548c [codex-analytics] feature plumbing and emittance 2026-04-10 16:53:46 -07:00
rhan-oai
7ce3f6b996 merge commit for archive created by Sapling 2026-04-10 16:35:31 -07:00
rhan-oai
4956c535a4 [codex-analytics] denormalize thread metadata onto turn events 2026-04-10 16:34:45 -07:00
rhan-oai
c6c98c0fe2 [codex-analytics] add steering metadata 2026-04-10 16:34:45 -07:00
Shijie Rao
930e5adb7e Revert "Option to Notify Workspace Owner When Usage Limit is Reached" (#17391)
Reverts openai/codex#16969

#sev3-2026-04-10-accountscheckversion-500s-for-openai-workspace-7300
2026-04-10 23:33:13 +00:00
Owen Lin
a3be74143a fix(guardian, app-server): introduce guardian review ids (#17298)
## Description

This PR introduces `review_id` as the stable identifier for guardian
reviews and exposes it in app-server `item/autoApprovalReview/started`
and `item/autoApprovalReview/completed` events.

Internally, guardian rejection state is now keyed by `review_id` instead
of the reviewed tool item ID. `target_item_id` is still included when a
review maps to a concrete thread item, but it is no longer overloaded as
the review lifecycle identifier.

## Motivation

We'd like to give users the ability to preempt a guardian review while
it's running (approve or decline).

However, we can't implement the API that allows the user to override a
running guardian review because we didn't have a unique `review_id` per
guardian review. Using `target_item_id` is not correct since:
- with execve reviews, there can be multiple execve calls (and therefore
guardian reviews) per shell command
- with network policy reviews, there is no target item ID

The PR that actually implements user overrides will use `review_id` as
the stable identifier.
2026-04-10 16:21:02 -07:00
Abhinav
7999b0f60f Support clear SessionStart source (#17073)
## Motivation

The `SessionStart` hook already receives `startup` and `resume` sources,
but sessions created from `/clear` previously looked like normal startup
sessions. This makes it impossible for hook authors to distinguish
between these with the matcher.

## Summary

- Add `InitialHistory::Cleared` so `/clear`-created sessions can be
distinguished from ordinary startup sessions.
- Add `SessionStartSource::Clear` and wire it through core, app-server
thread start params, and TUI clear-session flow.
- Update app-server protocol schemas, generated TypeScript, docs, and
related tests.


https://github.com/user-attachments/assets/9cae3cb4-41c7-4d06-b34f-966252442e5c
2026-04-10 16:05:21 -07:00
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
Abhinav
87b9275fff [codex] Improve hook status rendering (#17266)
# Motivation

Make hook display less noisy and more useful by keeping transient hook
activity out of permanent history unless there is useful output,
preserving visibility for meaningful hook work, and making completed
hook severity easier to scan.

Also addresses some of the concerns in
https://github.com/openai/codex/issues/15497

# Changes

## Demo


https://github.com/user-attachments/assets/9d8cebd4-a502-4c95-819c-c806c0731288

Reverse spec for the behavior changes in this branch:

## Hook Lifecycle Rendering
- Hook start events no longer write permanent history rows like `Running
PreToolUse hook`.
- Running hooks now render in a dedicated live hook area above the
composer. It's similar to the active cell we use for tool calls but its
a separate lane.
- Running hook rows use the existing animation setting.

## Hook Reveal Timing
- We wait 300ms before showing running hook rows and linger for up to
600ms once visible.
- This is so fast hooks don't flash a transient `Running hook` row
before user can read it every time.
- If a fast hook completes with meaningful output, only the completed
hook result is written to history.
- If a fast hook completes successfully with no output, it leaves no
visible trace.

## Completed Hook Output
- Completed hooks with output are sticky, for example `• SessionStart
hook (completed)`.
- Hook output entries are rendered under that row with stable prefixes:
`warning:`, `stop:`, `feedback:`, `hook context:`, and `error:`.
- Blocked hooks show feedback entries, for example `• PreToolUse hook
(blocked)` followed by `feedback: ...`.
- Failed hooks show error entries, for example `• PostToolUse hook
(failed)` followed by `error: ...`.
- Stopped hooks show stop entries and remain visually treated as
non-success.

## Parallel Hook Behavior
- Multiple simultaneously running hooks can be tracked in one live hook
cell.
- Adjacent running hooks with the same hook event name and same status
message collapse into a count, for example `• Running 3 PreToolUse
hooks: checking command policy`.
- Running hooks with different event names or different status messages
remain separate rows.

## Hook Run Identity
- `PreToolUse` and `PostToolUse` hook run IDs now include the tool call
ID which prevents concurrent tool-use hooks from sharing a run ID and
clobbering each other in the UI.
- This ID scoping applies to tool-use hooks only; other hook event types
keep their existing run identity behavior.

## App-Server Hook Notifications
- App-server `HookStarted` and `HookCompleted` notifications use the
same live hook rendering path as core hook events.
- `UserPromptSubmit` hook notifications now render through the same
completed hook output format, including warning and stop entries.
2026-04-10 14:05:47 -07:00
Won Park
147cb84112 add parent-id to guardian context (#17194)
adding parent codex session id to guardian prompt
2026-04-10 13:57:56 -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
canvrno-oai
aac1e74cd5 Add thread title to configurable TUI status line (#17187)
- Add thread-title as an optional TUI status line item, omitted unless
the user has set a custom name (`ChatWidget.thread_name`).
- Refresh the status line when threads are renamded
- Add snapshot coverage for renamed-thread footer behavior.
2026-04-10 13:24:07 -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