[codex-analytics] emit goal lifecycle analytics - #27078
Merged
marksteinbrick-oai merged 1 commit intoJun 10, 2026
Merged
Conversation
marksteinbrick-oai
marked this pull request as ready for review
June 8, 2026 22:29
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9984988dae
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Emit the existing codex_goal_event contract from the canonical goal extension lifecycle after the extension migration. - track created, usage_accounted, status_changed, and cleared events - preserve turn attribution, cumulative accounting snapshots, and payload privacy - return deleted goal rows so clear events retain the final goal ID and status - cover extension, app-server, resume, budget-limit, and analytics serialization paths
marksteinbrick-oai
force-pushed
the
mark.steinbrick/goal-analytics-extension-review
branch
from
June 8, 2026 23:05
9984988 to
2d1ffe5
Compare
etraut-openai
approved these changes
Jun 10, 2026
etraut-openai
left a comment
Contributor
There was a problem hiding this comment.
Code looks correct. It touches a lot more files that I'd expect for this change, but I don't see an obvious way to simplify it.
marksteinbrick-oai
deleted the
mark.steinbrick/goal-analytics-extension-review
branch
June 10, 2026 01:45
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
/goalbehavior/goalmoved intocodex-goal-extension.What Changed
codex_goal_eventserialization and enrichment tocodex-analyticscodex-goal-extensionmutation and accounting paths:createdwhen a new logical goal is persistedusage_accountedwhen cumulative goal usage is persistedstatus_changedwhen the stored goal status changesclearedwhen the goal is deletedturn_idfor turn driven events and uses null attribution for external or idle lifecycle eventsclearedretains the stable goal IDEvent Details
Includes standard analytics metadata along with goal specific fields:
goal_id: Stable ID stored in the local SQLite goal row and shared across the goal's eventsevent_kind: Observed operation (see the 4 lifecycle events cited in the above bullet)goal_status: Resulting or last stored status:active,paused,blocked,usage_limited, etc.has_token_budget: Indicates whether a token budget is configuredturn_id: Causal turn ID, or null when no causal turn existscumulative_tokens_accounted: Cumulative tokens onusage_accountedevents; null otherwisecumulative_time_accounted_seconds: Cumulative active time onusage_accountedevents; null otherwiseValidation
just test -p codex-analytics -p codex-state -p codex-goal-extensionjust test -p codex-core -E 'test(/goal/)'just test -p codex-app-servercargo build -p codex-analytics -p codex-core -p codex-state -p codex-app-server