Commit 82c7df7
authored
feat(providers): add native Nous Portal provider (Codex-style OAuth, no hermes_cli dep) (#2102)
* feat(providers): add native Nous Portal provider (codex-style OAuth, no hermes_cli dep)
Adds a 'nous' provider that speaks the OpenAI-compatible wire format (thin
subclass of OpenAICompatibleLLM) and authenticates with the rotating,
inference-scoped JWT from a 'hermes portal' login — read natively from
~/.hermes/auth.json, exactly mirroring the Codex provider. No dependency on
the hermes_cli package.
- nous_auth.py: NousAuthManager reads providers.nous OAuth state, decodes the
JWT exp for proactive refresh, and refreshes via POST {portal}/api/oauth/token
(x-nous-refresh-token header). Atomic write-back of rotated tokens. Because
the Hermes auth store is shared with a possibly-running Hermes agent, refresh
takes the same ~/.hermes/auth.lock flock Hermes uses and re-reads the latest
refresh_token from disk before exchange (single-use RT reuse-detection safety).
- nous_llm.py: thin subclass; proactive refresh offloaded to a thread so the
event loop never blocks; one reactive refresh + retry on a 401.
- llm_wrapper.py: register nous in dispatch, validator, no-key set, base-url default.
- tests: auth-store load/refresh/persist/terminal-error + provider wiring (no
Hermes install or network needed).
* docs(providers): document nous provider + add default model
- config.py: add nous to PROVIDER_DEFAULT_MODELS (deepseek/deepseek-v4-flash)
so omitting HINDSIGHT_API_LLM_MODEL doesn't fall back to gpt-4o-mini.
- configuration.md: add nous to the provider list + an env example block.
- models.mdx: add a nous example + a 'Nous Portal Setup (Hermes)' section
covering the 'hermes portal' login, the no-API-key flow, and automatic
JWT refresh that coordinates with a running Hermes agent.
- skills/hindsight-docs: regenerated bundle from the docs sources.1 parent a0e6bed commit 82c7df7
10 files changed
Lines changed: 1121 additions & 2 deletions
File tree
- hindsight-api-slim
- hindsight_api
- engine
- providers
- tests
- hindsight-docs/docs/developer
- skills/hindsight-docs/references/developer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| 599 | + | |
599 | 600 | | |
600 | 601 | | |
601 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
440 | 456 | | |
441 | 457 | | |
442 | 458 | | |
| |||
569 | 585 | | |
570 | 586 | | |
571 | 587 | | |
| 588 | + | |
572 | 589 | | |
573 | 590 | | |
574 | 591 | | |
| |||
593 | 610 | | |
594 | 611 | | |
595 | 612 | | |
| 613 | + | |
| 614 | + | |
596 | 615 | | |
597 | 616 | | |
598 | 617 | | |
| |||
0 commit comments