fix(agents): only models that send progress updates read thinking as progress

This commit is contained in:
hh committed 2026-09-22 20:53:05 +02:00
1 parent 120985deab
commit 1d1285de46
2 files changed
+28 -6

No files matched your search

+7 -3
View File
@@ -17,7 +17,10 @@ from beaver_gateway.agents.policy import PolicyRule # noqa: TC001
from beaver_gateway.agents.prompts import PromptSource # noqa: TC001
from beaver_gateway.conversations.kinds import KINDS, Kind
__all__ = ["ClaudeAgent", "ClaudeOptions", "Prompts", "SkillSets"]
__all__ = ["PROGRESS_MODELS", "ClaudeAgent", "ClaudeOptions", "Prompts", "SkillSets"]
PROGRESS_MODELS = frozenset({"claude-opus-5-5", "claude-fable-5-1"})
"""Models whose non-empty thinking is the text written between tool calls."""
class ClaudeOptions(BaseModel):
@@ -123,8 +126,9 @@ class ClaudeAgent(BaseAgent):
@property
def thinking_is_progress(self) -> bool:
"""Reasoning arrives empty unless ``display`` is ``summarized``."""
return (self.options.thinking or {}).get("display") != "summarized"
"""A progress model, unless ``display: summarized`` brings reasoning."""
summarized = (self.options.thinking or {}).get("display") == "summarized"
return self.model in PROGRESS_MODELS and not summarized
def prompt_for(self, kind: Kind) -> tuple[PromptSource, ...] | None:
return self.prompts.for_kind(kind)