Skip to content

Add codex_hook_run analytics event#17996

Open
abhinav-oai wants to merge 7 commits intomainfrom
dev/abhinav/codex-hook-run-analytics
Open

Add codex_hook_run analytics event#17996
abhinav-oai wants to merge 7 commits intomainfrom
dev/abhinav/codex-hook-run-analytics

Conversation

@abhinav-oai
Copy link
Copy Markdown
Contributor

@abhinav-oai abhinav-oai commented Apr 15, 2026

Why

Add product analytics for hook handler executions so we can understand which hooks are running, where they came from, and whether they completed, failed, stopped, or blocked work.

What

  • add the new codex_hook_run analytics event and payload plumbing in codex-rs/analytics
  • emit hook-run analytics from the shared hook completion path in codex-rs/core
  • classify hook source from the loaded hook path as system, user, project, or unknown
{
  "event_type": "codex_hook_run",
  "event_params": {
    "thread_id": "string",
    "turn_id": "string",
    "model_slug": "string",
    "hook_name": "string, // any HookEventName
    "hook_source": "system | user | project | unknown",
    "status": "completed | failed | stopped | blocked"
  }
}

@abhinav-oai abhinav-oai changed the title [codex] Add hook run analytics event Add codex_hook_run analytics event Apr 15, 2026
@abhinav-oai abhinav-oai force-pushed the dev/abhinav/codex-hook-run-analytics branch from 260ca91 to dfe94bd Compare April 15, 2026 22:30
Co-authored-by: Codex <noreply@openai.com>
}

impl HookEventName {
pub fn analytics_name(self) -> &'static str {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also give the enum #[strum(serialize_all = "pascal_case")] but this felt more explicit

@abhinav-oai abhinav-oai marked this pull request as ready for review April 15, 2026 22:55
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc67544123

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/analytics/src/events.rs
@abhinav-oai
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc67544123

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core/src/hook_runtime.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant