Skip to content

The agent that grows with you

fix: exclude reasoning_details from preflight token estimate

JonthanaHanh530503a6a565
diff --git a/agent/model_metadata.py b/agent/model_metadata.py
index 0645c35a6c0..e47a10eb07c 100644
--- a/agent/model_metadata.py
+++ b/agent/model_metadata.py
@@ -3011,7 +3011,7 @@ def _wire_message_shadow(msg: Dict[str, Any]) -> Dict[str, Any]:
)
shadow: Dict[str, Any] = {}
for k, v in msg.items():
- if k == "_anthropic_content_blocks":
+ if k in ("_anthropic_content_blocks", "reasoning_details"):
continue
if k == "api_content":
# Always popped before the request is built; only counted when it