Repository navigation
refactor(core): drop redundant String casts on Model.Ref in to-llm-message - #57887
Conversation
There was a problem hiding this comment.
The change looks sound and leaves behaviour unchanged. With fewer than two eligible inline mentioned images, the dedupe loop can't find a duplicate, so it returns the same parts as the removed early-return path. Model.Ref.id and providerID are branded strings, so === matches the old String(...) comparison. In packages/core, session-runner-message.test.ts passes, including the dedupe and provider-metadata reuse cases, and typecheck passes.
The public API is unchanged. I have no concerns.
GiuseppeBellamacina
left a comment
There was a problem hiding this comment.
With fewer than two eligible inline mentioned images, the dedupe loop can't find a duplicate, so dropping the pre-filter returns the same parts as the old early return. The direct providerID / id comparisons match what modelSwitched already does in this file. Looks good to me.
Problem
assistantinto-llm-message.tswrapsmessage.modelandmodelfields inString(...)even though both are typed asModel.Ref(unlikemodelSwitchedin the same file, which comparesproviderIDandiddirectly).Change
Compare
Model.Reffields directly inassistant.Out of scope