Skip to content

fix(registry): add vertex to PROVIDER_REGISTRY so auxiliary clients can use ADC - #66707

Closed
xxiaoxiong wants to merge 1 commit into
NousResearch:mainfrom
xxiaoxiong:fix/66674-vertex-aux-registry
Closed

fix(registry): add vertex to PROVIDER_REGISTRY so auxiliary clients can use ADC#66707
xxiaoxiong wants to merge 1 commit into
NousResearch:mainfrom
xxiaoxiong:fix/66674-vertex-aux-registry

Conversation

@xxiaoxiong

@xxiaoxiong xxiaoxiong commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Fixes #66674.

The auxiliary client (title_generation, context_compression, memory_flush) cannot use Vertex AI over ADC, even when the main chat agent works fine. Setting auxiliary.<task>.provider: vertex always falls back to OpenRouter/Nous with the spurious error:

Provider 'vertex' is set in config.yaml but no API key was found. Set the VERTEX_API_KEY environment variable

Root cause

resolve_provider_client() (agent/auxiliary_client.py, ~L4849) guards with:

pconfig = PROVIDER_REGISTRY.get(provider)
if pconfig is None:
    return None, None

There is a correct Vertex/ADC branch a bit further down (agent/auxiliary_client.py:5215), but it is dead code because vertex is never in PROVIDER_REGISTRY:

  • vertex exists only as a plugin (plugins/model-providers/vertex/) with auth_type="vertex" and env_vars=().
  • The auto-extend loop at hermes_cli/auth.py:~L452 skips non-api_key providers:
    if _pp.auth_type != "api_key" or not _pp.env_vars:
        continue
    So vertex is skipped.

Contrast bedrock (auth_type="aws_sdk", api_key_env_vars=()) — it is hardcoded into the static PROVIDER_REGISTRY at hermes_cli/auth.py:429, so its analogous aux branch is reachable.

Fix

Mirror bedrock: add a static vertex entry to PROVIDER_REGISTRY with auth_type="vertex" and empty api_key_env_vars. The existing elif pconfig.auth_type == "vertex": branch at agent/auxiliary_client.py:5215 then becomes reachable and uses get_vertex_config() to mint an ADC token, identical to the main agent's path.

Verification

>>> from hermes_cli.auth import PROVIDER_REGISTRY
>>> v = PROVIDER_REGISTRY.get('vertex')
>>> v.id, v.auth_type, v.api_key_env_vars
('vertex', 'vertex', ())

The auto-extend loop does not overwrite the static entry (it only adds new plugin providers, not replaces).

Checklist

  • Reproduces the issue on current origin/main
  • Static registry entry mirrors bedrock exactly (same ProviderConfig shape)
  • No behavior change for non-vertex providers
  • vertex plugin's own aliases are still auto-extended via the _PROVIDER_ALIASES loop

Notes

This is a low-risk 8-line change to a single dict. No new tests added because exercising resolve_provider_client(vertex) end-to-end requires GCP ADC, which CI cannot provide. Manual verification above confirms the unblocking.

Maintainer consideration: vertex is the third non-api_key provider (after bedrock and copilot-acp-style OAuth). If more ADC providers appear, a follow-up could relax the auto-extend predicate to include auth_type in {"vertex", "aws_sdk"} and remove the need for static entries — but that is a larger refactor and out of scope for this defect.

