Skip to content

fix(config): prevent custom endpoint slug collisions from cross-routing API credentials - #71178

Open
Drexuxux wants to merge 1 commit into
NousResearch:mainfrom
Drexuxux:fix/custom-endpoint-key-env-collision
Open

fix(config): prevent custom endpoint slug collisions from cross-routing API credentials#71178
Drexuxux wants to merge 1 commit into
NousResearch:mainfrom
Drexuxux:fix/custom-endpoint-key-env-collision

Conversation

@Drexuxux

Copy link
Copy Markdown
Contributor

What?

Distinct custom endpoint IDs such as acme-prod and acme_prod were mapped to the same .env variable.

Saving the second endpoint overwrote the first credential, causing runtime resolution to pair Endpoint A's URL with Endpoint B's API key.

Fix

Custom endpoint credential slots now include a stable SHA-256 digest, preserving identity differences that the readable slug removes.

Legacy slots remain supported during rotation, clearing, and deletion. Active model mirrors are migrated before old credentials are removed, and shared legacy slots are retained until their final reference is gone.

Related work

These changes moved secrets out of config.yaml, but did not prevent punctuation-normalization collisions between distinct endpoint identities.

No matching open or closed issue/PR was found. #45481 concerns provider entries overwriting by shared base URL and is a different code path.

Tests

  • Current main reproduction: Endpoint A resolved with Endpoint B's API key.
  • Fixed branch: both endpoints retain and resolve only their own credentials.
  • Targeted regression coverage: 10 passed.
  • Broader suites: 494 passed / 24 skipped and 376 passed / 1 skipped.
  • Four excluded failures were reproduced unchanged on clean upstream/main.
  • Ruff, compileall, and git diff checks passed.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 25, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for isolating this credential-routing bug. The current implementation still has the reported collision: hermes_cli/config.py:3953-3954 normalizes both acme-prod and acme_prod to the same slot; hermes_cli/web_server.py:7192-7197 writes that slot into each endpoint; and hermes_cli/runtime_provider.py:1115-1127 resolves the configured slot at runtime.

The digest-based slot in 98fb32788833 preserves the readable identity while separating punctuation-distinct IDs. Its legacy-reference guard also avoids removing a shared pre-digest slot while another configured endpoint still names it.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 30, 2026
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/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists 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 sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants