fix(llm): inject _noop tool for all providers when messages contain tool history#36221
Open
Robin1987China wants to merge 1 commit into
Open
fix(llm): inject _noop tool for all providers when messages contain tool history#36221Robin1987China wants to merge 1 commit into
Robin1987China wants to merge 1 commit into
Conversation
…ool history Bedrock (and other providers) requires a toolConfig when messages contain toolUse/toolResult content blocks, even if no active tools are being used. Previously the _noop tool injection was limited to github-copilot, but the underlying constraint affects Compaction on Bedrock-backed providers too (e.g. Portkey) — resulting in "toolConfig field must be defined" errors. Remove the github-copilot-specific guard so the _noop tool is injected whenever messages contain prior tool calls but no current tools are active. Closes anomalyco#34089
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
3 tasks
Contributor
|
The following comment was made by an LLM, it may be inaccurate: I found a potentially related PR: #34094 - This PR addresses the same underlying issue with Bedrock-backed providers requiring |
Contributor
Author
|
Closes #34089 |
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.
Issue for this PR
Closes #34089
Type of change
What does this PR do?
Bedrock (and other providers) requires a
toolConfigwhen messages containtoolUse/toolResultcontent blocks, even if no active tools are being used. Previously the_nooptool injection was limited togithub-copilot, but the underlying constraint affects Compaction on Bedrock-backed providers too (e.g. Portkey), resulting in "toolConfig field must be defined" errors.Removes the
github-copilot-specific guard so the_nooptool is injected whenever messages contain prior tool calls but no current tools are active.How did you verify your code works?
bun typecheckinpackages/opencode(0 errors onv2). The change is a 2-line removal (guard condition + comment); the_noopinjection andhasToolCallslogic are unchanged.Checklist