Repository navigation
fix(provider): route runtime inference through the wire adapter - #13
Merged
Merged
Conversation
ProviderProfile.runtime_base_url() is the hook Hermes reads when it builds the inference base URL, and the base implementation returns None. Without an override the profile's base_url was never consulted, so every subscription request went straight to api.meta.ai and Meta answered 403 client_attestation_denied even though the loopback adapter was bound. Return the adapter URL, or the direct endpoint when the adapter could not bind, from the override. Refs #12 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
On Hermes 0.22,
ProviderProfile.runtime_base_url()is the only hookresolve_api_key_provider_credentials()reads when it builds the inference base URL, and the base implementation returnsNone.MuseCodeSubscriptionProfilenever overrode it, soprofile.base_url(set at import and refreshed byregister()) was a dead write: runtime requests resolved toinference_base_url(https://api.meta.ai/v1), bypassing the loopback adapter and getting403 client_attestation_denied.Reported in #12.
Change
runtime_base_url()to return the adapter URL, or the direct endpoint when the adapter could not bind.Unreleased.Verification
Reproduced against
mainwith the upstream base implementation and the same resolution shape ashermes_cli/auth.py:profile.base_urlhttp://127.0.0.1:43219/v1https://api.meta.ai/v1http://127.0.0.1:43219/v1http://127.0.0.1:43219/v1CI-equivalent checks on the branch:
python -m pytest -q49 passed,ruff check .clean,validate-plugin.py --path .PASS.Refs #12