fix(agent-core-v2): tolerate unresolvable bound model in media registrar refresh - #19
Merged
Merged
Conversation
…rar refresh AgentMediaToolsRegistrar.refresh ran inside the agent.status.updated listener and called modelCatalog.getRequester unconditionally, so a bound alias that no longer resolves (config edited mid-session, stub catalogs in tests) threw inside the listener and surfaced as an [unexpected] stderr trace. Mirror profileService.tryResolveRawModel: fall back to no requester — media tools still register, without an uploader — instead of crashing the listener. Closes #18
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.
Problem
Issue #18 — left over from #16:
Agent tool description > renders global tool restrictions in subagent type descriptions(and any session where the bound model alias stops resolving) produced:AgentMediaToolsRegistrar.refreshruns inside theagent.status.updatedlistener and calledmodelCatalog.getRequester(alias)unconditionally. When the bound alias fails to resolve — config edited mid-session, or a stub catalog in tests — the throw happened inside an Emitter listener and was reported as[unexpected]. Tests still passed, so it was pure noise masking real regressions.What changed
mediaToolsRegistrar.ts:refresh()now mirrorsprofileService.tryResolveRawModel— on resolution failure it falls back to no requester (media tools still register, just without a video uploader) instead of throwing inside the listener.read-media.test.ts: new case pinning the behavior — binding an unresolvable alias reports no unexpected error and still registersReadMediaFile. Verified it fails without the fix and passes with it.Verification
lint:domainOK,tsc --noEmitcleanCloses #18.