picoclaw/pkg
Larry Koo 204038ec60
feat: add extended thinking support for Anthropic models (#1076)
* feat: add extended thinking support for Anthropic models

Support configurable thinking levels (off/low/medium/high/xhigh/adaptive)
via `agents.defaults.thinking_level` config field.

- "adaptive": uses Anthropic's adaptive thinking API (Claude 4.6+)
- "low/medium/high/xhigh": uses budget_tokens (all thinking-capable models)
- "off": disables thinking (default)

API constraints handled:
- Temperature cleared when thinking is enabled
- budget_tokens clamped to max_tokens-1
- Thinking response blocks parsed into Reasoning field

Relates to #645, #966

* fix: address PR review feedback for thinking support

- Add ThinkingCapable interface for provider capability detection
- Warn when thinking_level is set but provider doesn't support it
- Warn when temperature is cleared due to thinking enabled
- Adjust budget values per Anthropic best practices (medium=16K, xhigh=64K)
- Add budget clamp warning and 80% threshold warning
- Add parseResponse thinking block tests
- Add thinking_level field to config.example.json

* refactor: move ThinkingLevel from AgentDefaults to ModelConfig

Thinking is a model-level capability, not a global agent property.
Per-model config avoids silent ignoring on non-Anthropic providers
and eliminates spurious warning logs in multi-provider setups.

Addresses PR #1076 review feedback from @yinwm.
2026-03-05 09:51:18 +08:00
..
agent feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
auth feat: add picoclaw-launcher with web UI for configuration and gateway management (#904) 2026-02-28 18:38:38 +08:00
bus chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
channels Merge pull request #853 from nayihz/feat_discord_proxy 2026-03-04 01:03:57 +08:00
config feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
constants refactor: replace bool map with set-style map for internal channels (#472) 2026-02-19 11:48:17 +01:00
cron style: fix gci import grouping in config, cron, and skills installer 2026-02-26 20:38:11 +08:00
devices refactor: cleanup dead code and turn on dead code detection in CI (#515) 2026-02-24 21:52:25 +08:00
fileutil refactor(pkg): move atomic file write to dedicated fileutil package 2026-02-24 23:57:13 +08:00
health chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
heartbeat enable dupl check 2026-03-01 18:17:32 +11:00
identity feat(identity): add unified user identity with canonical platform:id format 2026-02-23 06:56:48 +08:00
logger enable prealloc 2026-02-25 21:31:07 +11:00
mcp fix(mcp): resolve TOCTOU race condition and resource leak 2026-03-03 00:47:25 +08:00
media chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
memory fix(memory): fsync appended message for consistent durability 2026-03-04 19:21:34 +08:00
migrate enable dupl check 2026-03-01 18:17:32 +11:00
providers feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
routing chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
session feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
skills fix(agent): invalidate system prompt cache for global/builtin skills (#845) 2026-03-03 18:25:00 +08:00
state fix: error check on state (#864) 2026-03-02 11:59:26 +11:00
tools feat: execute LLM tool calls in parallel for faster response (#1070) 2026-03-04 17:17:28 +08:00
utils Merge remote-tracking branch 'origin/main' into feat_discord_proxy 2026-03-03 18:38:57 +08:00
voice Fix lint 2026-03-04 10:21:59 +00:00