Skip to content

capture reasoning effort openai#893

Open
pritamsoni-hsr wants to merge 1 commit intotraceloop:mainfrom
pritamsoni-hsr:capture-reasoning-effort-openai
Open

capture reasoning effort openai#893
pritamsoni-hsr wants to merge 1 commit intotraceloop:mainfrom
pritamsoni-hsr:capture-reasoning-effort-openai

Conversation

@pritamsoni-hsr
Copy link

@pritamsoni-hsr pritamsoni-hsr commented Mar 3, 2026

Important

Adds support for capturing reasoning_effort parameter in OpenAIInstrumentation to enhance span attributes.

  • Behavior:
    • Adds support for capturing reasoning_effort parameter in OpenAIInstrumentation class.
    • Updates startSpan method to include reasoning_effort in span attributes if present in parameters.
    • Modifies attribute setting logic to handle reasoning_effort in instrumentation.ts.

This description was created by Ellipsis for 43e8951. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • New Features
    • Enhanced OpenAI request tracing now captures reasoning effort data, providing better observability for API calls that utilize reasoning capabilities across chat and completion requests.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 43e8951 in 8 seconds. Click for details.
  • Reviewed 14 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_IMFAuvqXlMlENmX8

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Warning

Rate limit exceeded

@pritamsoni-hsr has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 43e8951 and 39438b5.

📒 Files selected for processing (2)
  • packages/instrumentation-openai/src/attrs.ts
  • packages/instrumentation-openai/src/instrumentation.ts
📝 Walkthrough

Walkthrough

Adds support for tracing OpenAI's reasoning effort parameter by capturing it in span attributes. When creating spans for OpenAI requests, if the params object includes reasoning_effort, it is now recorded as a gen_ai.request.reasoning_effort attribute for both chat and completion request paths.

Changes

Cohort / File(s) Summary
OpenAI Instrumentation Enhancement
packages/instrumentation-openai/src/instrumentation.ts
Added conditional logic to capture reasoning_effort parameter from request params and set it as gen_ai.request.reasoning_effort span attribute in the startSpan method.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A tiny thread of reasoning traced,
In OpenAI's spans now embraced,
Effort captured, attributes bright,
Making traces more complete and right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding support for capturing reasoning effort in OpenAI instrumentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant
Copy link

CLAassistant commented Mar 3, 2026

CLA assistant check
All committers have signed the CLA.

@pritamsoni-hsr pritamsoni-hsr force-pushed the capture-reasoning-effort-openai branch from 9ce7687 to 39438b5 Compare March 3, 2026 12:09
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.

2 participants