Commit Graph
100 Commits
Author SHA1 Message Date
Xubin RenandXubin Ren f4983329c6 fix(docker): preserve both github ssh rewrite rules for npm install 2026-04-04 22:33:46 +08:00
Xubin Ren 1c1eee523d fix: secure whatsapp bridge with automatic local auth token 2026-04-04 14:16:46 +00:00
Xubin Ren 77a88446fb Merge remote-tracking branch 'origin/main' into pr-2722 2026-04-04 13:51:59 +00:00
Xubin RenandXubin Ren 17d9d74ccc fix(provider): omit temperature for GPT-5 models 2026-04-04 20:18:22 +08:00
Xubin RenandXubin Ren 11c84f21a6 test(session): preserve reasoning_content in session history 2026-04-04 20:08:44 +08:00
Xubin RenandXubin Ren 05fe7d4fb1 fix(tools): isolate decorated tool schemas and add regression tests 2026-04-04 19:58:44 +08:00
Xubin RenandXubin Ren 9ef5b1e145 fix: reset ssrf whitelist on config reload and document config refresh 2026-04-04 19:43:18 +08:00
Xubin Ren c3b4ebae53 refactor(agent): move internal prompts into packaged templates 2026-04-04 11:09:37 +00:00
Xubin Ren 7b852506ff fix(telegram): register Dream menu commands with Telegram-safe aliases
Use dream_log and dream_restore in Telegram's bot command menu so command registration succeeds, while still accepting the original dream-log and dream-restore forms in chat. Keep the internal command routing unchanged and add coverage for the alias normalization path.
2026-04-04 10:31:26 +00:00
Xubin Ren 549e5ea8e2 fix(telegram): shorten polling network errors 2026-04-04 10:26:58 +00:00
Xubin Ren 04419326ad fix(memory): migrate legacy HISTORY.md even when history.jsonl is empty 2026-04-04 10:11:53 +00:00
Xubin Ren 0a3a60a7a4 refactor(memory): simplify Dream config naming and rename gitstore module 2026-04-04 10:01:45 +00:00
Xubin Ren a166fe8fc2 docs: clarify memory design and source-vs-release features 2026-04-04 09:34:37 +00:00
Xubin Ren 408a61b0e1 feat(memory): protect Dream cron and polish migration UX 2026-04-04 09:01:42 +00:00
Xubin Ren 6e896249c8 feat(memory): harden legacy history migration and Dream UX 2026-04-04 08:41:46 +00:00
Xubin Ren 7e0c196797 fix(memory): repair Dream follow-up paths and move GitStore to utils
Made-with: Cursor
2026-04-04 04:49:42 +00:00
Xubin Ren 30ea048f19 Merge remote-tracking branch 'origin/main' into pr-2717-review 2026-04-04 04:42:52 +00:00
Xubin RenandXubin Ren 7229a81594 fix(providers): disable Azure SDK retries by default
Made-with: Cursor
2026-04-04 12:36:45 +08:00
Xubin Ren 91a9b7db24 Merge origin/main into fix/retry-after-robust
Made-with: Cursor
2026-04-03 19:07:30 +00:00
Xubin RenandXubin Ren 9840270f7f test(tools): cover media dir access under workspace restriction
Made-with: Cursor
2026-04-04 03:03:58 +08:00
Xubin Ren ca3b918cf0 docs: clarify retry behavior and web search defaults 2026-04-03 18:57:44 +00:00
Xubin Ren 400f8eb38e docs: update web search configuration information 2026-04-03 18:44:46 +00:00
Xubin Ren 652377bee9 Merge origin/main into feat/web-disable-flag
Made-with: Cursor
2026-04-03 18:41:43 +00:00
Xubin Ren f409337fcf Merge remote-tracking branch 'origin/main' into pr-2646 2026-04-03 17:53:52 +00:00
Xubin Ren cb84f2b908 docs: update nanobot news section 2026-04-03 16:18:36 +00:00
Xubin Ren 3c3a72ef82 update .gitignore 2026-04-03 16:02:23 +00: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 RenandXubin Ren 3558fe4933 fix(cli): honor custom config path in channel commands 2026-04-02 18:37:46 +08:00
Xubin RenandXubin Ren cc33057985 refactor(providers): rename openai responses helpers 2026-04-02 13:43:34 +08:00
Xubin RenandXubin Ren ded0967c18 fix(providers): sanitize azure responses input messages 2026-04-02 13:43:34 +08:00
Xubin RenandXubin Ren 9ba413c82e test(cron): cover deliver flag on scheduled jobs 2026-04-02 13:03:46 +08:00
Xubin RenandXubin Ren a3e4c77fff fix(providers): normalize anthropic cached token usage 2026-04-02 12:51:45 +08:00
Xubin RenandXubin Ren 485c75e065 test(exec): verify windows drive-root workspace guard 2026-04-02 04:00:03 +08:00
Xubin RenandXubin Ren 7e719f41cc test(providers): cover github copilot lazy export 2026-04-02 03:46:40 +08:00
Xubin RenandXubin Ren 2ec68582eb fix(sdk): route github copilot through oauth provider 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 RenandXubin Ren 949a10f536 fix(weixin): reset QR poll host after refresh 2026-03-31 19:40:13 +08:00
Xubin Ren bc8fbd1ce4 fix(weixin): reset QR poll host after refresh 2026-03-31 11:34:33 +00:00
Xubin Ren 6aad945719 Merge remote-tracking branch 'origin/main' into pr-2614 2026-03-31 11:29:36 +00:00
Xubin RenandXubin Ren f450c6ef6c fix(channel): preserve threaded streaming context 2026-03-31 19:26:07 +08:00
Xubin RenandXubin Ren 351e3720b6 test(agent): cover disabled subagent exec tool
Add a regression test for the maintainer fix so subagents cannot register ExecTool when exec support is disabled.

