Commit Graph

314 Commits

Author SHA1 Message Date
wylab
2ab51cb80b Add debug logging to Anthropic OAuth provider
All checks were successful
Build Nanobot OAuth / build (push) Successful in 1m59s
Logs thinking block presence, character count, and token usage
in API responses. Also logs request parameters including thinking
budget configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:59:32 +01:00
wylab
f71b3b3fea Preserve thinking block signatures for multi-turn conversations
All checks were successful
Build Nanobot OAuth / build (push) Successful in 1m59s
The Anthropic API returns a signature field in thinking blocks that
must be replayed in subsequent turns. Store full thinking blocks
(including signatures) instead of just the text content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:51:15 +01:00
wylab
9990e80d61 Replace hardcoded model aliases with dot-to-hyphen normalization
All checks were successful
Build Nanobot OAuth / build (push) Successful in 1m52s
Instead of maintaining a brittle alias dict mapping model names to
dated API IDs, simply normalize dots to hyphens. The Anthropic API
accepts both claude-sonnet-4-5 and dated variants like
claude-sonnet-4-5-20250929, so no alias table is needed. This lets
users write "claude-sonnet-4.5" or "claude-sonnet-4-5" interchangeably.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:46:10 +01:00
wylab
9a131cb0ed Add extended thinking support for Anthropic API
All checks were successful
Build Nanobot OAuth / build (push) Successful in 1m57s
Adds configurable thinking_budget in agent defaults. When >0, sends
the thinking parameter to the API with the specified token budget.
Handles API constraints: forces temperature=1, auto-bumps max_tokens
if it's below the thinking budget, preserves thinking blocks in
message history for multi-turn conversations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:38:58 +01:00
wylab
c5ab4098ca Fix tool_use message format for Anthropic API
All checks were successful
Build Nanobot OAuth / build (push) Successful in 1m59s
The agent loop produces messages in OpenAI format (role:tool, tool_calls
array) but the Anthropic API expects its own format (tool_use content
blocks in assistant messages, tool_result blocks in user messages).

This caused 400 errors whenever the bot tried to use tools like
web_search, because the follow-up message with tool results was
malformed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:29:55 +01:00
wylab
5a8f3f772c Support wildcard "*" in allowFrom channel config
All checks were successful
Build Nanobot OAuth / build (push) Successful in 1m57s
Allow "*" in the allowFrom list to explicitly permit all senders,
as an alternative to the empty-list-means-allow-all behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:11:13 +01:00
wylab
e1a98d68ff ci: add Docker build workflow and fix gateway CMD
All checks were successful
Build Nanobot OAuth / build (push) Successful in 2m45s
- Add .github/workflows/build.yml to auto-build and push to Gitea registry
- Change Dockerfile.oauth CMD from "status" to "gateway" for persistent container

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:25:32 +01:00
wylab
92065dbb74 Merge remote-tracking branch 'origin/main' 2026-02-13 14:16:24 +01:00
wylab
55ad41265f feat(oauth): add model alias resolution and Dockerfile.oauth
Add MODEL_ALIASES dict to resolve short model names (e.g. claude-sonnet-4)
to dated API IDs (e.g. claude-sonnet-4-20250514). Includes claude-opus-4-6.

