fix(model): detect auth-store credential_pool for mapped providers - #5753
fix(model): detect auth-store credential_pool for mapped providers#5753jakubkrcmar wants to merge 1 commit into
Conversation
|
Refreshed this PR on top of current upstream v0.8.0 tip. The branch now contains only the still-needed delta: credential_pool detection for mapped providers like copilot plus curated gpt-5.4/gpt-5.4-mini entries for openai-codex. |
|
I hit a closely related case on the gateway In my repro, the problem was not only Copilot model visibility, but also provider visibility when credentials existed in Hermes auth storage / credential pool but were not exported as environment variables in the current process. What I observed:
It also looks like there is a provider-ID mismatch aspect for Copilot:
So provider detection and curated model lookup can disagree unless both the Hermes slug and the mapped models.dev id are checked consistently. A similar mapping issue may also affect Gemini / Google:
In short,
And then normalizes provider slug ↔ models.dev id before duplicate suppression / curated model lookup. I’m mentioning this because the fix here may want to cover not just Copilot model enumeration, but the broader “authenticated in Hermes but not exported in env vars” case too. |
|
Thanks — I reproduced the broader case locally and refreshed this PR branch on top of current upstream. Verified behavior difference against clean upstream:
So I agree the fix should be framed as broader provider visibility from Hermes auth storage, not just Copilot model enumeration. This PR still does two concrete things:
It does not try to fully rewrite all slug <-> models.dev normalization paths, but it does address the verified "authenticated in Hermes, not exported in env vars" failure mode that affected both |
|
Quick note: GitHub Actions on this fork PR currently show |
|
Verified again against current origin/main after rebasing.\n\nCurrent upstream still misses Hermes-mapped providers when credentials exist only in auth-store credential_pool and are not exported as env vars. In a local smoke test, clean upstream omitted gemini in that scenario, while the reduced patch makes gemini appear with its curated models.\n\nI also trimmed this PR to only that surviving fix. The earlier openai-codex curated-model addition is no longer included because current upstream already has that behavior. |
|
Refreshed this branch on top of current origin/main and re-verified the behavior against clean upstream. What I checked locally:
So the fix is still needed; this PR now contains only the surviving delta on top of current upstream. |
|
This branch has been refreshed on top of current Re-verified locally against clean upstream:
Would appreciate maintainer review when convenient. |
|
Thanks for the careful, well-maintained contribution @jakubkrcmar! This fix has already been merged into Automated hermes-sweeper review. The
Closing as implemented on main. |
…sResearch#52921) SelfHostedBackend.get_all derived `count` from a top_k-bounded fetch, so it reported the page size (and, with the old min(page*page_size, 1000) cap, never the real total) regardless of how many memories existed. Request _MAX_TOP_K (raised 1000 -> 10000) on GET /memories so `count` is the true total; the requested page is still sliced locally. top_k on GET /memories is honored by mem0 self-hosted v2.0.8+ (mem0 PR NousResearch#5753); older servers ignore it. get_all is currently unused by the plugin (mem0_list was removed) but remains a backend ABC method, so the fix keeps it correct for any future caller.
Summary
credential_poolentries as valid credentials during/modelprovider listing for Hermes-mapped providerscredential_poolpathRepro
With credentials present only in Hermes auth storage under
credential_pooland no matching provider env var exported:geminifrom/modelgeminiappear correctly with its curated modelsScope
This PR only fixes the mapped-provider
credential_pooldiscovery gap inlist_authenticated_providers().It does not attempt broader slug-normalization cleanup, and it no longer includes the earlier
openai-codexcurated-model delta because current upstream already has that behavior.Validation
list_authenticated_providers()against cleanorigin/maingeminionly incredential_pool./.venv/bin/python -m pytest tests/hermes_cli/test_overlay_slug_resolution.py -q./.venv/bin/python -m pytest tests/hermes_cli/test_model_switch_custom_providers.py -q