1576 Commits

Author SHA1 Message Date
chengyongru
f824a629a8 feat(memory): add git-backed version control for dream memory files
- Add GitStore class wrapping dulwich for memory file versioning
- Auto-commit memory changes during Dream consolidation
- Add /dream-log and /dream-restore commands for history browsing
- Pass tracked_files as constructor param, generate .gitignore dynamically
2026-04-03 00:32:54 +08:00
chengyongru
a9e01bf838 fix(memory): extract successful solutions in consolidate prompt
Add "Solutions" category to consolidate prompt so trial-and-error
workflows that reach a working approach are captured in history for
Dream to persist. Remove overly broad "debug steps" skip rule that
discarded these valuable findings.
2026-04-02 23:02:42 +08:00
chengyongru
b9616674f0 feat(agent): two-stage memory system with Dream consolidation
Replace single-stage MemoryConsolidator with a two-stage architecture:

- Consolidator: lightweight token-budget triggered summarization,
  appends to HISTORY.md with cursor-based tracking
- Dream: cron-scheduled two-phase processor that analyzes HISTORY.md
  and updates SOUL.md, USER.md, MEMORY.md via AgentRunner with
  edit_file tools for surgical, fault-tolerant updates

New files: MemoryStore (pure file I/O), Dream class, DreamConfig,
/dream and /dream-log commands. 89 tests covering all components.
2026-04-02 22:42:25 +08:00
Xubin Ren
7113ad34f4
Merge PR #2733: harden agent runtime for long-running tasks 2026-04-02 22:34:00 +08:00
Xubin Ren
e4b335ce81 refactor: extract runtime response guards into utils runtime module 2026-04-02 13:54:40 +00:00
Xubin Ren
714a4c7bb6 fix(runtime): address review feedback on retry and cleanup 2026-04-02 10:57:12 +00:00
Xubin Ren
eefd7e60f2 Merge remote-tracking branch 'origin/main' into feat/runtime-hardening 2026-04-02 10:40:49 +00:00
Xubin Ren
3558fe4933 fix(cli): honor custom config path in channel commands 2026-04-02 18:37:46 +08:00
masterlyj
11ba733ab6 fix(test): update load_config mock to accept config_path parameter 2026-04-02 18:37:46 +08:00
masterlyj
7332d133a7 feat(cli): add --config option to channels login and status commands
Allows users to specify custom config file paths when managing channels.

Usage:
  nanobot channels login weixin --config .nanobot-feishu/config.json
    nanobot channels status -c .nanobot-qq/config.json

    - Added optional --config/-c parameter to both commands
    - Defaults to ~/.nanobot/config.json when not specified
    - Maintains backward compatibility
