fix: remove unused keys from Message template args#1010
Open
ajbozarth wants to merge 1 commit intogenerative-computing:mainfrom
Open
fix: remove unused keys from Message template args#1010ajbozarth wants to merge 1 commit intogenerative-computing:mainfrom
ajbozarth wants to merge 1 commit intogenerative-computing:mainfrom
Conversation
role, images, and name were included in Message/ToolMessage.format_for_llm() args but are never consumed by any template — backends read them directly from the Message object. Their presence caused a false-positive warning from the unused-keys check added in generative-computing#975. Since name was the only thing ToolMessage.format_for_llm() added, the override is now redundant and has been removed. Assisted-by: Claude Code Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
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.
Misc PR
Type of PR
Description
role,images, andnamewere included inMessage/ToolMessage.format_for_llm()args but are never consumed by any template — all backends read these fields directly from theMessageobject (e.g.m.role,m.images). Their presence caused a false-positive warning from the unused-keys check added in #975.Investigation via git history confirmed
rolewas present from the start andimageswas added in #126 (VLM support) with the stated intent of making them available for custom templates. However, no such custom templates exist in the codebase, and the consumption path has always been direct object access. The warning from #975 correctly flagged them.Since
namewas the only addition inToolMessage.format_for_llm(), the override is now identical to the inheritedMessageimplementation and has been removed along with its test.Testing
Attribution