fix: preserve wrapped provider identity and effective model in hooks - #63
Merged
Merged
Conversation
Brian Krabach (bkrabach)
marked this pull request as ready for review
September 22, 2026 02:46
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.
A host can wrap its selected conversation provider without replacing the mounted provider registry. The loop currently identifies that provider using direct object identity, emits provider:request with provider=null, and computer-use can then choose the wrong mounted provider's native tool format. A model pinned by the wrapper also needs to reach hooks before native tool declarations are copied into the request.
Resolve the mounted alias through original/wrapped identity links, retaining the selected wrapper for execution. Include the effective model on provider:request events before request construction; independently resolved goal utility requests report their own model. Matching never uses vendor ids or names, and mounted provider instances, worker routing, and configured defaults remain unchanged. Wrapper cycles and ambiguous provenance terminate without choosing an arbitrary alias.
Validation: the full loop test suite passed, 422 tests, using the deployed worker's Python and amplifier-core. Regressions cover multiple instances of the same vendor, changed root selection with an unchanged warmed provider map, both reminder placements, effective model visibility before native-tool snapshots, and unchanged goal/default routing. Ruff reports the same 14 pre-existing findings and no new findings; diff whitespace checks pass.
An isolated integration used Unified's actual SelectedProvider and SurfaceProvider classes plus the companion computer-use fix, verifying OpenAI and two different Anthropic instances with model overrides. This is offline validation: live Anthropic inference and API acceptance remain pending, and no deployment is claimed.
Companion hook change: microsoft/amplifier-bundle-computer-use#22
Tested parent revision: 008e096.