feat: carry assistant reasoning on the generation output too - #38
Merged
Merged
Conversation
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.
Summary
message_endoutput was still built fromextractText+extractToolCallsonly, so atype: "thinking"part never reached the output of the call that produced it.extractThinking()'s result to the output asthinking, matching the shape the history side already uses.extractToolCallsto the nested{ id, type: "function", function: { name } }shape Langfuse renders (mirrors the Claude plugin's #77); arguments stay off the generation output since the tool span already carries them.Linear: https://linear.app/clickhouse/issue/LFE-15989/featpi-plugin-carry-assistant-reasoning-on-the-generation-output-too
Fixes LFE-15989
Verification
attaches the assistant reasoning to the step that produced itintegration test (which already spawns pi), instead of adding a second pi spawn./api/public/v2/observations:role,contentonlythinking: [{"type":"thinking","content":"..."}]; tool calls are nestedthinkingSignatureor the rawreasoning_contentfield.Not in this change
tool_callsare still flat ({id, name, arguments}) despite using the same ChatMLthinkingshape — worth its own issue, out of scope here.