Commit Graph
218 Commits
Author SHA1 Message Date
Re-bin fc0b38c304 fix(memory): improve warning message for empty/non-dict list arguments 2026-03-06 05:27:39 +00:00
nanobot-contributor 6fb4204ac6 fix(memory): handle list type tool call arguments
Some LLM providers return tool_calls[0].arguments as a list instead of
dict or str. Add handling to extract the first dict element from the list.

Fixes /new command warning: 'unexpected arguments type list'
2026-03-06 11:47:00 +08:00
Re-bin d32c6f946c fix(telegram): pin ptb>=22.6, fix double progress, clean up stale hatch config 2026-03-05 15:17:30 +00:00
Re-bin b070ae5b2b Merge remote-tracking branch 'origin/main' into pr-1522 2026-03-05 15:05:26 +00:00
Re-bin b71c1bdca7 fix(mcp): hoist sse/http imports, annotate auto-detection heuristic, restore field comments 2026-03-05 14:44:45 +00:00
Re-bin 2306d4c11c Merge remote-tracking branch 'origin/main' into pr-1488 2026-03-05 14:35:02 +00:00
Sergio Sánchez Vallés 33f59d8a37 fix(agent): separate reasoning and tool hints to respect channel config 2026-03-05 00:45:15 +01:00
Sergio Sánchez Vallés c27d2b1522 fix(agent): prevent tool hints from overwriting reasoning in streaming drafts 2026-03-05 00:33:27 +01:00
Xubin RenandGitHub 4e9f08cafa Merge PR #1511: fix: add size limit to ReadFileTool to prevent OOM
fix: add size limit to ReadFileTool to prevent OOM
2026-03-05 01:12:40 +08:00
Xubin RenandGitHub a156a8ee93 Merge PR #1507: fix: guard validate_params against non-dict input
fix: guard validate_params against non-dict input
2026-03-05 00:36:29 +08:00
Sergio Sánchez Vallés 61f658e045 add reasoning content to on progress message 2026-03-04 12:11:18 +01:00
Kiplangatkorir ce65f8c11b fix: add size limit to ReadFileTool to prevent OOM
ReadFileTool had no file size check — reading a multi-GB file would
load everything into memory and crash the process. Now:
- Rejects files over ~512KB at the byte level (fast stat check)
- Truncates at 128K chars with a notice if content is too long
- Guides the agent to use exec with head/tail/grep for large files

This matches the protection already in ExecTool (10KB) and
WebFetchTool (50KB).
2026-03-04 11:15:45 +03:00
Kiplangatkorir edaf7a244a fix: handle invalid ISO datetime in CronTool gracefully
datetime.fromisoformat(at) raises ValueError for malformed strings,
which propagated uncaught and crashed the tool execution. Now catches
ValueError and returns a user-friendly error message instead.
2026-03-04 10:55:17 +03:00
Kiplangatkorir df8d09f2b6 fix: guard validate_params against non-dict input
When the LLM returns malformed tool arguments (e.g. a list or string
instead of a dict), validate_params would crash with AttributeError
in _validate() when calling val.items(). Now returns a clear
validation error instead of crashing.
2026-03-04 10:53:30 +03:00
worenidewen 3e83425142 feat(mcp): add SSE transport support with auto-detection 2026-03-04 01:10:19 +08:00
Re-bin 30803afec0 fix(cron): isolate cron-execution guard with contextvars 2026-03-03 05:36:48 +00:00
Re-bin ec6430fa0c Merge branch 'main' into pr-1458 2026-03-03 05:18:28 +00:00
Re-bin 03b83fb79e fix(agent): skip empty multimodal user entries after runtime-context strip 2026-03-03 05:13:17 +00:00
Nikolas de Hor da8a4fc68c fix: prevent cron job execution from scheduling new jobs
When a cron job fires, the agent processes the scheduled message and
has access to the cron tool. If the original message resembles a
scheduling instruction (e.g. "remind me in 10 seconds"), the agent
would call cron.add again, creating an infinite feedback loop.

Add a cron-context flag to CronTool that blocks add operations during
cron job execution. The flag is set before process_direct() and cleared
in a finally block to ensure cleanup even on errors.

Fixes #1441
2026-03-03 01:02:33 -03:00
Nikolas de Hor ad99d5aaa0 fix: merge consecutive user messages into single message
Some LLM providers (Minimax, Dashscope) strictly reject consecutive
messages with the same role. build_messages() was emitting two separate
user messages back-to-back: the runtime context and the actual user
content.

Merge them into a single user message, handling both plain text and
multimodal (image) content. Update _save_turn() to strip the runtime
context prefix from the merged message when persisting to session
history.

