Skip to content

fix: 🚑 Tool descriptions are not being added for nativeTool enabled models #6934

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

Closed
wants to merge 2 commits into from

Conversation

chezsmithy
Copy link
Contributor

@chezsmithy chezsmithy commented Aug 2, 2025

Description

🚨 PR: #6723 is no longer added the full tool description when the model can use native tool calling. The tool description was refactored to have a description and a systemMessageDescription. For non native models, the tool descriptions are appended to the system message. For native tool calling models the description should include all the needed information.

This change updates the tool description for native tool calling models by concating the tool description and the systemMessgeDescription. I've noted in testing this fixes the tool calling issues that have been introduced after #6723 was merged to main.

I'd recommend merging this fix before releasing another pre-release. Also note this fix must be bundled with #6723 in any release to not cause a broken tool calling experience.

This should be viewed as a critical hotfix to the pre-release channel.

Note, I've also updated the parallel tool calling instruction to make it more forceful. I'm willing to put that into a separate PR if it might be risky. I've noted with this change I see parallel tool calls with claude sonnet 4.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]

I've not added any new tests. I've performed inspection of the options.tools values by debugging and the system messages when nativeTool use is enabled.


Summary by cubic

Fixed an issue where tool descriptions were missing for models with nativeTool enabled, ensuring all relevant tool information is included.

  • Bug Fixes
    • Combined function and system message descriptions for native tools so both are shown to the model.

@chezsmithy chezsmithy requested a review from a team as a code owner August 2, 2025 05:59
@chezsmithy chezsmithy requested review from tingwai and removed request for a team August 2, 2025 05:59
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 2, 2025
@chezsmithy
Copy link
Contributor Author

@RomneyDa flagging you as a reviewer on this change as you developed #6723

@chezsmithy
Copy link
Contributor Author

Note, CI/CD is likely to fail on this PR until #6933 gets merged.

Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

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

@chezsmithy systemMessageDescription is included in the system message when using system message tools, not native tools, see
https://github.com/continuedev/continue/blob/main/core/tools/systemMessageTools/buildToolsSystemMessage.ts#L112

System Message Description is an alternative to the tools JSON, only to be used for system message tools. It exists because dumber models need more targeted explanations/examples for tool use, and aren't trained well on the JSON descriptions

Could you reiterate the fix here?

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Aug 4, 2025
@RomneyDa
Copy link
Collaborator

RomneyDa commented Aug 4, 2025

@chezsmithy could merge parallel fix on separate pr!

@RomneyDa RomneyDa removed the request for review from tingwai August 4, 2025 19:20
@chezsmithy
Copy link
Contributor Author

chezsmithy commented Aug 5, 2025

@RomneyDa in my debugging for say AWS Bedrock with Sonnet. I noticed that the System Message doesn't include any of the tool definitions as it's native tool use, but then in the tools array passed to the model, the tool description is just the description field and not the systemMessageDescription. Thus the model gets a list of tools, with a very basic agent system message and is left to figure out how to use the tools from the shape of the payloads and a VERY basic tool description. This results in the model using the tools very poorly. Does that make sense?

This fix, re-introduces what would have been in the decription back to the tools array description field fixing tools use for native tools using models.

@RomneyDa
Copy link
Collaborator

RomneyDa commented Aug 5, 2025

@RomneyDa in my debugging for say AWS Bedrock with Sonnet. I noticed that the System Message doesn't include any of the tool definitions as it's native tool use, but then in the tools array passed to the model, the tool description is just the description field and not the systemMessageDescription. Thus the model gets a list of tools, with a very basic agent system message and is left to figure out how to use the tools from the shape of the payloads and a VERY basic tool description. This results in the model using the tools very poorly. Does that make sense?

The system message description is brief blurb + an example of calling the tool using system message tools, e.g.

TOOL_NAME: read_file
BEGIN_ARG: filepath
test.js
END_ARG

It doesn't apply for native tools, it's mostly duplicate. In many cases, it's more concise. If there is information missing from the normal tool description which is in the system message description, we should add it to the normal tool description.

@RomneyDa
Copy link
Collaborator

RomneyDa commented Aug 5, 2025

Another way of putting this is that when I added systemMessageDescriptions (specifically used for system message tools) I did not remove anything from the other descriptions. If I did, it was my mistake!

@chezsmithy
Copy link
Contributor Author

Another way of putting this is that when I added systemMessageDescriptions (specifically used for system message tools) I did not remove anything from the other descriptions. If I did, it was my mistake!

Ah! Gotcha. So yeah we lost some significant content from the descriptions.

@RomneyDa
Copy link
Collaborator

RomneyDa commented Aug 5, 2025

@chezsmithy which tools lost content?

@RomneyDa
Copy link
Collaborator

RomneyDa commented Aug 5, 2025

I took a look through and it looks like in all cases the JSON descriptions are at least as thorough as the alternative system message ones, although the system message tools search and replace description seems to have missed an update during a merge. Any tools seem off to you?

@RomneyDa
Copy link
Collaborator

RomneyDa commented Aug 5, 2025

Closing this for now but keeping a close eye on any agent issues so please reopen something if needed or if I missed something!

Also the parallel note would be a nice change, have also noticed claude tends to still do series calls

@RomneyDa RomneyDa closed this Aug 5, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Aug 5, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants