Choose the LLM route by model, and add a capability matrix
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 58s

The arrival of non-Anthropic models made a latent bug observable: the
delegate's client was hardcoded to the Anthropic passthrough, so
pointing NISSE_ROLE_DELEGATE at gpt-6-astra or a local model would
have sent Anthropic-shaped /v1/messages bodies to something that does
not speak them. A5 promises the frontier tier is swappable "as a
configuration change, not a refactor", and it was not.

select_client now picks the route from the model: the vendor-native
adapter where one exists, LiteLLM's normalization otherwise — which is
exactly what A13 prescribes for a vendor whose renderer adapter has
not been written, pending validation against the A16 eval set.

Also adds the capability matrix Part H asks for. It says the
thresholds that depend on local capability — A12's failure count,
A14's consult budget, A15's manifest size — must be tuned "on the real
hardware", and that needs measurement rather than reputation. The
harness probes each model for the things that actually break: whether
it calls a tool at all, whether the plan it submits has substance
(llama3.2 emitted "{"), whether it can consume its own tool result,
and whether prompt-level JSON holds. Opt in with
NISSE_CAPABILITY_MODELS; it spends real tokens across several models.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
dongarandClaude Opus 5 committed 2026-09-22 23:20:38 +00:00
1 parent 1da94d2581
commit ed2f5dfc7f
4 files changed
+231 -5

No files matched your search

+33 -1
View File
@@ -11,7 +11,14 @@ from nisse_dev.canonical import (
UserMessage,
)
from nisse_dev.envfile import load_env_file
from nisse_dev.llm import RATE_LIMIT_RETRY_S, LiteLLMClient, LLMError, RoleMap
from nisse_dev.llm import (
RATE_LIMIT_RETRY_S,
LiteLLMClient,
LLMError,
RoleMap,
has_native_adapter,
select_client,
)
EVENTS = [StoredEvent(id=1, ts="t", event=UserMessage(text="hi", source="m:1"))]
@@ -203,3 +210,28 @@ def test_load_env_file_missing_is_noop(tmp_path: Path) -> None:
env: dict[str, str] = {}
load_env_file(tmp_path / "nope.env", env)
assert env == {}
# --- route selection (A5 vendor fluidity) --------------------------------
def test_anthropic_models_take_the_native_route() -> None:
normalized, passthrough = object(), object()
for model in ("claude-haiku-4-5", "claude-opus-5", "anthropic/claude-sonnet-5"):
assert select_client(model, normalized, passthrough) is passthrough
def test_other_vendors_take_the_normalized_route() -> None:
# A13: provisionally accept LiteLLM's normalization for a vendor whose
# renderer adapter does not exist yet, rather than sending it request
# bodies shaped for someone else.
normalized, passthrough = object(), object()
for model in ("gpt-6-astra", "local-coder", "local-fast", "llama3.2"):
assert select_client(model, normalized, passthrough) is normalized
def test_native_adapter_detection_is_explicit() -> None:
assert has_native_adapter("claude-opus-5")
assert not has_native_adapter("gpt-6-astra")
# A model merely mentioning the vendor is not the vendor.
assert not has_native_adapter("my-claude-clone")