Made-with: Cursor
2026-03-31 12:14:28 +08:00
Xubin RenandXubin Ren 7fad14802e feat: add Python SDK facade and per-session isolation 2026-03-31 11:26:43 +08:00
Xubin RenandXubin Ren 842b8b255d fix(agent): preserve core hook failure semantics 2026-03-31 02:19:29 +08:00
Xubin RenandXubin Ren 758c4e74c9 fix(agent): preserve LoopHook error semantics when extra hooks are present 2026-03-31 02:19:29 +08:00
Xubin Ren 5e99b81c6e refactor(api): reduce compatibility and test noise
Make the fixed-session API surface explicit, document its usage, exclude api/ from core agent line counts, and remove implicit aiohttp pytest fixture dependencies from API tests.
2026-03-30 15:05:06 +00:00
Xubin Ren d9a5080d66 refactor(api): tighten fixed-session API contract
Require a single user message, reject mismatched models, document the OpenAI-compatible API, and exclude api/ from core agent line counts so the interface matches nanobot's minimal fixed-session runtime.
2026-03-30 14:43:22 +00:00
Xubin Ren 55501057ac refactor(api): tighten fixed-session chat input contract
Reject mismatched models and require a single user message so the OpenAI-compatible endpoint reflects the fixed-session nanobot runtime without extra compatibility noise.
2026-03-30 14:20:14 +00:00
Xubin Ren 5635907e33 feat(api): load serve settings from config
Read serve host, port, and timeout from config by default, keep CLI flags higher priority, and bind the API to localhost by default for safer local usage.
2026-03-29 15:32:33 +00:00
Xubin Ren a0684978fb feat(api): add fixed-session OpenAI-compatible endpoint
Expose OpenAI-compatible chat completions and models endpoints through a single persistent API session, keeping the integration simple without adding multi-session isolation yet.
2026-03-29 14:48:52 +00:00
Xubin Ren c8c520cc9a docs: update providers information 2026-03-28 13:28:56 +00:00
Xubin Ren 17d21c8e64 docs: update news section for v0.1.4.post6 release 2026-03-27 15:18:31 +00:00
Xubin Ren aebe928cf0 docs: update v0.1.4.post6 release news 2026-03-27 15:17:22 +00:00
Xubin Ren a42a4e9d83 docs: update v0.1.4.post6 release news 2026-03-27 15:16:28 +00:00
Xubin Ren c15f63a320 chore: bump version to 0.1.4.post6 2026-03-27 14:42:19 +00:00
Xubin Ren 9652e67204 Merge remote-tracking branch 'origin/main' into advisory-email-fix 2026-03-27 14:28:40 +00:00
Xubin RenandXubin Ren f8c580d015 test(telegram): cover network error logging 2026-03-27 22:17:01 +08:00
Xubin RenandXubin Ren e464a81545 fix(feishu): only stream visible cards 2026-03-27 21:59:11 +08:00
Xubin RenandXubin Ren cf25a582ba fix(channel): stop delta coalescing at stream boundaries 2026-03-27 21:43:57 +08:00
Xubin Ren ace3fd6049 feat: add default OpenRouter app attribution headers 2026-03-27 11:40:23 +00:00
Xubin RenandXubin Ren 5bf0f6fe7d refactor: unify agent runner lifecycle hooks 2026-03-27 12:41:17 +08:00
Xubin RenandXubin Ren e7d371ec1e refactor: extract shared agent runner and preserve subagent progress on failure 2026-03-27 02:49:43 +08:00
Xubin Ren 33abe915e7 fix telegram streaming message boundaries 2026-03-26 02:35:12 +00:00
Xubin RenandXubin Ren f0f0bf02d7 refactor(channel): centralize retry around explicit send failures
Make channel delivery failures raise consistently so retry policy lives in ChannelManager rather than being split across individual channels. Tighten Telegram stream finalization, clarify sendMaxRetries semantics, and align the docs with the behavior the system actually guarantees.
2026-03-25 22:37:11 +08:00
Xubin RenandXubin Ren 3f71014b7c fix(agent): use configured timezone when registering cron tool
Read the default timezone from the agent context when wiring the cron tool so startup no longer depends on an out-of-scope local variable. Add a regression test to ensure AgentLoop passes the configured timezone through to cron.

