Commit Graph

887 Commits

Author SHA1 Message Date
andienguyen-ecoligo
5c9cb3a208 fix(security): prevent path traversal bypass via startswith check
`startswith` string comparison allows bypassing directory restrictions.
For example, `/home/user/workspace_evil` passes the check against
`/home/user/workspace` because the string starts with the allowed path.

Replace with `Path.relative_to()` which correctly validates that the
resolved path is actually inside the allowed directory tree.

Fixes #888
2026-02-21 12:34:14 -05:00
andienguyen-ecoligo
de63c31d43 fix(providers): normalize empty reasoning_content to None at provider level
PR #947 fixed the consumer side (context.py) but the root cause is at
the provider level — getattr returns "" (empty string) instead of None
when reasoning_content is empty. This causes DeepSeek API to reject the
request with "Missing reasoning_content field" error.

`"" or None` evaluates to None, preventing empty strings from
propagating downstream.

Fixes #946
2026-02-21 12:30:57 -05:00
Re-bin
0040c62b74 Merge PR #939: Remove redundant tools description from system prompt 2026-02-21 17:07:02 +00:00
Re-bin
13d768cd93 Merge branch 'main' into pr-939 2026-02-21 17:06:05 +00:00
Xubin Ren
6a9152f0c4 Merge PR #947 to Fix 'Missing reasoning_content field' error for deepseek provider.
fix(context): Fix 'Missing `reasoning_content` field' error for deepseek provider.
2026-02-22 00:47:58 +08:00
Xubin Ren
9b4273f6a4 Merge PR #951 to change VolcEngine litellm prefix from openai to volcengine
fix: change VolcEngine litellm prefix from openai to volcengine
2026-02-22 00:45:49 +08:00
init-new-world
deae84482d fix: change VolcEngine litellm prefix from openai to volcengine 2026-02-22 00:42:41 +08:00
muskliu
6b7d7e2eb8 fix(mcp): add 30s timeout to MCP tool calls to prevent agent hangs 2026-02-22 00:39:53 +08:00
Re-bin
edc671a8a3 docs: update format of news section 2026-02-21 16:39:26 +00:00
muskliu
83ccdf6186 fix(provider): filter empty text content blocks causing API 400
When MCP tools return empty content, messages may contain empty-string
text blocks. OpenAI-compatible providers reject these with HTTP 400.

Changes:
- Add _prevent_empty_text_blocks() to filter empty text items from
  content lists and handle empty string content
- For assistant messages with tool_calls, set content to None (valid)
- For other messages, replace with '(empty)' placeholder
- Only copy message dict when modification is needed (zero-copy path
  for normal messages)

