feat(settings): add Nous Portal provider (#175)
CI / ci (push) Canceled after 0s

Settings gains hermes' `nous` slug as a fourth provider on every
surface and the Provider Keys page — endpoint
https://inference-api.nousresearch.com/v1, NOUS_API_KEY, the
5-level OpenAI-compatible effort ladder, switch flagship
anthropic/claude-sonnet-5 (live-probed: the portal's docs-listed
Hermes-4 ids 404 — the inference API serves the OpenRouter catalog,
so the switch keeps the app's sonnet posture billed through Nous).
The probe speaks plain OpenAI chat-completions; an unkeyed test
borrows the shared Portal session's agent_key (the engine's own
credential — hermes' nous runtime is OAuth-only, and a portal key
and subscription bill the same account credits), gated to the
official https endpoint so the implicit credential never rides a
user-edited URL. Pass readiness rides the same fallback, so a
logged-in machine runs passes with no key. Suite 635.

Closes #175
This commit is contained in:
AlexKucera committed 2026-11-05 15:59:41 +01:00
1 parent d305f822aa
commit b2db859887
15 files changed
+410 -30

No files matched your search

+11
View File
@@ -124,6 +124,9 @@ func liveShapedRegistry() -> ModelRegistry {
.zai: ["glm-4.5", "glm-5", "glm-5.3", "glm-5.3-flashx"],
.anthropic: ["claude-fable-5.1", "claude-opus-5-5", "claude-sonnet-5", "claude-sonnet-4-6"],
.openaiAPI: ["gpt-5.6-sol", "gpt-5.5", "gpt-5.4-mini"],
// #175: the portal's router catalog shape — vendor-prefixed ids, the
// switch flagship first.
.nous: ["anthropic/claude-sonnet-5", "z-ai/glm-5.3", "openai/gpt-5.5"],
])
}
@@ -135,6 +138,9 @@ struct SettingsModelTests {
#expect(ModelProvider.zai.effortOptions == [.low, .high, .max])
#expect(ModelProvider.openaiAPI.effortOptions == [.low, .medium, .high, .xhigh, .max])
#expect(ModelProvider.anthropic.effortOptions == [.low, .medium, .high, .xhigh, .max])
// #175: hermes clamps nous on the widest OpenAI-compatible vocabulary
// (OPENAI_COMPAT_WIRE_EFFORTS — the Museion-facing subset).
#expect(ModelProvider.nous.effortOptions == [.low, .medium, .high, .xhigh, .max])
}
@Test @MainActor func `effort unset is the leading default state`() {
@@ -184,6 +190,11 @@ struct SettingsModelTests {
#expect(model.config(for: .chat).model == "gpt-6.1-sol")
model.setProvider(.anthropic, for: .chat)
#expect(model.config(for: .chat).model == "claude-sonnet-5")
// #175: the portal switch keeps the app's sonnet posture — same
// default model, routed and billed through Nous.
model.setProvider(.nous, for: .chat)
#expect(model.config(for: .chat).model == "anthropic/claude-sonnet-5")
#expect(!model.isCustom(.chat))
}
@Test @MainActor func `an empty registry leaves every model custom free text stays first class`() {