Made-with: Cursor
2026-03-25 22:07:14 +08:00
Xubin RenandXubin Ren fab14696a9 refactor(cron): align displayed times with schedule timezone
Make cron list output render one-shot and run-state timestamps in the same timezone context used to interpret schedules. This keeps scheduling logic and user-facing time displays consistent.

Made-with: Cursor
2026-03-25 22:07:14 +08:00
Xubin RenandXubin Ren 4a7d7b8823 feat(cron): inherit agent timezone for default schedules
Make cron use the configured agent timezone when a cron expression omits tz or a one-shot ISO time has no offset. This keeps runtime context, heartbeat, and scheduling aligned around the same notion of time.

Made-with: Cursor
2026-03-25 22:07:14 +08:00
Xubin RenandXubin Ren 13d6c0ae52 feat(config): add configurable timezone for runtime context
Add agent-level timezone configuration with a UTC default, propagate it into runtime context and heartbeat prompts, and document valid IANA timezone usage in the README.
2026-03-25 22:07:14 +08:00
Xubin RenandXubin Ren b5302b6f3d refactor(provider): preserve extra_content verbatim for Gemini thought_signature round-trip
Replace the flatten/unflatten approach (merging extra_content.google.*
into provider_specific_fields then reconstructing) with direct pass-through:
parse extra_content as-is, store on ToolCallRequest.extra_content, serialize
back untouched.  This is lossless, requires no hardcoded field names, and
covers all three parsing branches (str, dict, SDK object) plus streaming.
2026-03-25 10:00:29 +08:00
Xubin Ren 263069583d fix(provider): accept plain text OpenAI-compatible responses
Handle string and dict-shaped responses from OpenAI-compatible backends so non-standard providers no longer crash on missing choices fields. Add regression tests to keep SDK, dict, and plain-text parsing paths aligned.
2026-03-25 01:22:21 +00:00
Xubin Ren 7b31af2204 docs: update news section 2026-03-24 18:11:50 +00:00
Xubin Ren c3031c9cb8 docs: update news section about litellm 2026-03-24 18:11:03 +00:00
Xubin RenandXubin Ren 3dfdab704e refactor: replace litellm with native openai + anthropic SDKs
- Remove litellm dependency entirely (supply chain risk mitigation)
- Add AnthropicProvider (native SDK) and OpenAICompatProvider (unified)
- Merge CustomProvider into OpenAICompatProvider, delete custom_provider.py
- Add ProviderSpec.backend field for declarative provider routing
- Remove _resolve_model, find_gateway, find_by_model (dead heuristics)
- Pass resolved spec directly into provider — zero internal lookups
- Stub out litellm-dependent model database (cli/models.py)
- Add anthropic>=0.45.0 to dependencies, remove litellm
- 593 tests passed, net -1034 lines
2026-03-25 01:58:48 +08:00
Xubin Ren 38ce054b31 fix(security): pin litellm and add supply chain advisory note 2026-03-24 15:55:43 +00:00
Xubin RenandXubin Ren d25985be0b fix(filesystem): clarify optional tool argument handling
Keep the mypy-friendly optional execute signatures while returning clearer errors for missing arguments and locking that behavior with regression tests.

