Skip to content

Add goal extension telemetry parity#24615

Merged
jif-oai merged 4 commits into
mainfrom
jif/goal-metrics
May 26, 2026
Merged

Add goal extension telemetry parity#24615
jif-oai merged 4 commits into
mainfrom
jif/goal-metrics

Conversation

@jif-oai

@jif-oai jif-oai commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Why

core/src/goals.rs already emits OTEL metrics for goal creation, resume, terminal transitions, token counts, and duration. As /goal moves into ext/goal, the extension needs to preserve that telemetry contract instead of only emitting app-visible ThreadGoalUpdated events.

This keeps the existing codex.goal.* metric surface intact while goal lifecycle ownership shifts toward the extension.

What changed

  • Added an extension-local GoalMetrics helper that records the existing codex.goal.* counters and histograms through codex-otel.
  • Threaded an optional MetricsClient through install_with_backend, GoalExtension, GoalRuntimeHandle, and GoalToolExecutor.
  • Emitted created, resumed, and terminal goal metrics from the extension paths that create goals, restore active goals on thread resume, account budget limits, complete or block goals, and handle external goal mutations.
  • Updated existing goal extension test setup callsites to pass None for metrics when instrumentation is not under test.

Verification

Not run locally.

@jif-oai jif-oai changed the title feat: goal metrics Add goal extension telemetry parity May 26, 2026

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

Copy link
Copy Markdown
Contributor

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: eba392762c

ℹ️ 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/ext/goal/src/tool.rs
@jif-oai jif-oai force-pushed the jif/goal-metrics branch from bb38454 to 88905e9 Compare May 26, 2026 17:29
@jif-oai

jif-oai commented May 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@jif-oai jif-oai merged commit 08504e8 into main May 26, 2026
30 checks passed
@jif-oai jif-oai deleted the jif/goal-metrics branch May 26, 2026 17:48
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant