fix(moa): keep virtual provider on MoA client + preserve slot identity (salvage #53809) - #53826
Merged
Merged
Conversation
14 tasks
Contributor
🔎 Lint report:
|
This was referenced Jul 2, 2026
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.
Summary
Salvage of #53809 by @helix4u (Gille). Fixes two MoA routing bugs so selecting a MoA preset as the active model stays on the in-process
MoAClientfacade and adapter-backed slot providers keep their provider identity.Bug A — fake localhost endpoint. The non-streaming
provider="moa"path rebuilt a real request-local OpenAI client and the virtual runtime advertisedhttp://127.0.0.1/v1. On Windows boxes running IIS/another local service there, this produced confusingEndpoint: http://127.0.0.1/v1HTTP 404s instead of using the facade.Bug B — slot reclassified as custom.
_slot_runtime()forwarded each slot's resolvedbase_urlintocall_llm(), which treats any explicitbase_urlas a custom endpoint. A slot likeopenai-codex:gpt-5.5becamecustom:gpt-5.5atchatgpt.com/backend-api/codex, bypassing the Codex auth-header/Responses adapter → Cloudflare 403s.Changes
agent/chat_completion_helpers.py: non-streamingprovider="moa"uses theMoAClientfacade directly instead of building a request-local OpenAI client.agent/agent_init.py: MoA agents pinbase_url = "moa://local"instead of carrying a stalehttp://127.0.0.1/v1.agent/agent_runtime_helpers.py: mid-session switches to MoA stay on the facade.agent/moa_loop.py:_slot_runtime()preserves provider identity for adapter-backed slots (openai-codex,xai-oauth) so resolved URLs don't reclassify them ascustom.hermes_cli/runtime_provider.py: reports the MoA virtual runtime asmoa://local.tests/run_agent/test_moa_loop_mode.py: regression coverage (no request-local client for MoA, virtual endpoint, Codex slot not forwarded as custom).Validation
Cherry-picked both contributor commits onto current
main(authorship preserved). The merge coexists cleanly with the recently-landed MoA reference-block + cache work (#53793).tests/run_agent/test_moa_loop_mode.py→ 13/13 pass (contributor's 3 routing tests + the reference-block/cache tests).Credit
Original PR #53809 by @helix4u — cherry-picked with authorship preserved.
Infographic