Conversation
JPeer264
added this pull request to stack #25002
October 2, 2026 13:14
JPeer264
removed this pull request from stack #25002
October 2, 2026 13:31
JPeer264
added this pull request to stack #25004
October 2, 2026 13:57
…nventions Flue records its turn messages in pi-ai's shape, with a `toolResult` role and `toolCall` parts, and Sentry renders neither, so tool calls and tool results were missing from the conversation views. Its token counts come from pi-ai too, whose `input` leaves the cached tokens out while the conventions count them in, so input tokens and input cost were too low whenever prompt caching was active. A shared pi-ai mapper now translates messages, usage and the finish reason to the conventions, and the tool span records the result the model receives instead of Flue's internal result wrapper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/flue-map-messages-conventions
branch
from
October 3, 2026 16:23
3a5576b to
203f215
Compare
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Flue records the messages of its turns in pi-ai's own shape, with a
toolResultrole andtoolCallparts. Sentry's AI views only render the gen_ai conventions shape, so tool calls and tool results were missing from Flue conversations, and the tool result showed up with an invalid role. This maps the input and output messages to the conventions, the way #24352 did for Google GenAI.The token counts come from pi-ai too. Its
inputleaves the cached tokens out, whilegen_ai.usage.input_tokensincludes them by definition, so input tokens and input cost were too low whenever prompt caching was active (the default for Anthropic models). The finish reason is mapped as well (toolUsebecomestool_call), and the tool span now records the result the model receives (Flue'seffectiveResult) instead of the internal{ content, details }wrapper.The mapper lives in
ai/pi-ai/because pi-durable sends the same shapes, and its integration uses it too.🤖 Generated with Claude Code