Co-Authored-By: nanobot <noreply@anthropic.com>
2026-02-22 00:20:00 +08:00
nanobot-bot
01c835aac2 fix(context): Fix 'Missing reasoning_content field' error for deepseek provider. 2026-02-21 23:11:30 +08:00
Re-bin
88ca2e0530 docs: update v.0.1.4.post1 release news 2026-02-21 13:20:55 +00:00
Re-bin
af71ccf051 release: v0.1.4.post1 2026-02-21 13:05:14 +00:00
vincentchen
b3acd19c7b Remove redundant tools description (because tools information is passed in with each self.provider.chat() call) 2026-02-21 20:28:42 +08:00
Re-bin
9c61e1389c docs: update nanobot news 2026-02-21 08:33:31 +00:00
Re-bin
ec4bdb651f docs: update nanobot news 2026-02-21 08:33:02 +00:00
Re-bin
f89f8a972c Merge pull request #926: fix(agent): skip empty fallback outbound for non-cli channels 2026-02-21 08:27:54 +00:00
Re-bin
0b30f514b4 style(loop): compact empty outbound message construction 2026-02-21 08:27:49 +00:00
Re-bin
012a5e78e5 Merge branch 'main' into pr-926 2026-02-21 08:21:17 +00:00
Xubin Ren
4dca2872bf Merge pull request #930 to slim down agent loop
refactor: extract memory consolidation to MemoryStore, slim down agent loop
2026-02-21 16:19:08 +08:00
Re-bin
ab026c5131 refactor: extract memory consolidation to MemoryStore, slim down AgentLoop 2026-02-21 08:14:46 +00:00
Re-bin
668dd6e2f5 Merge pull request #866: refactor(memory): use tool call instead of JSON text for memory consolidation 2026-02-21 08:02:03 +00:00
Re-bin
8c15454379 Merge branch 'main' into pr-866 2026-02-21 07:46:25 +00:00
Xubin Ren
6076f98527 Merge pull request #928 to remove interim text retry, use system prompt constraint instead
refactor(loop): remove interim text retry, use system prompt constraint instead
2026-02-21 15:35:35 +08:00
Re-bin
aeb07d3450 refactor(loop): remove interim text retry, use system prompt constraint instead 2026-02-21 07:32:58 +00:00
Re-bin
a0820eceee Merge pull request #887: fix(loop): preserve interim content as fallback when retry produces empty response 2026-02-21 07:17:35 +00:00
Re-bin
8bb849470b Merge branch 'main' into pr-887 2026-02-21 07:12:58 +00:00
Alexander Minges
c4bee640b8 fix(agent): skip empty fallback outbound for non-cli channels 2026-02-21 07:51:28 +01:00
Re-bin
900604e9ca Merge pull request #921: fix(tools): provide diff hint when edit_file old_text not found 2026-02-21 06:39:14 +00:00
Re-bin
4f5cb7d1e4 style(filesystem): simplify best-match loop 2026-02-21 06:39:04 +00:00
Re-bin
09a45f8993 Merge pull request #921: fix(tools): provide diff hint when edit_file old_text not found 2026-02-21 06:35:14 +00:00
Re-bin
e0edb904bd style(filesystem): move difflib import to top level 2026-02-21 06:35:10 +00:00
Re-bin
7bc77c1b41 Merge branch 'main' into pr-921 2026-02-21 06:32:57 +00:00
Re-bin
6f266f1a8a Merge pull request #922: feat(feishu): multimedia download and share card parsing 2026-02-21 06:30:31 +00:00
Re-bin
8125d9b6bc fix(feishu): fix double recursion, English placeholders, top-level Path import 2026-02-21 06:30:26 +00:00
coldxiangyu
b9c3f8a5a3 feat(feishu): add share card and interactive message parsing
- Add content extraction for share cards (chat, user, calendar event)
- Add recursive parsing for interactive card elements
- Fix image download API to use GetMessageResourceRequest with message_id
- Handle BytesIO response from message resource API

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-02-21 14:08:25 +08:00
coldxiangyu
98ef57e370 feat(feishu): add multimedia download support for images, audio and files
Add download functionality for multimedia messages in Feishu channel,
enabling agents to process images, audio recordings, and file attachments
sent through Feishu.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:56:57 +08:00
themavik
33396a522a fix(tools): provide detailed error messages in edit_file when old_text not found
Uses difflib to find the best match and shows a helpful diff,
making it easier to debug edit_file failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-20 23:52:40 -05:00
TANISH RAJPUT
2502f68fd8 Merge pull request #6 from Athemis/feat/matrix-improvements
feat(matrix): E2E, typing, markdown/HTML, group policy, inbound+outbound media, thread replies
2026-02-20 23:01:56 +05:30
Alexander Minges
fcece3ec62 fix(matrix): match fork/main formatting exactly 2026-02-20 18:17:27 +01:00
Alexander Minges
13561772ad fix(matrix): align with fork/main (docstrings, type annotations, formatting) 2026-02-20 18:15:32 +01:00
Alexander Minges
dd61a9143a fix: remove accidental whitespace-only formatting changes from schema.py 2026-02-20 18:11:29 +01:00
Alexander Minges
52d086d46a revert: restore context.py and manager.py to tanishra baseline (out of scope) 2026-02-20 18:08:04 +01:00
Alexander Minges
e8a4671565 test: remove message tool media test (message.py changes out of scope) 2026-02-20 18:06:13 +01:00
Alexander Minges
36d650e475 revert: restore message.py to tanishra baseline (out of scope) 2026-02-20 18:05:00 +01:00
Alexander Minges
334078e242 fix(message): apply media path filtering and drop attachment count from return value
Conflict resolution correction: HEAD's message.py retained raw media list and
attachment count in return string, but tests from 3de30bb require stripped/filtered
media_paths and a plain return message. Aligns HEAD behavior with cherry-picked tests.
2026-02-20 18:04:11 +01:00
Alexander Minges
705d5738e3 feat(matrix): reply in threads with fallback relations
Propagate Matrix thread metadata from inbound events and attach
m.relates_to
(rel_type=m.thread, m.in_reply_to, is_falling_back=true) to outbound
messages
including attachments. Add tests for thread metadata and thread replies.
2026-02-20 18:03:26 +01:00
Alexander Minges
6a40665753 feat(matrix): support outbound attachments via message tool
- extend message tool with optional media paths for channel delivery

- switch Matrix uploads to stream providers and handle encrypted-room payloads

- add/expand tests for message tool media forwarding and Matrix upload edge cases
2026-02-20 18:02:40 +01:00
Alexander Minges
d4d87bb4e5 fix(matrix): block outbound media when maxMediaBytes is zero 2026-02-20 18:02:15 +01:00
Alexander Minges
a28ae51ce9 fix(matrix): handle matrix-nio upload tuple response 2026-02-20 18:02:14 +01:00