Skip to content

fix: remove unused keys from Message template args#1010

Open
ajbozarth wants to merge 1 commit intogenerative-computing:mainfrom
ajbozarth:fix/message-template-args
Open

fix: remove unused keys from Message template args#1010
ajbozarth wants to merge 1 commit intogenerative-computing:mainfrom
ajbozarth:fix/message-template-args

Conversation

@ajbozarth
Copy link
Copy Markdown
Contributor

@ajbozarth ajbozarth commented May 4, 2026

Misc PR

Type of PR

  • Bug Fix

Description

  • Link to Issue: Fixes

role, images, and name were included in Message/ToolMessage.format_for_llm() args but are never consumed by any template — all backends read these fields directly from the Message object (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 role was present from the start and images was 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 name was the only addition in ToolMessage.format_for_llm(), the override is now identical to the inherited Message implementation and has been removed along with its test.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code was added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Attribution

  • AI coding assistants used

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>
@ajbozarth ajbozarth requested a review from a team as a code owner May 4, 2026 22:48
@ajbozarth ajbozarth requested review from jakelorocco and nrfulton May 4, 2026 22:48
@github-actions github-actions Bot added the bug Something isn't working label May 4, 2026
@ajbozarth ajbozarth self-assigned this May 4, 2026
@psschwei
Copy link
Copy Markdown
Member

psschwei commented May 5, 2026

I'm also seeing the warnings when running the atai tutorial (though would need to know future plans for custom templates to say whether dropping makes sense)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants