hermes-provider-oauth-operations
Configure Hermes model providers, fallback chains, and OAuth re-authentication from remote or messaging sessions, especially when the `hermes` executable is not on PATH and the repo checkout must be invoked with `python -m hermes_cli.main`.
- License 许可
- MIT
- 所属仓库
- zapabob/Skills
- 最近更新
- 2026-10-26
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- hermes-provider-oauth-operations
- tags
- [ "hermes", "model", "provider", "oauth", "xai-oauth", "grok", "openai-codex", "telegram", "remote-auth" ]
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- platforms
- [ "windows", "linux", "macos" ]
- description
- Configure Hermes model providers, fallback chains, and OAuth re-authentication from remote or messaging sessions, especially when the `hermes` executable is not on PATH and the repo checkout must be invoked with `python -m hermes_cli.main`.
03 SKILL.md 正文
Hermes Provider OAuth Operations
Use this skill when the user asks to change Hermes' primary model/provider, set a fallback/sub model, or re-authenticate an OAuth-backed provider such as xai-oauth/Grok from Telegram or another remote messaging channel.
This skill supplements the protected hermes-agent skill with operational patterns learned from real remote-auth sessions.
Core workflow
-
Load
hermes-agentfirst for canonical Hermes commands and config semantics. -
Prefer Hermes CLI config commands over direct file edits for
~/.hermes/config.yaml. Do not assume a cached or remembered model name is still valid; verify the provider owns the model before setting it. For a cheap/free default in this user's current setup, prefer OpenCode Zen auto-rotation:hermes config set model.provider opencode-zen hermes config set model.default auto-free hermes config set fallback_providers '[{"provider":"opencode-zen","model":"auto-free"},{"provider":"nvidia","model":"nvidia/llama-3.1-nemotron-70b-instruct"}]'For Codex accounts, avoid invented variants such as
gpt-5.5-low; if using Codex, confirm the exact supported model first. -
If
hermesis not on PATH but the repo checkout is available, run the same CLI through the module entrypoint from the repo root:python -m hermes_cli.main config set model.provider opencode-zen python -m hermes_cli.main config set model.default auto-free python -m hermes_cli.main config set fallback_providers '[{"provider":"opencode-zen","model":"auto-free"},{"provider":"nvidia","model":"nvidia/llama-3.1-nemotron-70b-instruct"}]' -
Always verify the effective config after writes before declaring success:
hermes config | sed -n '/◆ Model/,+6p' python - <<'PY' from pathlib import Path import yaml cfg = yaml.safe_load(Path.home().joinpath('.hermes','config.yaml').read_text(encoding='utf-8-sig')) print(cfg.get('model', {})) print('fallback_providers:', cfg.get('fallback_providers')) print('reasoning_effort:', cfg.get('agent', {}).get('reasoning_effort')) PYIf a Windows atomic replace/permission error appears after one of several
config setcalls, inspect the file before retrying: a prior command may already have left the requested provider/model/reasoning values in place.For this user's preferred high-end routing, do not put GPT5.5 under OpenCode Zen. GPT5.5 is a Codex-auth model:
model: provider: openai-codex default: gpt-5.5 fallback_providers: - provider: openai-codex model: gpt-5.5 - provider: nvidia model: nvidia/llama-3.1-nemotron-70b-instruct - provider: nous model: nous-freetier-latest - provider: opencode-zen model: opencode-freetier-latest - provider: custom model: local-llama base_url: http://127.0.0.1:8081/v1 key_env: LOCAL_API_KEY start_command: powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\\Users\\downl\\Desktop\\hermes-agent-upstream-sync\\scripts\\windows\\start-hermes-llama-fallback-rtx3060.ps1" -Port 8081 -ContextSize 65536 start_timeout_seconds: 180Leave
model.context_lengthunset unless the user explicitly asks for a cap; Hermes should resolve each model's maximum context window when primary/fallback models switch. -
Start OAuth re-auth in an interactive PTY when the flow requires pasting a callback URL/code:
python -m hermes_cli.main auth add xai-oauth --no-browser --manual-paste --timeout 900Use
background=truewithpty=trueso the process remains atCallback URL:instead of receiving EOF. -
Send the authorization URL to the user. Ask them to paste either:
- the full failed loopback callback URL, e.g.
http://127.0.0.1:<port>/callback?code=...&state=..., or - the bare authorization code if the provider displays it in-page.
- the full failed loopback callback URL, e.g.
-
Submit the pasted callback/code to the waiting PTY process, then verify with:
python -m hermes_cli.main auth list xai-oauth python -m hermes_cli.main config | sed -n '1,20p' -
If this is a gateway/Telegram session, tell the user whether a gateway restart or
/resetis needed for the new model/provider state to apply to future sessions.
Pitfalls
- Do not patch
~/.hermes/config.yamldirectly when Hermes refuses sensitive config writes. Usehermes config setorpython -m hermes_cli.main config set. - Non-PTY background OAuth commands can exit immediately at the paste prompt with
missing authorization codebecause stdin is closed. Restart the command withpty=trueand keep the process running. - Treat
command not found: hermesas a PATH/setup condition, not as a Hermes failure. Use the repo module entrypoint if available. - Do not ask the user to send tokens, refresh tokens, or secrets. The callback URL/code is an OAuth authorization artifact for the waiting local flow; handle it only by submitting it to the active auth process.
- Avoid saying re-auth is complete until
auth listor an equivalent command shows a new usable credential. - When using the
lm-twittererplugin, ensuremodel.providerandmodel.defaultare set to values allowed by the plugin (checkplugins.entries.lm-twitterer.llm.allowed_modelsandallowed_providersin your config). - If cron starts but job content fails with
404 Model ... not foundor400 model is not supported, treat it as a provider/model ownership mismatch until proven otherwise: inspectagent.conversation_looplogs, checkfallback_providers,delegation, and named profile configs, then remove stale cache entries that bind model aliases to the wrong base URL. - Never put
nvidia/...model ids orauto-freeunderprovider: nous.auto-freebelongs toopencode-zen; NVIDIA NIM models belong toprovider: nvidia; Nous fallbacks should use Nous-owned model names unless the current Nous provider catalog explicitly says otherwise. - Never put
gpt-5.5underprovider: opencode-zenfor this user's preferred route. GPT5.5 should useprovider: openai-codex/ Codex auth. - Use live free-tier sentinels (
nous-freetier-latest,opencode-freetier-latest) only when the Hermes checkout expands them at runtime; otherwise updatehermes_cli/fallback_chain.pyfirst or use a script that refreshes the catalog before writing config. - On 429 routing requests, check whether the code retries the same credential once before falling back. If the user asks for immediate rotation, update the recovery path so rate-limit failures rotate/fallback without a same-model retry.
- Local llama fallback should be cold-started via a fallback
start_command, not launched at Hermes startup, when the user says startup is already heavy. - For NVIDIA NIM fallback in this Hermes tree, prefer the provider plugin canonical names
nvidia/llama-3.1-nemotron-70b-instructandnvidia/llama-3.3-70b-instructover stalenvidia/nemotron-3-*aliases found in old catalogs/caches. - After provider config edits, restart the gateway before judging cron behavior; the scheduler may have cached the old config in the running gateway process.
References
references/grok-oauth-telegram-manual-paste.md— concise transcript-derived notes for xAI/Grok OAuth via Telegram manual paste.references/cron-provider-model-mismatch.md— cron/fallback debugging notes for provider/model mismatch, stale Nous/NVIDIA aliases, and cache cleanup.references/live-freetier-fallback-routing.md— Codex GPT5.5 primary, live Nous/OpenCode free-tier fallback expansion, immediate 429 rotation, model-max context, and cold llama-server local fallback.
04 同仓库更多 Skills
xurl
X/Twitter via xurl CLI: post, search, DM, media, v2 API.
writing-plans
Write implementation plans: bite-sized tasks, paths, code.
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
weights-and-biases
W&B: log ML experiments, sweeps, model registry, dashboards.
watchers
Poll RSS, JSON APIs, and GitHub with watermark dedup.
serving-llms-vllm
vLLM: high-throughput LLM serving, OpenAI API, quantization.