Made-with: Cursor
2026-03-24 11:49:10 +08:00
Xubin Ren a96dd8babb Merge branch 'main' into feat/channel_enhancement
Keep the channel enhancements aligned with the current codebase while preserving a simpler product surface. This keeps QQ, Feishu, Telegram, and WhatsApp improvements together, removes the extra Telegram-only tool hint toggle, and makes WhatsApp mention-only groups actually work.
2026-03-24 03:33:44 +00:00
Xubin Ren 14763a6ad1 fix(provider): accept canonical and alias provider names consistently 2026-03-24 03:03:59 +00:00
Xubin Ren d454386f32 docs(weixin): clarify source-only installation in README 2026-03-24 02:51:50 +00:00
Xubin Ren 186357e80c Merge branch 'main' into fix/workspace-scoped-cron-store
Keep cron state workspace-scoped while only migrating legacy jobs into the default workspace. This preserves seamless upgrades for existing installs without polluting intentionally new workspaces.
2026-03-24 02:41:58 +00:00
Xubin Ren 1d58c9b9e1 docs: update channel table and add plugin dev note 2026-03-23 17:17:10 +00:00
Xubin RenandXubin Ren 25288f9951 feat(whatsapp): add outbound media support via bridge 2026-03-24 01:11:33 +08:00
Xubin RenandXubin Ren bef88a5ea1 docs: require explicit channel login command 2026-03-24 01:11:33 +08:00
Xubin RenandXubin Ren d164548d9a docs(weixin): add setup guide and focused channel tests 2026-03-24 01:11:33 +08:00
Xubin RenandXubin Ren 0ca639bf22 fix(cli): use discovered class for channel login 2026-03-24 01:11:33 +08:00
Xubin RenandXubin Ren 2056061765 refine heartbeat session retention boundaries 2026-03-24 00:33:43 +08:00
Xubin RenandXubin Ren 20494a2c52 refactor command routing for future plugins and clearer CLI structure 2026-03-23 16:48:42 +08:00
Xubin Ren 9f19297056 Merge remote-tracking branch 'origin/main' into advisory-email-fix
Made-with: Cursor

# Conflicts:
#	nanobot/config/schema.py
2026-03-23 05:06:00 +00:00
Xubin RenandXubin Ren aba0b83a77 fix(memory): reserve completion headroom for consolidation
Trigger token consolidation before prompt usage reaches the full context window so response tokens and tokenizer estimation drift still fit safely within the model budget.

Made-with: Cursor
2026-03-23 11:54:44 +08:00
Xubin Ren 8f5c2d1a06 fix(cli): stop spinner after non-streaming interactive replies 2026-03-23 03:28:10 +00:00
Xubin RenandXubin Ren 9d5e511a6e feat(streaming): centralize think-tag filtering and add Telegram streaming
- Add strip_think() to helpers.py as single source of truth
- Filter deltas in agent loop before dispatching to consumers
- Implement send_delta in TelegramChannel with progressive edit_message_text
- Remove duplicate think filtering from CLI stream.py and telegram.py
- Remove legacy fake streaming (send_message_draft) from Telegram
- Default Telegram streaming to true
- Update CHANNEL_PLUGIN_GUIDE.md with streaming documentation