2026-04-02 18:37:46 +08:00
haosenwang1018
7a6416bcb2 test(matrix): skip cleanly when optional deps are missing 2026-04-02 18:17:00 +08:00
Xubin Ren
cc33057985 refactor(providers): rename openai responses helpers 2026-04-02 13:43:34 +08:00
Xubin Ren
ded0967c18 fix(providers): sanitize azure responses input messages 2026-04-02 13:43:34 +08:00
Kunal Karmakar
61d7411238 Fix failing test 2026-04-02 13:43:34 +08:00
Kunal Karmakar
76226274bf Failing test 2026-04-02 13:43:34 +08:00
Kunal Karmakar
e206cffd7a Add tests and handle json 2026-04-02 13:43:34 +08:00
Kunal Karmakar
ac2ee58791 Add tests and logs 2026-04-02 13:43:34 +08:00
Kunal Karmakar
7c44aa92ca Fill up gaps 2026-04-02 13:43:34 +08:00
Kunal Karmakar
8c0607e079 Use SDK for stream 2026-04-02 13:43:34 +08:00
Kunal Karmakar
0417c3f03b Use OpenAI responses API 2026-04-02 13:43:34 +08:00
Xubin Ren
9ba413c82e test(cron): cover deliver flag on scheduled jobs 2026-04-02 13:03:46 +08:00
lucario
15faa3b115 fix(cron): fix extra indent for properties closing brace and required field 2026-04-02 13:03:46 +08:00
lucario
35b51c0694 fix(cron): fix extra indent for deliver param 2026-04-02 13:03:46 +08:00
lucario
5f2157baeb fix(cron): move deliver param before job_id in parameters schema 2026-04-02 13:03:46 +08:00
archlinux
2e3cb5b20e fix default value True 2026-04-02 13:03:46 +08:00
lucario
73e80b199a feat(cron): add deliver parameter to support silent jobs, default true for backward compatibility 2026-04-02 13:03:46 +08:00
Xubin Ren
a3e4c77fff fix(providers): normalize anthropic cached token usage 2026-04-02 12:51:45 +08:00
chengyongru
da08dee144 feat(provider): show cache hit rate in /status (#2645) 2026-04-02 12:51:45 +08:00
Tejas1Koli
42fa8fa933 fix(providers): only apply cache_control for Claude models on OpenRouter 2026-04-02 04:04:18 +08:00
Tejas1Koli
05fe73947f fix(providers): only apply cache_control for Claude models on OpenRouter 2026-04-02 04:04:18 +08:00
Xubin Ren
485c75e065 test(exec): verify windows drive-root workspace guard 2026-04-02 04:00:03 +08:00
zhangxiaoyu.york
bc2e474079 Fix ExecTool to block root directory paths when restrict_to_workspace is enabled 2026-04-02 04:00:03 +08:00
WormW
ddc9fc4fd2 fix: also check channel match before inheriting default message_id
Different channels could theoretically share the same chat_id.
Check both channel and chat_id to avoid cross-channel reply issues.

Co-authored-by: layla <111667698+04cb@users.noreply.github.com>
2026-04-02 03:46:54 +08:00
WormW
6973bfff24 fix(agent): message tool incorrectly replies to original chat when targeting different chat_id
When the message tool is used to send a message to a different chat_id

than the current conversation, it was incorrectly including the default

message_id from the original context. This caused channels like Feishu

to send the message as a reply to the original chat instead of creating

a new message in the target chat.

Changes:

- Only use default message_id when chat_id matches the default context

- When targeting a different chat, set message_id to None to avoid

  unintended reply behavior
2026-04-02 03:46:54 +08:00
Xubin Ren
7e719f41cc test(providers): cover github copilot lazy export 2026-04-02 03:46:40 +08:00
Xubin Ren
2ec68582eb fix(sdk): route github copilot through oauth provider 2026-04-02 03:46:40 +08:00
RongLei
c5f0997381 fix: refresh copilot token before requests
Address PR review feedback by avoiding an async method reference as the OpenAI client api_key.

Initialize the client with a placeholder key, refresh the Copilot token before each chat/chat_stream call, and update the runtime client api_key before dispatch.

Add a regression test that verifies the client api_key is refreshed to a real string before chat requests.

Generated with GitHub Copilot, GPT-5.4.
2026-04-02 03:46:40 +08:00
RongLei
a37bc26ed3 fix: restore GitHub Copilot auth flow
Implement the real GitHub device flow and Copilot token exchange for the GitHub Copilot provider.

Also route github-copilot models through a dedicated backend and strip the provider prefix before API requests.

Add focused regression coverage for provider wiring and model normalization.

Generated with GitHub Copilot, GPT-5.4.
2026-04-02 03:46:40 +08:00
Xubin Ren
fbedf7ad77 feat: harden agent runtime for long-running tasks 2026-04-01 19:12:49 +00:00
Xubin Ren
63d646f731
Merge PR #2676: fix(test): fix flaky test_fixed_session_requests_are_serialized
fix(test): fix flaky test_fixed_session_requests_are_serialized
2026-03-31 22:08:47 +08:00
chengyongru
69624779dc fix(test): fix flaky test_fixed_session_requests_are_serialized
Remove the fragile barrier-based synchronization that could cause
deadlock when the second request is scheduled first. Instead, rely
on the session lock for serialization and handle either execution
order in assertions.
2026-03-31 21:50:33 +08:00
Xubin Ren
a4dfbdf996
Merge PR #2614: feat(weixin): weixin multimodal capabilities and align with version 2.1.1
feat(weixin): weixin multimodal capabilities and align with version 2.1.1
2026-03-31 19:43:02 +08:00
Xubin Ren
949a10f536 fix(weixin): reset QR poll host after refresh 2026-03-31 19:40:13 +08:00
xcosmosbox
2a6c616080 fix(WeiXin): fix full_url download error 2026-03-31 19:40:13 +08:00
xcosmosbox
1bcd5f9742 fix(weixin): fix test file version reader 2026-03-31 19:40:13 +08:00
xcosmosbox
26947db479 feat(weixin): add voice message, typing keepalive, getConfig cache, and QR polling resilience 2026-03-31 19:40:13 +08:00
xcosmosbox
0514233217 fix(weixin): align full_url AES key handling and quoted media fallback logic with reference
1. Fix full_url path for non-image media to require AES key and skip download when missing,
   instead of persisting encrypted bytes as valid media.
2. Restrict quoted media fallback trigger to only when no top-level media item exists,
   not when top-level media download/decryption fails.
2026-03-31 19:40:13 +08:00
xcosmosbox
345c393e53 feat(weixin): implement getConfig and sendTyping 2026-03-31 19:40:13 +08:00
xcosmosbox
faf2b07923 feat(weixin): add fallback logic for referenced media download 2026-03-31 19:40:13 +08:00
xcosmosbox
efd42cc236 feat(weixin): implement QR redirect handling 2026-03-31 19:40:13 +08:00