…an use ADC (NousResearch#66674)

Vertex AI ADC (auth_type="vertex") was unreachable for auxiliary clients
because the auto-extend loop in PROVIDER_REGISTRY skips non-api-key
providers. Mirroring the bedrock approach by adding a static "vertex"
entry with empty api_key_env_vars and auth_type="vertex" lets
resolve_provider_client() reach the existing ADC token branch at
agent/auxiliary_client.py:5215 instead of returning (None, None).
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 18, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Comment

+8/-0 adds vertex to PROVIDER_REGISTRY so auxiliary clients can use ADC (Application Default Credentials). Small registry addition. No concerns.

Reviewed by Hermes Agent

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for tracing this to the auxiliary registry boundary. The current-main premise is confirmed: agent/auxiliary_client.py:5146-5153 returns before its existing Vertex branch at agent/auxiliary_client.py:5300-5334, and hermes_cli/auth.py:451-456 excludes Vertex's non-API-key, empty-env-vars profile from auto-registration.

Problems

  • The PR has no regression test for the auxiliary route. tests/hermes_cli/test_vertex_provider.py verifies primary runtime resolution, but does not call resolve_provider_client("vertex"); a future registry change could make this branch unreachable again.

Suggested changes

  • Add a no-network test that mocks has_vertex_credentials, get_vertex_config, and openai.OpenAI, then asserts the auxiliary resolver builds a client with the minted token and computed base URL. This does not require live ADC.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 18, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Twenty-three PRs address or reference the Vertex integration complex, spanning auxiliary ADC reachability, misleading credential errors, model normalization, doctor validation, picker visibility, and CLI overlay resolution. For #66707's reported cause, the relevant diffs either register Vertex so the existing auxiliary OAuth/ADC branch becomes reachable or provide alternative profile/direct dispatch mechanisms; the same registry repair is recorded as integrated from #56688 through #70282.

Related pull requests

Duplicates

Registry/reachability cluster: #66707, #61933, #62444, and closed #62700 overlap the landed registry outcome of #56688, while #56861/#61853 use the competing ProviderProfile-fallback mechanism and closed #62440 uses a direct branch. Normalization: #56805/#56806 overlap #56809; message-only errors: #56863 duplicates #56842; overlays: closed #57541 overlaps #57559 and #56688; closed #68249 duplicates #56688.

Suggested consolidation

Close #66707 as already implemented on main: contributor follow-up on #56688 identifies cluster PR #70282 commit 9b868f6 as the integration of the same auth_type="vertex" registry repair, so #66707's +8-line diff no longer adds a distinct fix. This departs from the keep_open review on #66707 only because that review evaluated the missing-regression-test PR in isolation before accounting for the recorded landed implementation; close overlapping registry alternatives #61933 and #62444 as duplicates of the landed #56688 outcome, while preserving #62444's recorded best-fix status as evidence that its mechanism correctly addresses #61852/#66674, and keep the distinct #56809, #56861, #56939/#57154/#59679, #57399, #57559, and #61853 salvage paths open for their separately reviewed deltas.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    I56687(["issue #56687 (closed)"])
    I56810(["issue #56810 (open)"])
    I61852(["issue #61852 (open)"])
    I66674(["issue #66674 (open)"])
    subgraph Dup61933 ["PRs duplicating each other"]
        P61933["PR #61933 (open)"]
        P62700["PR #62700 (closed)"]
        P66707["PR #66707 (open)"]
    end
    P66707 -.->|partial| I56687
    P66707 -.->|partial| I56810
    P66707 -->|fixes| I61852
    P66707 -->|fixes| I66674
    class I56687 closed
    class I56810 open
    class I61852 open
    class I66674 open
    class P61933 open
    class P62700 closed
    class P66707 open
    class P66707 target
    click I56687 "https://github.com/NousResearch/hermes-agent/issues/56687"
    click I56810 "https://github.com/NousResearch/hermes-agent/issues/56810"
    click I61852 "https://github.com/NousResearch/hermes-agent/issues/61852"
    click I66674 "https://github.com/NousResearch/hermes-agent/issues/66674"
    click P61933 "https://github.com/NousResearch/hermes-agent/pull/61933"
    click P62700 "https://github.com/NousResearch/hermes-agent/pull/62700"
    click P66707 "https://github.com/NousResearch/hermes-agent/pull/66707"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 23 pull requests and 10 issues in this complex. Each diff was read against this issue; Assessment working set: 134 kB of PR diffs, 100 kB of issue/PR text, 40 kB of discussion (60 comments), 86 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@xxiaoxiong

Copy link
Copy Markdown
Author

Closing stale PR — superseded by upstream work / no longer relevant.

@xxiaoxiong xxiaoxiong closed this Aug 9, 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/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users 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.

Auxiliary client cannot use Vertex AI — the auth_type="vertex" ADC branch is unreachable (vertex missing from PROVIDER_REGISTRY)

5 participants