Skip to content

fix: accept responses as alias for codex_responses in api_mode config - #33637

Closed
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/custom-provider-responses-api-mode-alias
Closed

fix: accept responses as alias for codex_responses in api_mode config#33637
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/custom-provider-responses-api-mode-alias

Conversation

@Kailigithub

Copy link
Copy Markdown
Contributor

Problem

When api_mode: responses is set in config.yaml for a custom provider, the value is silently ignored. Hermes always uses /chat/completions regardless of the setting.

The root cause is that _parse_api_mode() in runtime_provider.py only accepts values from _VALID_API_MODES, which does not include "responses". The setup wizard (hermes setup option 3) correctly maps "responses""codex_responses", but anyone who writes api_mode: responses directly in config.yaml hits this gap.

Fix

Add a "responses""codex_responses" alias in _parse_api_mode() so the config file behaves identically to the setup wizard selection. This is a 1-line functional change (plus comments).

Testing

  • python3 -m py_compile hermes_cli/runtime_provider.py — passes
  • Unit verification: _parse_api_mode("responses") now returns "codex_responses"
  • Existing provider tests (5 selected) pass without modification

Closes #33600

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/config Config system, migrations, profiles P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels May 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #33604 — both normalize api_mode: responsescodex_responses in runtime_provider.py. #33604 also touches agent_init.py for URL routing.

…nfig

When users set api_mode: responses in config.yaml (matching the
wording shown in hermes setup option 3), the value was silently
ignored because _parse_api_mode() only accepted exact values from
_VALID_API_MODES. Map 'responses' to 'codex_responses' so the
config behaves identically to the setup wizard selection.

Closes NousResearch#33600
@Kailigithub
Kailigithub force-pushed the fix/custom-provider-responses-api-mode-alias branch from f53f218 to 2de543c Compare June 18, 2026 19:16

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused compatibility fix. Current main still lacks the responses alias in hermes_cli/runtime_provider.py:352-358, and named custom-provider resolution feeds entry values through that parser at hermes_cli/runtime_provider.py:695, :718, and :766.

Problems

  • The PR adds no regression test. Please cover a real named providers: or custom_providers: entry with api_mode: responses and assert that resolve_runtime_provider() returns codex_responses.
  • The description should not imply that every bare provider: custom endpoint will use /responses. Current main deliberately drops codex_responses for non-direct OpenAI/xAI bare custom relays in hermes_cli/runtime_provider.py:154-161; tests/hermes_cli/test_runtime_provider_resolution.py:1432-1447 protects that behavior.

Suggested changes

  • Limit the documented scope to named custom-provider configuration and add the focused resolver regression above, without weakening the bare-custom relay guard.

Automated hermes-sweeper review.

# Alias: "responses" is accepted as a shorthand for "codex_responses"
# so that api_mode: responses in config.yaml behaves identically to
# selecting option 3 in `hermes setup`.
if normalized == "responses":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a resolver-level regression for a named providers: or custom_providers: entry using api_mode: responses. In current main, bare non-OpenAI provider: custom routes deliberately discard the resulting codex_responses mode (_resolve_plain_custom_api_mode()), so a parser-only check would not verify the supported configuration path.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
@Kailigithub

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #33604 (LeonSGP43), which makes the same responsescodex_responses alias fix in hermes_cli/runtime_provider.py AND additionally patches agent/agent_init.py for the same alias normalization plus adds 46 lines of regression coverage across two test files — a strict superset (53/2 lines vs this PR's 5/0). The triage bot's duplicate marker on this PR is correct on intent; #33604 was opened ~22 minutes before this PR and is strictly broader in scope (more files, more cases, full test coverage).

(Autopilot housekeeping takeover per v1.18 / v1.59 strict-supersede close protocol.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provider: custom always appends /chat/completions to base_url, ignoring api_mode

3 participants