A model's safety-filter refusal is an error that says so, not an empty reply
Opus's provider filter declined one of nisse-review's ask_expert questions (which repositories a Gitea token can list) every time. It came back as a 200 with no text, and the expert reported "unparseable reply: empty reply". Both LLM clients now raise ModelRefused for finish_reason content_filter (chat route) and stop_reason refusal (passthrough). The expert's handback says what happened and what to do instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
098d42ff2c
commit
9d2992c20a
4 files changed
+96
-2
No files matched your search
@@ -32,7 +32,7 @@ from nisse_core.log.canonical import (
|
||||
StoredEvent,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.models.llm import LLMClient, LLMError, RoleMap
|
||||
from nisse_core.models.llm import LLMClient, LLMError, ModelRefused, RoleMap
|
||||
from nisse_core.state.store import Transcript
|
||||
|
||||
EXPERT_ROLE = "expert"
|
||||
@@ -168,6 +168,9 @@ class ExpertDesk:
|
||||
model=model,
|
||||
system=system,
|
||||
)
|
||||
except ModelRefused as exc:
|
||||
# Not retried: the same question is declined again.
|
||||
return None, f"{exc}. Ask it differently, or work from the repository"
|
||||
except LLMError as exc:
|
||||
return None, str(exc)
|
||||
text = "\n".join(
|
||||
|
||||
Reference in new issue
Block a user