Add Dockerfile.oauth overlay extending birdxs/nanobot:latest for fast builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:12:00 +01:00
wylab
6d0d995b1b feat(config): integrate OAuth store with config loading
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:19:51 +01:00
wylab
f444e94ff7 feat(cli): add OAuth login/status/logout commands
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:16:23 +01:00
wylab
5f9af317c4 feat(config): add OAuth credential storage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:10:17 +01:00
wylab
4b3bc89d06 refactor(agent): use provider factory for OAuth support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:07:38 +01:00
wylab
3323b9d909 feat(providers): add create_provider factory with OAuth detection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:05:51 +01:00
wylab
96a7abcda4 feat(registry): add OAuth provider detection logic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:03:37 +01:00
wylab
534a8344bd feat(providers): add AnthropicOAuthProvider with Bearer auth
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:58:36 +01:00
wylab
7b710116a4 feat(providers): add OAuth token detection and header utilities
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:57:21 +01:00
wylab
fc9545c36a feat(config): add OAuthCredentials model for subscription auth
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:56:48 +01:00
Xubin Ren
3f59a8e234 Merge pull request #593 from C-Li/feishu_fix
Optimize the display of Markdown titles in Lark card information.
2026-02-13 17:02:27 +08:00
Ahwei
ccf9a6c146 fix(feishu): convert markdown headings to div elements in card messages
Markdown heading syntax (#) is not properly rendered in Feishu interactive
cards. Convert headings to div elements with lark_md format (bold text) for
proper display.

- Add _HEADING_RE regex to match markdown headings (h1-h6)
- Add _split_headings() method to parse and convert headings to div elements
- Update _build_card_elements() to process headings before markdown content
2026-02-13 15:31:30 +08:00
Re-bin
43e2f2605b docs: update v0.1.3.post7 news 2026-02-13 06:26:12 +00:00
Re-bin
202f0a3144 bump: 0.1.3.post7 2026-02-13 06:17:22 +00:00
Xubin Ren
92191ad2a9 Merge pull request #587 from HKUDS/fix/whatsapp-bridge-security
fix(security): bind WhatsApp bridge to localhost + optional token auth
2026-02-13 13:41:27 +08:00
Re-bin
fd7e477b18 fix(security): bind WhatsApp bridge to localhost + optional token auth 2026-02-13 05:37:56 +00:00
Xubin Ren
5c398c5faf Merge pull request #567 from 3927o/feature/better-fallback-message
Add max iterations info to fallback message
2026-02-13 12:55:14 +08:00
Ahwei
e1c359a198 chore: add venv/ to .gitignore 2026-02-13 12:29:45 +08:00
Re-bin
32c9431191 fix: align CLI session_id default to "cli:direct" for backward compatibility 2026-02-13 04:13:16 +00:00
Re-bin
64feec6656 Merge PR #569: feat: add /new command with memory consolidation 2026-02-13 03:31:26 +00:00
Re-bin
903caaa642 feat: unified slash commands (/new, /help) across all channels 2026-02-13 03:30:21 +00:00
我惹你的温
0fc4f109bf Merge branch 'HKUDS:main' into feat/add_new_command 2026-02-13 01:35:07 +08:00
worenidewen
24a90af6d3 feat: add /new command 2026-02-13 01:24:48 +08:00
3927o
dbbbecb25c feat: improve fallback message when max iterations reached 2026-02-12 23:57:34 +08:00
Re-bin
890d7cf853 docs: news about the redesigned memory system 2026-02-12 15:28:07 +00:00
Xubin Ren
dd4c06bea5 Merge pull request #565 for redesign memory system
feat: redesign memory system — two-layer architecture with grep-based retrieval
2026-02-12 23:17:26 +08:00
Re-bin
94c21fc235 feat: redesign memory system — two-layer architecture with grep-based retrieval 2026-02-12 15:02:52 +00:00
Xubin Ren
a05e58cf79 Merge pull request #543 to add edit_file tool and time context to sub agent
fix(subagent): add edit_file tool and time context to sub agent
2026-02-12 15:53:10 +08:00
Re-bin
de3324807f fix(subagent): add edit_file tool and time context to sub agent 2026-02-12 07:49:36 +00:00
Re-bin
cc427261d9 Merge PR #533: feat(cron): add 'at' parameter for one-time scheduled tasks 2026-02-12 06:50:53 +00:00
Re-bin
7087947e0e feat(cron): add one-time 'at' schedule to skill docs and show timezone in system prompt 2026-02-12 06:50:44 +00:00
Re-bin
73935da95f Merge branch 'main' into pr-533 2026-02-12 06:36:49 +00:00
Xubin Ren
da93729d41 Merge pull request #538 from Re-bin/main
feat: add interleaved chain-of-thought to agent loop
2026-02-12 14:28:58 +08:00
Re-bin
d335494212 feat: add interleaved chain-of-thought to agent loop 2026-02-12 06:25:25 +00:00
3927o
a66fa650a1 feat(cron): add 'at' parameter for one-time scheduled tasks 2026-02-12 11:06:57 +08:00
Re-bin
b429bf9381 fix: improve long-running stability for various channels 2026-02-12 01:20:57 +00:00
Re-bin
dd63337a83 Merge PR #516: fix Pydantic V2 deprecation warning 2026-02-11 14:55:17 +00:00
Re-bin
cdc37e2f5e Merge branch 'main' into pr-516 2026-02-11 14:54:37 +00:00
Re-bin
554ba81473 docs: update agent community tips 2026-02-11 14:39:20 +00:00
Sergio Sánchez Vallés
cbab72ab72 fix: pydantic deprecation configdict 2026-02-11 13:01:29 +01:00
Re-bin
c8831a1e1e Merge PR #488: refactor CLI input with prompt_toolkit 2026-02-11 09:38:11 +00:00
Re-bin
9d304d8a41 refactor: remove Panel border from CLI output for cleaner copy-paste 2026-02-11 09:37:49 +00:00