Made-with: Cursor
2026-03-23 10:20:41 +08:00
Xubin RenandXubin Ren f2e1cb3662 feat(cli): extract streaming renderer to stream.py with Rich Live
Move ThinkingSpinner and StreamRenderer into a dedicated module to keep
commands.py focused on orchestration. Uses Rich Live with manual refresh
(auto_refresh=False) and ellipsis overflow for stable streaming output.

Made-with: Cursor
2026-03-23 10:20:41 +08:00
Xubin RenandXubin Ren bd621df57f feat: add streaming channel support with automatic fallback
Provider layer: add chat_stream / chat_stream_with_retry to all providers
(base fallback, litellm, custom, azure, codex). Refactor shared kwargs
building in each provider.

Channel layer: BaseChannel gains send_delta (no-op) and supports_streaming
(checks config + method override). ChannelManager routes _stream_delta /
_stream_end to send_delta, skips _streamed final messages.

AgentLoop._dispatch builds bus-backed on_stream/on_stream_end callbacks
when _wants_stream metadata is set. Non-streaming path unchanged.

CLI: clean up spinner ANSI workarounds, simplify commands.py flow.
Made-with: Cursor
2026-03-23 10:20:41 +08:00
Xubin RenandXubin Ren e79b9f4a83 feat(agent): add streaming groundwork for future TUI
Preserve the provider and agent-loop streaming primitives plus the CLI experiment scaffolding so this work can be resumed later without blocking urgent bug fixes on main.

Made-with: Cursor
2026-03-23 10:20:41 +08:00
Xubin Ren 931cec3908 Merge remote-tracking branch 'origin/main' into pr-1109
Resolve conflict in context.py: keep main's build_messages which already
merges runtime context into user message (achieving the same cache goal).
The real value-add from this PR is the second cache breakpoint in
litellm_provider.py.

Made-with: Cursor
2026-03-22 06:14:18 +00:00
Xubin RenandXubin Ren 1c71489121 fix(agent): count all message fields in token estimation
estimate_prompt_tokens() only counted the `content` text field, completely
missing tool_calls JSON (~72% of actual payload), reasoning_content,
tool_call_id, name, and per-message framing overhead. This caused the
memory consolidator to never trigger for tool-heavy sessions (e.g. cron
jobs), leading to context window overflow errors from the LLM provider.

Also adds reasoning_content counting and proper per-message overhead to
estimate_message_tokens() for consistent boundary detection.

Made-with: Cursor
2026-03-22 12:19:44 +08:00
Xubin RenandXubin Ren 48c71bb61e refactor(agent): unify process_direct to return OutboundMessage
Merge process_direct() and process_direct_outbound() into a single
interface returning OutboundMessage | None. This eliminates the
dual-path detection logic in CLI single-message mode that relied on
inspect.iscoroutinefunction to distinguish between the two APIs.

Extract status rendering into a pure function build_status_content()
in utils/helpers.py, decoupling it from AgentLoop internals.

Made-with: Cursor
2026-03-22 00:39:38 +08:00
Xubin Ren a8176ef2c6 fix(cli): keep direct-call rendering compatible in tests
Only use process_direct_outbound when the agent loop actually exposes it as an async method, and otherwise fall back to the legacy process_direct path. This keeps the new CLI render-metadata flow without breaking existing test doubles or older direct-call implementations.

Made-with: Cursor
2026-03-21 16:07:14 +00:00
Xubin Ren e430b1daf5 fix(agent): refine status output and CLI rendering
Keep status output responsive while estimating current context from session history, dropping low-value queue/subagent counters, and marking command-style replies for plain-text rendering in CLI. Also route direct CLI calls through outbound metadata so help/status formatting stays explicit instead of relying on content heuristics.

Made-with: Cursor
2026-03-21 15:52:10 +00:00
Xubin Ren 4d1897609d fix(agent): make status command responsive and accurate
Handle /status at the run-loop level so it can return immediately while the agent is busy, and reset last-usage stats when providers omit usage data. Also keep Telegram help/menu coverage for /status without changing the existing final-response send path.

Made-with: Cursor
2026-03-21 15:21:32 +00:00