fix(agent-core-v2): fall back to the configured default model for image format gating - #3652
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 13a99fd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
Merged
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.
Related Issue
Follow-up to #3649 (no tracking issue; gap found during end-to-end smoke testing of that PR).
Problem
#3649 made image format acceptance provider-aware, but every gate resolved the provider type only from the bound model. A fresh session that has not explicitly bound a model yet (no per-request
model, noagent_configselection) has an empty profile alias, sogetModelProviderType()returnedundefinedand every gate fell back to the baseline PNG/JPEG/GIF/WebP set. Two supported flows hit this:default_modelis served by Kimi: the image was persisted as an attachment and replaced by a text notice even though the turn's effective model is the Kimi default.profilewithout naming amodel:bind()falls back to the configureddefault_model, but the kap-server route runs media resolution before the bind, so the gate sawundefinedagain.What changed
IAgentProfileService.getModelProviderType(alias?)now resolvesalias ?? boundModelAlias ?? config defaultModelbefore consulting the catalog, mirroring the fallbackbind()itself applies. One change covers every consumer (prompt-entry gate, kap-server prompt/skill routes, MCP tool results). Explicit alias and bound-model resolution are unchanged; when neither a bound model nor a resolvable default exists, the method still returnsundefinedand gates keep the baseline set.Tests (red-first): profile-level fallback including precedence and non-Kimi/missing defaults (
profileOps.test.ts); kap-server route regressions for both flows above (prompts.test.ts). Verified with the full agent-core-v2 / kap-server / acp-server / klient suites plus a live end-to-end smoke (real server process, mock OpenAI-compatible provider, sips-generated HEIC/BMP files): 20/20 checks pass, including the previously failing unbound-first-prompt case.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.