Skip to content

Conversation

@dinmukhamedm
Copy link
Member

@dinmukhamedm dinmukhamedm commented Aug 22, 2025

Important

Add alias for input field in InstrumentationChatMessageAISDKToolCall for AI SDK v4 compatibility and update tests accordingly.

  • Behavior:
    • Add #[serde(alias = "args")] to input field in InstrumentationChatMessageAISDKToolCall in chat_message.rs for backward compatibility with AI SDK v4.
  • Tests:
    • Update test_aisdk_tool_results() in spans.rs to use input_key and output_key variables for handling both v4 and v5 field names.
    • Modify assertions in test_aisdk_tool_results() to check for correct parsing of tool call arguments and results.

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

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.

Caution

Changes requested ❌

Reviewed everything up to 34786ce in 2 minutes and 40 seconds. Click for details.
  • Reviewed 86 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 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.
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% <= threshold 50% 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% <= threshold 50% 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 Ellipsis 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];
Copy link
Contributor

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.

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 3a0dda7 in 1 minute and 11 seconds. Click for details.
  • Reviewed 26 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 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.
1. app-server/src/traces/spans.rs:1242
  • Draft comment:
    In the function parse_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 Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@dinmukhamedm dinmukhamedm merged commit 8496e82 into dev Aug 22, 2025
2 checks passed
@dinmukhamedm dinmukhamedm deleted the fix/ai-tools branch August 22, 2025 15:35
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.

3 participants