-
Notifications
You must be signed in to change notification settings - Fork 152
add an alias for ai sdk v4 tool args; update tests to catch #812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to 34786ce in 2 minutes and 40 seconds. Click for details.
- Reviewed
86lines of code in2files - Skipped
0files when reviewing. - Skipped posting
6draft 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.
1. app-server/src/traces/spans.rs:2955
- Draft comment:
The test 'test_parse_tool_calls_preserves_argument_order' relies on the serialization order of JSON object keys. While you are using an ordered map (IndexMap) to preserve the order, JSON object key order isn’t guaranteed by the spec. Adding a comment to clarify this reliance on IndexMap would help future maintainers. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. app-server/src/traces/spans.rs:2570
- Draft comment:
The changes correctly use conditional keys (e.g. 'args' for v4 and 'input' for later versions) to support backwards compatibility. The tests in 'test_aisdk_tool_results' now assert that the tool arguments properly deserialize to the expected value. This is a good update! - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. app-server/src/traces/spans.rs:1248
- Draft comment:
In the helper function 'parse_ai_sdk_tool_calls', the code extracts the arguments using the key 'args'. With the new alias (added in the chat_message changes) this should now properly populate the field. Confirm that when deserializing, both 'args' and 'input' are handled uniformly. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. app-server/src/traces/spans.rs:2954
- Draft comment:
The tests in this file are very comprehensive but contain duplicated logic and similar patterns across multiple test functions. Consider refactoring common test setup code into helper functions to reduce duplication and improve readability. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
5. app-server/src/traces/spans.rs:2585
- Draft comment:
Typographical issue: The key input_key is not quoted, whereas other keys in this JSON object are. Please enclose it in quotes for consistency (i.e., "input_key"). - Reason this comment was not posted:
Comment looked like it was already resolved.
6. app-server/src/traces/spans.rs:2589
- Draft comment:
Typographical issue: The key output_key is not quoted. To maintain consistent JSON formatting, please wrap it in quotes (i.e., "output_key"). - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_vZD4squ2sFQh2FhM
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| ChatMessageContentPart::ToolCall(_) | ||
| )); | ||
|
|
||
| let assistant_message = &child_input_messages[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate parsing of the assistant message’s content: the block that extracts and asserts the content of child_input_messages[2] appears twice. Consider removing the redundant extraction to simplify the test.
There was a problem hiding this 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 3a0dda7 in 1 minute and 11 seconds. Click for details.
- Reviewed
26lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1draft 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.
1. app-server/src/traces/spans.rs:1242
- Draft comment:
In the functionparse_ai_sdk_tool_calls, consider also checking for the alias "input" alongside "args" (e.g. using .or_else(|| tool_call.get("input"))) to support AI SDK v4 tool args. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_zHfzewvoxKo5iMkS
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Important
Add alias for
inputfield inInstrumentationChatMessageAISDKToolCallfor AI SDK v4 compatibility and update tests accordingly.#[serde(alias = "args")]toinputfield inInstrumentationChatMessageAISDKToolCallinchat_message.rsfor backward compatibility with AI SDK v4.test_aisdk_tool_results()inspans.rsto useinput_keyandoutput_keyvariables for handling both v4 and v5 field names.test_aisdk_tool_results()to check for correct parsing of tool call arguments and results.This description was created by
for 3a0dda7. You can customize this summary. It will automatically update as commits are pushed.