[codex-analytics] expose item timing through app server#20515
Draft
rhan-oai wants to merge 1 commit intorhan/core-item-timing-productionfrom
Draft
[codex-analytics] expose item timing through app server#20515rhan-oai wants to merge 1 commit intorhan/core-item-timing-productionfrom
rhan-oai wants to merge 1 commit intorhan/core-item-timing-productionfrom
Conversation
This was referenced Apr 30, 2026
5c272b8 to
c6e0ea5
Compare
65ef7bc to
84e66f0
Compare
c6e0ea5 to
7a61984
Compare
84e66f0 to
0cf1a11
Compare
7a61984 to
88c1fb0
Compare
e15f9f5 to
e77df6b
Compare
rhan-oai
added a commit
that referenced
this pull request
May 1, 2026
## Why Several analytics event families need the same per-thread attribution state: the app-server client/runtime associated with a thread and, for lifecycle-oriented events, the thread metadata captured during initialization. Keeping connection ids and lifecycle metadata in separate maps made each consumer rebuild the same thread context and made subagent attribution harder to resolve consistently. ## What changed - Replaces the separate thread connection and metadata maps with one reducer-owned `threads` map. - Routes guardian, compaction, turn-steer, and turn analytics through shared thread-state lookups while preserving turn-origin attribution for turn events and request-origin attribution for steer events. - Lets newly observed spawned subagent threads inherit their parent thread connection so later thread-scoped analytics can resolve through the same state model. - Adds regression coverage for standalone `SubAgentThreadStarted` publication plus the `SubAgentSource::ThreadSpawn` parent fallback through a thread-scoped consumer that depends on inherited connection state. ## Verification - `cargo test -p codex-analytics` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/20300). * #18748 * #18747 * #17090 * #17089 * #20239 * #20515 * #20514 * __->__ #20300
d55b667 to
42cdca0
Compare
087ce59 to
a862056
Compare
a862056 to
158fe58
Compare
Bojun-Vvibe
added a commit
to Bojun-Vvibe/oss-contributions
that referenced
this pull request
May 1, 2026
anomalyco/opencode#25109 (merge-as-is), #25029 (merge-after-nits), openai/codex#20515 + #20514 (merge-after-nits, stack pair).
158fe58 to
27e04d5
Compare
42cdca0 to
d7b376e
Compare
27e04d5 to
0f46bf6
Compare
d7b376e to
be7c3a7
Compare
0f46bf6 to
360adf3
Compare
be7c3a7 to
0ecb14b
Compare
0df2bac to
fc3e685
Compare
487af8f to
53976e4
Compare
fc3e685 to
71b5f1f
Compare
53976e4 to
96a73c3
Compare
71b5f1f to
81b61fb
Compare
81b61fb to
35fc8b5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Once core emits native lifecycle timing, app-server clients need the same data on the public item notifications and reconstructed thread history. Keeping that wire/history layer separate makes the generated schema churn reviewable apart from producer code.
What changed
ThreadItemvalues plusitem/startedanditem/completednotifications.Verification
cargo test -p codex-app-server-protocolcargo test -p codex-exec --no-runcargo test -p codex-tui --no-runStack created with Sapling. Best reviewed with ReviewStack.