Skip to content

fix(telemetry): Capture tool result outputs#792

Closed
obostjancic wants to merge 1 commit into
mainfrom
fix/tool-result-telemetry-output
Closed

fix(telemetry): Capture tool result outputs#792
obostjancic wants to merge 1 commit into
mainfrom
fix/tool-result-telemetry-output

Conversation

@obostjancic

Copy link
Copy Markdown
Member

Tool execution spans now retain their Sentry span handle across async tool execution, so result attributes are written on the same span that already has tool inputs. Content-only tool results include their model-facing content in public telemetry, while structured results avoid duplicating the JSON details as a generated text content part.

Regression coverage exercises both content-only outputs and structured results so reviewers can verify the payload shape without reconstructing the trace path.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jul 8, 2026 3:50pm

Request Review

Comment thread packages/junior/tests/unit/tool-support/pi-tool-adapter-telemetry.test.ts Outdated
Keep the active Sentry span reachable across async tool execution so tool result attributes are written alongside tool inputs. Include model-facing content for content-only tool results while avoiding duplicate JSON echoes for structured results.

Co-Authored-By: ChatGPT <chatgpt@openai.com>
normalized: ReturnType<typeof normalizeToolResult>,
) => {
const { content, details } = normalized;
if (isRecord(details) && details.rawResult !== undefined) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i need to f/u here im not sure why we have this rawResult thing

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