fix(providers): use chat completions for all Actual routes - #99523
Merged
Conversation
This was referenced Aug 31, 2026
somewheresy
force-pushed
the
justin/e-1047-route-hermes-actual-provider-through-chat-completions-with
branch
from
September 2, 2026 15:29
0527cfb to
fbadfd9
Compare
somewheresy
force-pushed
the
justin/e-1047-route-hermes-actual-provider-through-chat-completions-with
branch
from
September 10, 2026 18:41
d181255 to
7cffb89
Compare
somewheresy
force-pushed
the
justin/e-1047-route-hermes-actual-provider-through-chat-completions-with
branch
from
September 10, 2026 19:01
7cffb89 to
4135933
Compare
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
Use
/v1/chat/completionsfor every Actual generation path, including foreground chat, compaction, titles, async tasks, startup resolution, model switches, fallback chains, session restoration, and credential rotation. Store Actual provider settings inconfig.yamland credentials in.env.Motivation
The transport switch left multiple ways to select Responses: auxiliary wrappers, the hosted hostname mapping, persisted task/custom-provider modes, aliases, and runtime transitions. Bare endpoint overrides could also lose
/v1. Environment-backed provider settings could override YAML during setup, credential resolution, or live key reloads.Links
Approach
api.actual.inchostname and enforce Chat Completions when resolving and changing runtimes./v1.--reasoningpropagation.model.base_url. Prefer YAML during setup, discovery, credential-pool resolution, and live API-key reloads. KeepACTUAL_BASE_URLas a legacy fallback; credentials remain in.env.mainat872bafd58d.Reviewer Focus
The HTTP harness in
tests/agent/test_actual_auxiliary_routing.pyexercises the real SDK, title generator, compressor, sync/async calls, provider resolution, and live agent transitions. A local server rejects inference routes other than/v1/chat/completions; hosted-route cases resolveapi.actual.incto that server. Coverage includes aliases, custom routes, keyed/keyless local endpoints, stale configuration, bare URLs, unsupported-model fallback, startup fallback, restored sessions, credential rotation, and live key reloads.Regression cases reproduced the old alias/custom routing, startup fallback, and credential-rotation failures before their fixes. 1,900 tests pass across 109 files, including 121 Actual routing/configuration cases, after rebasing. The 18 forced-Responses cases reproduced outbound HTTP before the send guards and now verify that no HTTP request is sent; normal Actual requests still complete successfully. The suite also exercises the supported Codex Responses paths. Repository Ruff checks and the plugin-compatibility check pass. The routing/configuration review found no remaining material issues. Validation uses local HTTP integration tests; the live hosted Actual service was not exercised in this revision.
GitHub CI, Nix, and Docker workflows at commit
8a6b5b67a7require upstream workflow approval before running. Current CI run. The PR has no merge conflicts.Failure Modes
/v1/responses, including after startup fallback, a model switch, or session restoration. Forced entry into the Responses transport raises a clear error before any HTTP request.Breaking Changes
Actual routes now override saved Responses transport selections, including custom configurations targeting
api.actual.inc. No config migration is required.ACTUAL_API_MODEwas introduced only in an earlier revision of this unmerged PR; existingACTUAL_BASE_URLsettings remain a fallback.Post-Merge Behavior
Merging triggers upstream CI and the Docker build/publish workflow. Existing Hermes processes receive the fix after updating and restarting. No Actual service deployment or new runtime flag is required. Release smoke: run
hermes -z '<prompt>' --provider actual --model <model> --reasoning high, generate a title, and compact a conversation; verify outgoing generation requests use/v1/chat/completions.Diagrams
flowchart LR Config[config.yaml provider and endpoint] --> Runtime[Actual route resolution] Key[.env API key] --> Runtime Legacy[Legacy URL fallback] --> Runtime Task[Auxiliary task or custom provider] --> Runtime Runtime --> Chat[Chat and startup] Runtime --> Aux[Titles, compaction, sync and async tasks] Runtime --> Changes[Switch, fallback, restore, key rotation] Chat --> API[POST /v1/chat/completions] Aux --> API Changes --> API