Commit Graph

1369 Commits

Author SHA1 Message Date
Xubin Ren
dc1aeeaf8b docs: document exec tool enable and denyPatterns
Made-with: Cursor
2026-03-20 17:24:40 +00:00
Xubin Ren
3825ed8595 merge origin/main into pr-1824
- wire tools.exec.enable and deny_patterns into the current AgentLoop
- preserve the current WebSearchTool config-based registration path
- treat deny_patterns=[] as an explicit override instead of falling back
  to the default blacklist
- add regression coverage for disabled exec registration and custom deny
  patterns

Made-with: Cursor
2026-03-20 17:21:42 +00:00
Xubin Ren
aacbb95313 fix(agent): preserve external cancellation in message loop
Made-with: Cursor
2026-03-20 19:27:26 +08:00
cdkey85
d83ba36800 fix(agent): handle asyncio.CancelledError in message loop
- Catch asyncio.CancelledError separately from generic exceptions
- Re-raise CancelledError only when loop is shutting down (_running is False)
- Continue processing messages if CancelledError occurs during normal operation
- Prevents anyio/MCP cancel scopes from prematurely terminating the agent loop
2026-03-20 19:27:26 +08:00
Xubin Ren
fc1ea07450 fix(custom_provider): truncate raw error body to prevent huge HTML pages
Made-with: Cursor
2026-03-20 19:12:09 +08:00
siyuan.qsy
8b971a7827 fix(custom_provider): show raw API error instead of JSONDecodeError
When an OpenAI-compatible API returns a non-JSON response (e.g. plain
text "unsupported model: xxx" with HTTP 200), the OpenAI SDK raises a
JSONDecodeError whose message is the unhelpful "Expecting value: line 1
column 1 (char 0)".  Extract the original response body from
JSONDecodeError.doc (or APIError.response.text) so users see the actual
error message from the API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 19:12:09 +08:00
Xubin Ren
f44c4f9e3c refactor: remove deprecated memory_window, harden wizard display 2026-03-20 18:46:13 +08:00
Xubin Ren
c3a4b16e76 refactor: optimize onboard wizard - mask secrets, remove emoji, reduce repetition
- Mask sensitive fields (api_key/token/secret/password) in all display
  surfaces, showing only the last 4 characters
- Replace all emoji with pure ASCII labels for consistent cross-platform
  terminal rendering
- Extract _print_summary_panel helper, eliminating 5x duplicate table
  construction in _show_summary
- Replace 3 one-line wrapper functions with declarative _SETTINGS_SECTIONS
  dispatch tables and _MENU_DISPATCH in run_onboard
- Extract _handle_model_field / _handle_context_window_field into a
  _FIELD_HANDLERS registry, shrinking _configure_pydantic_model
- Return FieldTypeInfo NamedTuple from _get_field_type_info for clarity
- Replace global mutable _PROVIDER_INFO / _CHANNEL_INFO with @lru_cache
- Use vars() instead of dir() in _get_channel_info for reliable config
  class discovery
- Defer litellm import in model_info.py so non-wizard CLI paths stay fast
- Clarify README Quick Start wording (Add -> Configure)
2026-03-20 18:46:13 +08:00
chengyongru
45e89d917b fix(onboard): require explicit save in interactive wizard
Cherry-pick from d6acf1a with manual merge resolution.
Keep onboarding edits in draft state until users choose Done or Save and
Exit, so backing out or discarding the wizard no longer persists partial
changes.

Co-Authored-By: Jason Zhao <144443939+JasonZhaoWW@users.noreply.github.com>
2026-03-20 18:46:13 +08:00
chengyongru
a6fb90291d feat(onboard): pass CLI args as initial config to interactive wizard
--workspace and --config now work as initial defaults in interactive mode:
- The wizard starts with these values pre-filled
- Users can view and modify them in the wizard
- Final saved config reflects user's choices

This makes the CLI args more useful for interactive sessions while
still allowing full customization through the wizard.
2026-03-20 18:46:13 +08:00
chengyongru
67528deb4c fix(tests): use --no-interactive for non-interactive onboard tests
Tests for non-interactive onboard mode now explicitly use --no-interactive
flag since the default changed to interactive mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 18:46:13 +08:00
chengyongru
606e8fa450 feat(onboard): add field hints and Escape/Left navigation
- Add `_SELECT_FIELD_HINTS` for select fields with predefined choices
  (e.g., reasoning_effort: low/medium/high with hint text)