Fixes #1414
Fixes #1344
2026-03-03 00:59:58 -03:00
Re-bin 15529c668e fix(web): sanitize proxy logs and polish search key hint 2026-03-01 12:53:18 +00:00
chengyongru 82be2ae1a5 feat(tool): add web search proxy 2026-03-01 16:51:54 +08:00
Jack LuandGitHub 3ee061b879 Merge branch 'main' into main 2026-03-01 13:35:24 +08:00
Re-bin 5ca386ebf5 fix: preserve reasoning_content and thinking_blocks in session history 2026-02-28 17:37:12 +00:00
Re-bin f9d72e2e74 feat: add reasoning_effort config to enable LLM thinking mode 2026-02-28 17:18:05 +00:00
Re-bin 8545d5790e refactor: streamline subagent prompt by reusing ContextBuilder and SkillsLoader 2026-02-28 16:32:50 +00:00
JK_Lu 977ca725f2 style: unify code formatting and import order
- Remove trailing whitespace and normalize blank lines
- Unify string quotes and line breaks for long lines
- Sort imports alphabetically across modules
2026-02-28 20:55:43 +08:00
Re-bin 8410f859f7 refactor: use WeakValueDictionary for consolidation locks — auto-cleanup, no manual pop 2026-02-28 08:26:55 +00:00
Re-bin b89b5a7e2c refactor: compress _extract_absolute_paths comments 2026-02-28 08:09:56 +00:00
Re-bin 05e0d271fc Merge remote-tracking branch 'origin/main' into pr-1286 2026-02-28 08:07:07 +00:00
Re-bin 89c0f4cae9 refactor: compress tool hint args handling to two lines 2026-02-28 08:06:20 +00:00
Re-bin 90eb90335a Merge remote-tracking branch 'origin/main' into pr-1294 2026-02-28 08:01:04 +00:00
Re-bin 0036116e0b fix: filter empty assistant messages in _save_turn instead of patching at send time 2026-02-28 07:35:07 +00:00
Nikolas de Hor 66063abb8c fix: prevent session poisoning from null/error LLM responses
When an LLM returns content: null on a plain assistant message (no
tool_calls), the null gets saved to session history and causes
permanent 400 errors on every subsequent request.

- Sanitize None content on plain assistant messages to "(empty)" in
  _sanitize_empty_content(), matching the existing empty-string handling
- Skip persisting error responses (finish_reason="error") to the
  message history in _run_agent_loop(), preventing poison loops

Closes #1303
2026-02-28 00:57:08 -03:00
Michael-lhh 11f1880c02 fix: handle list-type tool arguments in _tool_hint
Some models (e.g., Kimi K2.5 via OpenRouter) return tool call arguments
as a list instead of a dict. This caused an AttributeError when trying
to call .values() on the list.

The fix checks if arguments is a list and extracts the first element
before accessing .values().

Made-with: Cursor
2026-02-28 00:18:00 +08:00
fengxiaohu 7229d86bb3 fix(shell): parse full Windows absolute paths in workspace guard 2026-02-27 21:46:46 +08:00
aiguozhi123456 db4185c8b7 Add timestamp format hint for HISTORY.md grep searching 2026-02-27 11:11:42 +00:00
Re-bin bc558d0592 refactor: merge user-role branches in _save_turn 2026-02-27 10:07:22 +00:00
Re-bin 6bdb590028 Merge remote-tracking branch 'origin/main' into pr-1222 2026-02-27 09:57:45 +00:00
Re-bin b24df8afeb Merge remote-tracking branch 'origin/main' into pr-1228 2026-02-27 02:43:37 +00:00
Re-bin ec8dee802c refactor: simplify message tool suppress and inline consolidation locks 2026-02-27 02:39:38 +00:00
Re-bin 29e6709e26 refactor: simplify message tool suppress — bool check instead of target tracking 2026-02-27 02:27:18 +00:00
Re-bin ac1c40db91 Merge remote-tracking branch 'origin/main' into pr-1206 2026-02-27 02:17:04 +00:00
Yongfeng Huang 7a3788fee9 fix(web): use self.api_key instead of undefined api_key
Made-with: Cursor
2026-02-26 15:43:04 +08:00
Kim 286e67ddef style(agent): remove inline comment in runtime-context history filter 2026-02-26 14:21:44 +08:00
Kim 45ae410f05 fix(agent): do not persist runtime context metadata in session history 2026-02-26 14:12:37 +08:00
Re-bin 988a85d8de refactor: optimize matrix channel — optional deps, trim comments, simplify methods 2026-02-26 03:04:01 +00:00
Re-bin a1440cf4cb refactor: inline base64 image stripping in _save_turn 2026-02-26 02:43:45 +00:00
Re-bin 0a9bb1d8df Merge remote-tracking branch 'origin/main' into pr-1191 2026-02-26 02:39:53 +00:00
Re-bin 3902e31165 refactor: drop redundant tool_calls=None in final assistant message 2026-02-26 02:33:38 +00:00