Skip to content

Fix Playground tool name bug#3881

Merged
GabrielBianconi merged 11 commits intomainfrom
gb/fix-playground-tool-name-bug
Oct 11, 2025
Merged

Fix Playground tool name bug#3881
GabrielBianconi merged 11 commits intomainfrom
gb/fix-playground-tool-name-bug

Conversation

@GabrielBianconi
Copy link
Member

@GabrielBianconi GabrielBianconi commented Oct 10, 2025

Bug: The playground was comparing tool names as stored in the database to tool IDs in the config (tools.xxx). This broke inference when the tool included a custom name (tools.xxx.name).

https://tensorzero.slack.com/archives/C089WKPUJ80/p1760121010644369


Important

Fixes Playground tool name comparison bug by mapping tool config IDs to display names and adds a test to verify the fix.

  • Bug Fix:
    • Fixes tool name comparison bug in Playground by mapping tool config IDs to display names in inference.utils.tsx.
    • Updates subtractStaticToolsFromInferenceInput() to use toolsConfig for correct name mapping.
  • Playground:
    • Passes toolsConfig to prepareInferenceActionRequest() in route.tsx and utils.ts.
  • Testing:
    • Adds e2e test in playground.spec.ts to verify tool filtering with different config IDs and display names.

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

Copilot AI review requested due to automatic review settings October 10, 2025 20:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the Playground tool filtering logic where tools with different config IDs and display names were not being handled correctly. The issue occurred when a tool's configuration ID (e.g., "answer_question") differed from its display name (e.g., "submit_answer"), causing the tool filtering to fail.

  • Updated tool filtering logic to consider both config IDs and display names when filtering static tools
  • Added toolsConfig parameter to inference request preparation functions
  • Added comprehensive E2E test to verify the fix works correctly

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ui/fixtures/config/tensorzero.toml Adds display name "submit_answer" to the "answer_question" tool config for testing
ui/e2e_tests/playground.spec.ts Adds E2E test verifying tool filtering works with different config IDs and display names
ui/app/routes/playground/utils.ts Updates interface and function to accept toolsConfig parameter
ui/app/routes/playground/route.tsx Passes toolsConfig to inference preparation functions
ui/app/routes/api/tensorzero/inference.utils.tsx Updates tool filtering logic to handle both config IDs and display names

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 10, 2025 20:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

GabrielBianconi and others added 2 commits October 10, 2025 16:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 10, 2025 20:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GabrielBianconi GabrielBianconi marked this pull request as draft October 10, 2025 21:29
@GabrielBianconi GabrielBianconi marked this pull request as ready for review October 10, 2025 21:43
@GabrielBianconi
Copy link
Member Author

/regen-fixtures

Copilot AI review requested due to automatic review settings October 10, 2025 22:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@virajmehta
Copy link
Member

/regen-fixtures

virajmehta
virajmehta previously approved these changes Oct 10, 2025
@virajmehta
Copy link
Member

/regen-fixtures

1 similar comment
@GabrielBianconi
Copy link
Member Author

/regen-fixtures

Copilot AI review requested due to automatic review settings October 11, 2025 01:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GabrielBianconi GabrielBianconi added this pull request to the merge queue Oct 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 11, 2025
@GabrielBianconi GabrielBianconi added this pull request to the merge queue Oct 11, 2025
Merged via the queue into main with commit 4c2193f Oct 11, 2025
32 checks passed
@GabrielBianconi GabrielBianconi deleted the gb/fix-playground-tool-name-bug branch October 11, 2025 11:02
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