Commit Graph

8340 Commits

Author SHA1 Message Date
David Garson
8e4b5c2d75 Merge branch 'dgarson/agent-runtime-claude-code-support' of github.com:dgarson/clawdbot into dgarson/agent-runtime-claude-code-support 2026-01-29 01:58:12 -07:00
David Garson
ef1f5b6669 Merge remote-tracking branch 'origin/main' into dgarson/agent-runtime-claude-code-support 2026-01-29 01:57:59 -07:00
David
d4fb6cc414
Merge branch 'moltbot:main' into main 2026-01-29 01:57:33 -07:00
Tyler Yust
6372242da7
fix(ui): improve chat session dropdown and refresh behavior (#3682)
* refactor(ui): enhance loadSessions function to accept overrides for session loading parameters

- Updated loadSessions to include optional parameters for activeMinutes, limit, includeGlobal, and includeUnknown.
- Modified refreshChat to use the new activeMinutes parameter when loading sessions.
- Removed duplicate applySettingsFromUrl call in handleConnected function.

* feat(ui): implement session refresh functionality after chat

- Added `refreshSessionsAfterChat` property to `ChatHost` and `GatewayHost` types.
- Introduced `isChatResetCommand` function to identify chat reset commands.
- Updated `handleSendChat` to set `refreshSessions` based on chat reset commands.
- Modified `handleGatewayEventUnsafe` to load sessions when chat is finalized and `refreshSessionsAfterChat` is true.
- Enhanced `refreshChat` to load sessions with `activeMinutes` set to 0 for immediate refresh.
2026-01-28 23:24:46 -08:00
David
15e9c033c3
Merge branch 'main' into dgarson/agent-runtime-claude-code-support 2026-01-29 00:12:05 -07:00
David Garson
45bff6a2e4 fix: UX improvement around reasoning text, fixup tool invocation card in Chat UI 2026-01-29 00:10:47 -07:00
David Garson
b927361650 chore: common tool event logging, reduce per-AgentRuntime code 2026-01-28 23:28:37 -07:00
Ayaan Zaidi
718bc3f9c8
fix: avoid silent telegram empty replies (#3796) (#3796) 2026-01-29 11:34:47 +05:30
Conroy Whitney
c20035094d
fix: use & instead of <> in XML escaping test for Windows NTFS compatibility (#3750)
NTFS does not allow < or > in filenames, causing the XML filename
escaping test to fail on Windows CI with ENOENT.

Replace file<test>.txt with file&test.txt — & is valid on all platforms
and still requires XML escaping (&amp;), preserving the test's intent.

Fixes #3748
2026-01-29 05:46:50 +00:00
kiranjd
0761652701 fix(telegram): handle empty reply array in notifyEmptyResponse
Previous fix only checked skippedEmpty > 0, but when model returns
content: [] no payloads are created at all. Now also checks
replies.length === 0 to catch this case.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:13:39 +05:30
kiranjd
a2d06e75b0 fix(telegram): notify users when agent returns empty response
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:13:39 +05:30
Ayaan Zaidi
34291321b4 chore: update clawtributors (add @HirokiKobayashi-R) 2026-01-29 10:33:25 +05:30
Ayaan Zaidi
16a5549ec0 docs: update changelog for mention patterns (#3303) (thanks @HirokiKobayashi-R) 2026-01-29 10:31:47 +05:30
HirokiKobayashi-R
22b59d24ce fix(mentions): check mentionPatterns even when explicit mention is available 2026-01-29 10:31:47 +05:30
Ayaan Zaidi
fcc53bcf1b fix: include AccountId in telegram native command context (#2942) (thanks @Chloe-VP) 2026-01-29 10:17:25 +05:30
Chloe
6132c3d014 fix(telegram): include AccountId in native command context for multi-agent routing
When running multiple Telegram bot accounts bound to different agents,
the /new command (and other slash commands) would send confirmation
messages via the wrong bot because the context was missing AccountId.

The fix adds AccountId: route.accountId to the context payload in
registerTelegramNativeCommands, matching how bot-message-context.ts
handles regular messages.

Fixes #2537
2026-01-29 10:17:25 +05:30
Ayaan Zaidi
4ac7aa4a48 fix: handle telegram video notes (#2905) (thanks @mylukin) 2026-01-29 10:07:21 +05:30
Lukin
78722d0b4f fix(telegram): add video_note support to Telegram channel
- Add msg.video_note to media extraction chain in bot/delivery.ts
- Add placeholder detection for video notes in bot-message-context.ts
- Video notes (rounded square video messages) are now processed and downloaded like regular videos

Fixes issue where video note messages were silently dropped because they weren't in the media handling logic.
2026-01-29 10:07:21 +05:30
David Garson
800c211582 fix: schema issues w/zod and mcp tool bridge 2026-01-28 21:30:42 -07:00
Clawdbot
c13c39f121 fix: exclude native slash commands from onToolResult
Native slash commands (e.g. /verbose, /status) should not emit tool
summaries. Gate onToolResult behind CommandSource !== 'native' in
addition to the existing ChatType !== 'group' check.

Add test for native command exclusion.
2026-01-29 09:50:39 +05:30
Clawdbot
e1ecfb25b8 test: add tests for onToolResult in DM vs group sessions
- provides onToolResult in DM sessions (ChatType=direct)
- does not provide onToolResult in group sessions (ChatType=group)
- sends tool results via dispatcher in DM sessions

Replaces the old cross-provider test that expected onToolResult to
always be undefined.
2026-01-29 09:50:39 +05:30
Clawdbot
f27a5030d8 fix: restore verbose tool summaries in DM sessions
875b018ea removed onToolResult from dispatch-from-config.ts to prevent
tool summaries leaking into group channels. However, this also broke
verbose tool summaries in DM/private sessions where they are expected.

This restores onToolResult but gates it behind ChatType !== 'group',
so group channels remain unaffected while DM verbose works again.

mirror=false is passed to sendPayloadAsync to avoid duplicating tool
summaries in the session transcript (matching the block reply behavior).

Fixes #2665
2026-01-29 09:50:39 +05:30
David Garson
7bdbb444e6 fix: tool fixes and sdk logging reduction 2026-01-28 21:06:02 -07:00
Gustavo Madeira Santana
699784dbee chore: remove stray package-lock.json 2026-01-28 22:00:55 -05:00
Gustavo Madeira Santana
a44da67069 fix: local updates for PR #3600
Co-authored-by: kira-ariaki <kira-ariaki@users.noreply.github.com>
2026-01-28 22:00:11 -05:00
Kira
0fd9d3abd1 feat(memory): add explicit paths config for memory search
Add a `paths` option to `memorySearch` config, allowing users to
explicitly specify additional directories or files to include in
memory search.

Follow-up to #2961 as suggested by @gumadeiras — instead of auto-following
symlinks (which has security implications), users can now explicitly
declare additional search paths.

- Add `memorySearch.paths` config option (array of strings)
- Paths can be absolute or relative (resolved from workspace)
- Directories are recursively scanned for `.md` files
- Single `.md` files can also be specified
- Paths from defaults and agent overrides are merged
- Added 4 test cases for listMemoryFiles
2026-01-28 22:00:11 -05:00
Shakker
b717724275
fix: add security hardening for media text attachments (#3700)
* fix: Prevent XML attribute injection by escaping special characters in file name and MIME type attributes.

* fix: text attachment MIME misclassification with security hardening (#3628)

- Fix CSV/TSV inference from content heuristics
- Add UTF-16 detection and BOM handling
- Add XML attribute escaping for file output (security)
- Add MIME override logging for auditability
- Add comprehensive test coverage for edge cases

Thanks @frankekn
2026-01-29 02:39:01 +00:00
David Garson
460395baea feat: refactor Agent-agnostic types; update Tools and Unified Agent Runner to support latest CCSDK fixes 2026-01-28 19:35:12 -07:00
Frank Yang
cb18ce7a85
Fix text attachment MIME misclassification (#3628)
* Fix text file attachment detection

* Add file attachment extraction tests
2026-01-29 02:33:03 +00:00
Gustavo Madeira Santana
a109b7f1a9 Update self message trust policy in WhatsApp docs
Clarified that self messages from the linked WhatsApp number bypass DM policy and allowFrom checks.
2026-01-28 20:31:33 -05:00
tewatia
4f554a1e31 docs(whatsapp): clarify self-message dmPolicy bypass
Self messages from the linked WhatsApp number bypass dmPolicy and allowFrom
checks automatically. Clarified that users don't need to add their own
number to the allowlist.

Self messages from the linked WhatsApp number bypass dmPolicy checks
entirely (via isSamePhone check in access-control.ts)...
2026-01-28 20:31:33 -05:00
jonisjongithub
fdcac0ccf4
fix: correct 'Venius' typo to 'Venice' in provider docs (#3638) - thanks (@jonisjongithub) 2026-01-28 23:51:43 +00:00
Shakker
3a9cfd787d
Merge pull request #3635 from moltbot/fix-token-input-trim
fix: trim whitespace from config input fields on change
2026-01-28 23:46:14 +00:00
Shakker
1c98b9dec8 fix(ui): trim whitespace from config input fields on change 2026-01-28 23:41:33 +00:00
Shakker
67f1402703 fix: tts base url runtime read (#3341) (thanks @hclsys) 2026-01-28 23:30:29 +00:00
David Garson
aa4418e496 finishing touches on agentic loop integration w/extra logging - will remove later 2026-01-28 14:47:10 -07:00
Tyler Yust
a7534dc223
fix(ui): gateway URL confirmation modal (based on #2880) (#3578)
* fix: adding confirmation modal to confirm gateway url change

* refactor: added modal instead of confirm prompt

* fix(ui): reconnect after confirming gateway url (#2880) (thanks @0xacb)

---------

Co-authored-by: 0xacb <amccbaptista@gmail.com>
2026-01-28 13:32:10 -08:00
David Garson
541650185e chore: resolve merge conflict in sdk-runner.ts
Merged both native session resume logic and system prompt additions:
- Keep claudeSessionId/forkSession for native SDK session resume
- Keep buildSystemPromptAdditionsFromParams for Moltbot context injection
- History suffix now conditional on native resume mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:24:20 -07:00
David Garson
d4f0369278 fix: restore missing CCSDK functionality after merge
Add back features lost during merge conflict resolution:
- Hook integration (before_agent_start, agent_end hooks)
- System prompt additions via buildSystemPromptAdditionsFromParams
- Model tier environment variables (ANTHROPIC_DEFAULT_*_MODEL)
- Use effectivePrompt from hooks instead of raw params.prompt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:23:41 -07:00
David Garson
60298911f5 Merge branch 'dgarson/agent-runtime-claude-code-support' of github.com:dgarson/clawdbot into dgarson/agent-runtime-claude-code-support 2026-01-28 11:22:22 -07:00
David Garson
b8c947a43e chore: add failover at AgentRuntime layer, fixed up tool bridge 2026-01-28 11:14:02 -07:00
David Garson
9050c951f2 Merge remote-tracking branch 'origin/dgarson/agent-runtime-claude-code-support'
Resolved conflicts in claude-agent-sdk module:
- index.ts: export all types from both versions
- types.ts: merge SdkRunnerParams with additional fields (tools, builtInTools,
  permissionMode, maxTurns, mcpServerName, conversationHistory) and keep
  SdkRunnerCallbacks intersection
- sdk-agent-runtime.ts: keep helper functions from both versions, use callback
  wrappers to adapt SDK payload shapes to AgentRuntimeRunParams signatures
- sdk-runner.ts: use incoming version with MCP tool bridging (returns
  SdkRunnerResult as expected by adaptSdkResult)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:13:21 -07:00
David Garson
c8b5337a71 chore: add __screenshots__ to git ignore for playwright 2026-01-28 11:12:30 -07:00
David Garson
e5f7aa936c feat: add ccsdk session adapter 2026-01-28 11:07:45 -07:00
David Garson
236596b5ce feat: sdk-runner implementation w/hooks 2026-01-28 10:39:20 -07:00
David Garson
0a2e444b21 feat: add AgentRuntime abstraction for Claude Agent SDK Support
* added AgentRuntime interface and implementation for PiAgent and ClaudeCode SDK (ccsdk)
* support for Claude Code Max and z.AI Coding Plan subscriptions (which are limited to Claude Code)
* tool bridge to ensure that the Claude Code SDK agent loop is capable of invoking the same tools as pi-agent

I used Claude Opus 4.5 to help craft this PR.
2026-01-28 09:46:02 -07:00
Gustavo Madeira Santana
109ac1c549 fix: banner spacing 2026-01-28 11:39:35 -05:00
David
7800194f33
Merge branch 'moltbot:main' into main 2026-01-28 08:45:47 -07:00
Akshay
01e0d3a320
fix(cli): initialize plugins before pairing CLI registration (#3272)
The pairing CLI calls listPairingChannels() at registration time,
which requires the plugin registry to be populated. Without this,
plugin-provided channels like Matrix fail with "does not support
pairing" even though they have pairing adapters defined.

This mirrors the existing pattern used by the plugins CLI entry.

Co-authored-by: Shakker <165377636+shakkernerd@users.noreply.github.com>
2026-01-28 13:26:25 +00:00
Shakker
da421b9ef7
Merge pull request #3316 from bguidolim/fix/mime-types-audio-video
fix(media): add missing MIME type mappings for audio/video files
2026-01-28 12:31:47 +00:00