- Add `_select_with_back()` using prompt_toolkit for custom key bindings
- Support Escape and Left arrow keys to go back in menus
- Apply to field config, provider selection, and channel selection menus
2026-03-20 18:46:13 +08:00
chengyongru
814c72eac3 refactor(tests): extract onboard logic tests to dedicated module
- Move onboard-related tests from test_commands.py and test_config_migration.py
  to new test_onboard_logic.py for better organization
- Add comprehensive unit tests for:
  - _merge_missing_defaults recursive config merging
  - _get_field_type_info type extraction
  - _get_field_display_name human-readable name generation
  - _format_value display formatting
  - sync_workspace_templates file synchronization
- Remove unused dev dependencies (matrix-nio, mistune, nh3) from pyproject.toml
2026-03-20 18:46:13 +08:00
chengyongru
3369613727 feat(onboard): add model autocomplete and auto-fill context window
- Add model_info.py module with litellm-based model lookup
- Provide autocomplete suggestions for model names
- Auto-fill context_window_tokens when model changes (only at default)
- Add "Get recommended value" option for manual context lookup
- Dynamically load provider keywords from registry (no hardcoding)

Resolves #2018
2026-03-20 18:46:13 +08:00
chengyongru
f127af0481 feat: add interactive onboard wizard for LLM provider and channel configuration 2026-03-20 18:46:13 +08:00
Xubin Ren
c138b2375b docs: refine spawn workspace guidance wording
Adjust the spawn tool description to keep the workspace-organizing hint while
avoiding language that sounds like the system automatically assigns a dedicated
working directory for subagents.

Made-with: Cursor
2026-03-20 13:30:21 +08:00
JilunSun7274
e5179aa7db delete redundant whitespaces in subagent prompts 2026-03-20 13:30:21 +08:00
JilunSun7274
517de6b731 docs: add subagent workspace assignment hint to spawn tool description 2026-03-20 13:30:21 +08:00
mamamiyear
d70ed0d97a fix: nanobot onboard update config crash
when use onboard and choose N,
maybe sometimes will be crash and
config file will be invalid.
2026-03-20 13:16:56 +08:00
Rupert Rebentisch
0b1beb0e9f Fix TypeError for MCP tools with nullable JSON Schema params
MCP servers (e.g. Zapier) return JSON Schema union types like
`"type": ["string", "null"]` for nullable parameters. The existing
`validate_params()` and `cast_params()` methods expected only simple
strings as `type`, causing `TypeError: unhashable type: 'list'` on
every MCP tool call with nullable parameters.

Add `_resolve_type()` helper that extracts the first non-null type
from union types, and use it in `_cast_value()` and `_validate()`.
Also handle `None` values correctly when the schema declares a
nullable type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:13:11 +08:00
Xubin Ren
dd7e3e499f fix: separate Telegram connection pools and add timeout retry to prevent pool exhaustion
The root cause of "Pool timeout" errors is that long-polling (getUpdates)
and outbound API calls (send_message, send_photo, etc.) shared the same
HTTPXRequest pool — polling holds connections indefinitely, starving sends
under concurrent load (e.g. cron jobs + user chat).

