feat: add reasoning effort configuration for agent

- Introduced a new configuration option for reasoning effort in the CLI, allowing users to specify the level of reasoning the agent should perform before responding.
- Updated the CLI and agent initialization to incorporate the reasoning configuration, enhancing the agent's responsiveness and adaptability.
- Implemented logic to load reasoning effort from environment variables and configuration files, providing flexibility in agent behavior.
- Enhanced the documentation in the example configuration file to clarify the new reasoning effort options available.
This commit is contained in:
teknium1 2026-02-24 03:30:19 -08:00
parent a30b2f34eb
commit e049441d93
4 changed files with 71 additions and 5 deletions

View file

@ -1152,7 +1152,11 @@ class AIAgent:
if provider_preferences:
extra_body["provider"] = provider_preferences
if "openrouter" in self.base_url.lower():
_supports_reasoning = (
"openrouter" in self.base_url.lower()
or "nousresearch" in self.base_url.lower()
)
if _supports_reasoning:
if self.reasoning_config is not None:
extra_body["reasoning"] = self.reasoning_config
else:
@ -1574,7 +1578,11 @@ class AIAgent:
api_messages.insert(sys_offset + idx, pfm.copy())
summary_extra_body = {}
if "openrouter" in self.base_url.lower():
_supports_reasoning = (
"openrouter" in self.base_url.lower()
or "nousresearch" in self.base_url.lower()
)
if _supports_reasoning:
if self.reasoning_config is not None:
summary_extra_body["reasoning"] = self.reasoning_config
else: