Skip to content

Your lightweight open-source personal agent.

Merge origin/main into fix/structured-retry-classification-main

Xubin Renb575aed20ef6
diff --cc nanobot/providers/base.py
index 0eb93cc5e,118eb80ca..da229dcc3
--- a/nanobot/providers/base.py
+++ b/nanobot/providers/base.py
@@@ -54,14 -54,7 +54,14 @@@ class LLMResponse
retry_after: float | None = None # Provider supplied retry wait in seconds.
reasoning_content: str | None = None # Kimi, DeepSeek-R1, MiMo etc.
thinking_blocks: list[dict] | None = None # Anthropic extended thinking
+ # Structured error metadata used by retry policy when finish_reason == "error".
+ error_status_code: int | None = None
+ error_kind: str | None = None # e.g. "timeout", "connection"
+ error_type: str | None = None # Provider/type semantic, e.g. insufficient_quota.
+ error_code: str | None = None # Provider/code semantic, e.g. rate_limit_exceeded.
+ error_retry_after_s: float | None = None
+ error_should_retry: bool | None = None
-
+
@property
def has_tool_calls(self) -> bool:
"""Check if response contains tool calls."""
diff --cc nanobot/providers/openai_compat_provider.py
index cb25e6f8c,950907212..cb662556a
--- a/nanobot/providers/openai_compat_provider.py
+++ b/nanobot/providers/openai_compat_provider.py
@@@ -3,8 -3,8 +3,9 @@@
from __future__ import annotations
import asyncio
+import email.utils
import hashlib
+ import importlib.util
import os
import secrets
import string