- Split into two independent pools: API calls (default 32) and polling (4)
- Expose connection_pool_size / pool_timeout in TelegramConfig for tuning
- Add _call_with_retry() with exponential backoff (3 attempts) on TimedOut
- Apply retry to _send_text and remote media URL sends
2026-03-19 16:15:41 +08:00
mamamiyear
d9cb729596 feat: support feishu code block 2026-03-19 13:59:31 +08:00
Xubin Ren
214bf66a29 docs(readme): clarify nanobot is unrelated to crypto 2026-03-18 15:18:38 +00:00
Xubin Ren
4b052287cb fix(telegram): validate remote media URLs 2026-03-18 23:12:11 +08:00
h4nz4
a7bd0f2957 feat(telegram): support HTTP(S) URLs for media in TelegramChannel
Fixes #1792
2026-03-18 23:12:11 +08:00
Xubin Ren
728d4e88a9 fix(providers): lazy-load provider exports 2026-03-18 22:01:29 +08:00
Javis486
28127d5210 When using custom_provider, a prompt "LiteLLM:WARNING" will still appear during conversation 2026-03-18 22:01:29 +08:00
Xubin Ren
4e40f0aa03 docs: MiniMax gifts to the nanobot community 2026-03-18 05:09:03 +00:00
vivganes
e6910becb6 logo: transparent background
Also useful when we build the gateway.  Dark and bright modes can use the same logo.
2026-03-18 12:41:38 +08:00
Xubin Ren
5bd1c9ab8f fix(cron): preserve exact intervals in list output 2026-03-18 12:39:06 +08:00
PJ Hoberman
12aa7d7aca test(cron): add unit tests for _format_timing and _format_state helpers
Tests the helpers directly without needing CronService, covering all
schedule kinds, edge cases (missing fields, unknown status), and
combined state output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:39:06 +08:00
PJ Hoberman
8d45fedce7 refactor(cron): extract _format_timing and _format_state helpers
Addresses review feedback: moves schedule formatting and state
formatting into dedicated static methods, removes duplicate
in-loop imports, and simplifies _list_jobs() to a clean loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:39:06 +08:00
PJ Hoberman
228e1bb3de style: apply ruff format to cron tool
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:39:06 +08:00
PJ Hoberman
5d8c5d2d25 style(test): fix import sorting and remove unused imports
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:39:06 +08:00
PJ Hoberman
787e667dc9 test(cron): add tests for _list_jobs() schedule and state formatting
Covers all three schedule kinds (cron/every/at), human-readable interval
formatting, run state display (last run, status, errors, next run),
and disabled job filtering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:39:06 +08:00
PJ Hoberman
eb83778f50 fix(cron): show schedule details and run state in _list_jobs() output
_list_jobs() only displayed job name, id, and schedule kind (e.g. "cron"),
omitting the actual timing and run state. The agent couldn't answer
"when does this run?" or "did it run?" even though CronSchedule and
CronJobState had all the data.

Now surfaces:
- Cron expression + timezone for cron jobs
- Human-readable interval for every jobs
- ISO timestamp for one-shot at jobs
- Enabled/disabled status
- Last run time + status (ok/error/skipped) + error message
- Next scheduled run time

Fixes #1496

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:39:06 +08:00
zhangxiaoyu.york
f72ceb7a3c fix:set subagent result message role = assistant 2026-03-18 00:43:46 +08:00
angleyanalbedo
20e3eb8fce docs(readme): fix broken link to Channel Plugin Guide 2026-03-17 23:09:35 +08:00
Xubin Ren
8cf11a0291 fix: preserve image paths in fallback and session history 2026-03-17 22:37:09 +08:00
Xubin Ren
7086f57d05 test(feishu): cover media msg_type mapping 2026-03-17 17:05:13 +08:00
weipeng0098
47e2a1e8d7 fix(feishu): use correct msg_type for audio/video files 2026-03-17 17:05:13 +08:00
Xubin Ren
41d59c3b89 test(feishu): cover heading and table markdown rendering 2026-03-17 16:51:02 +08:00
Your Name
9afbf386c4 fix(feishu): fix markdown rendering issues in headings and tables
- Fix double bold markers (****) when heading text already contains **
- Strip markdown formatting (**bold**, *italic*, ~~strike~~) from table cells
  since Feishu table elements do not support markdown rendering

Fixes rendering issues where:
1. Headings like '**text**' were rendered as '****text****'
2. Table cells with '**bold**' showed raw markdown instead of plain text
2026-03-17 16:51:02 +08:00
Xubin Ren
91ca82035a feat(slack): add default done reaction on completion 2026-03-17 16:19:08 +08:00
Sihyeon Jang
8aebe20cac feat(slack): update reaction emoji on task completion
Remove the in-progress reaction (reactEmoji) and optionally add a
done reaction (doneEmoji) when the final response is sent, so users
get visual feedback that processing has finished.

Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
2026-03-17 16:19:08 +08:00
Xubin Ren
49fc50b1e6 test(custom): cover empty choices response handling 2026-03-17 14:24:55 +08:00
Jiajun Xie
2eb0c283e9 fix(providers): handle empty choices in custom provider response 2026-03-17 14:24:55 +08:00
Xubin Ren
b939a916f0 Merge PR #1763: align onboard with config and workspace overrides
align onboard with config and workspace overrides
2026-03-17 14:03:50 +08:00
Xubin Ren
499d0e1588 docs(readme): update multi-instance onboard examples 2026-03-17 05:58:13 +00:00
Xubin Ren
b2a550176e feat(onboard): align setup with config and workspace flags 2026-03-17 05:42:49 +00:00