Commit Graph

8312 Commits

Author SHA1 Message Date
Ojus Save
0e1641f87b fix(render): ensure script is executable and improve permission testing
- Add chmod +x for render-start.sh in Dockerfile
- Improve permission testing with touch/rm
- Better error handling
2026-01-28 10:10:18 -08:00
Ojus Save
df160aec5a fix(render): simplify script and fix permission checks
- Use set +e for permission testing, check exit codes explicitly
- Default to HOME/.clawdbot which is always writable
- Use heredoc for config file writing (more reliable)
- Add debug output for user/UID
- Remove duplicate echo statements
2026-01-28 10:10:18 -08:00
Ojus Save
3c1e781ab0 fix(render): disable set -e during permission testing
- Disable set -e for entire permission testing section
- Re-enable set -e after config is written
- Simpler logic without complex conditionals
- More reliable error handling
2026-01-28 10:10:18 -08:00
Ojus Save
c23dd3e3e3 fix(render): simplify permission handling with set +e/-e toggle
- Use for loop to try directories in order
- Temporarily disable set -e for permission tests
- Write config file directly to test writability
- More robust error handling that works with set -e
2026-01-28 10:10:18 -08:00
Ojus Save
041e279427 fix(render): improve permission handling and error checking
- Use touch/rm test instead of -w flag for better compatibility
- Clean up unused variables
- Add clearer fallback chain with logging
- Ensure script handles all edge cases gracefully
2026-01-28 10:10:18 -08:00
Ojus Save
4b37990554 fix(render): handle permission errors when running as non-root user
- Check if CLAWDBOT_STATE_DIR or /data/.clawdbot is writable
- Fall back to $HOME/.clawdbot if permissions fail
- Update CLAWDBOT_STATE_DIR export to match actual directory used
- Prevents Docker failures when running as node user (non-root)
2026-01-28 10:10:18 -08:00
Ojus Save
993bb9a829 test: add comprehensive tests for CIDR support in isTrustedProxyAddress
- Test exact IP matching (backward compatibility)
- Test CIDR notation (/8, /12, /16 ranges)
- Test multiple CIDR ranges
- Test mixed exact IPs and CIDR ranges
- Test edge cases and invalid CIDR handling
- Test IPv4-mapped IPv6 address normalization
2026-01-28 10:10:18 -08:00
Ojus Save
29d6bd6ed3 docs: update Render deployment guide with LLM API key configuration
- Add section on configuring LLM provider API keys (Anthropic, OpenAI, Gemini, etc.)
- Include wrapper reference to render_clawdbot repository
- Update render.yaml blueprint example with API key environment variables
- Add instructions for setting API keys in Render dashboard
- Document alternative config file method
2026-01-28 10:10:18 -08:00
Ojus Save
bf39de591c debug: verify config is readable and disable cache 2026-01-28 10:10:12 -08:00
Ojus Save
eec4567f0c fix: explicitly set CLAWDBOT_CONFIG_PATH to ensure config is loaded 2026-01-28 10:10:12 -08:00
Ojus Save
6df64ae4f7 debug: write config to both locations 2026-01-28 10:10:12 -08:00
Ojus Save
744371091b debug: add verbose output to startup script 2026-01-28 10:10:12 -08:00
Ojus Save
6b8680fe84 fix(gateway): add CIDR support to trustedProxies
Previously trustedProxies only supported exact IP matching.
Now supports CIDR notation (e.g., 10.0.0.0/8) for matching
IP ranges, which is needed for cloud deployments like Render
where proxy IPs come from private network ranges.
2026-01-28 10:10:12 -08:00
Ojus Save
e56581caf2 fix(render): use startup script to configure trustedProxies
The key difference from the wrapper:
- Wrapper strips proxy headers before forwarding to internal gateway
- Direct deployment needs trustedProxies config to trust Render's proxy IPs

This script:
1. Creates config with gateway.trustedProxies for Render's internal IPs
2. Sets allowInsecureAuth for Control UI access
3. Starts gateway with token auth
2026-01-28 10:10:12 -08:00
Ojus Save
f9d14cbba5 fix(render): correct command - gateway not gateway run 2026-01-28 10:10:12 -08:00
Ojus Save
6946cde818 fix(render): simplify dockerCommand, use token auth with CLAWDBOT_GATEWAY_TOKEN 2026-01-28 10:10:12 -08:00
Ojus Save
453e40d25f fix(render): pass password from env var to gateway command 2026-01-28 10:10:12 -08:00
Ojus Save
9eaaa2b0d0 fix(render): add startup script to configure trusted proxies and insecure UI auth
- Create render-start.sh that writes config before starting gateway
- Configure gateway.trustedProxies for Render's internal network
- Enable gateway.controlUi.allowInsecureAuth to skip device pairing
2026-01-28 10:10:12 -08:00
Ojus Save
22ceef1b57 fix(render): add --trust-proxy flag for Render load balancer 2026-01-28 10:10:12 -08:00
Ojus Save
4c54fffa05 fix(render): use dockerCommand in render.yaml instead of modifying Dockerfile
- Revert Dockerfile to generic CMD for compatibility with other platforms
- Add dockerCommand to render.yaml to run gateway with proper flags
- Use CLAWDBOT_GATEWAY_PASSWORD env var for password auth
- Remove healthCheckPath (gateway uses WebSocket, not HTTP health)
2026-01-28 10:10:12 -08:00
Gustavo Madeira Santana
109ac1c549 fix: banner spacing 2026-01-28 11:39:35 -05: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
Bruno Guidolim
57efd8e083 fix(media): add missing MIME type mappings for audio/video files
Add mappings for audio/x-m4a, audio/mp4, and video/quicktime to ensure
media files sent as documents are saved with proper extensions, enabling
automatic transcription/analysis tools to work correctly.

- audio/x-m4a → .m4a
- audio/mp4 → .m4a
- video/quicktime → .mov

Also adds comprehensive test coverage for extensionForMime().
2026-01-28 13:17:50 +01:00
Roopak Nijhara
d93f8ffc13 fix: use fileURLToPath for Windows compatibility 2026-01-28 16:42:39 +05:30
Roopak Nijhara
bffcef981d style: run pnpm format 2026-01-28 16:42:39 +05:30
Roopak Nijhara
39b7f9d581 feat(hooks): make session-memory message count configurable (#2681)
Adds `messages` config option to session-memory hook (default: 15).
Fixes filter order bug - now filters user/assistant messages first,
then slices to get exactly N messages. Previously sliced first which
could result in fewer messages when non-message entries were present.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:42:39 +05:30
Shadow
9688454a30
Accidental inclusion 2026-01-28 01:12:04 -06:00
Shadow
6044bf3637
Discord: fix resolveDiscordTarget parse options 2026-01-28 00:37:21 -06:00
Ayaan Zaidi
b6a3a91edf fix: wire per-account dm scope guidance (#3095) (thanks @jarvis-sam) 2026-01-28 11:42:33 +05:30
Jarvis Deploy
d499b14842 feat(routing): add per-account-channel-peer session scope
Adds a new dmScope option that includes accountId in session keys,
enabling isolated sessions per channel account for multi-bot setups.

- Add 'per-account-channel-peer' to DmScope type
- Update session key generation to include accountId
- Pass accountId through routing chain
- Add tests for new routing behavior (13/13 passing)

Closes #3094

Co-authored-by: Sebastian Almeida <89653954+SebastianAlmeida@users.noreply.github.com>
2026-01-28 11:42:33 +05:30
Ayaan Zaidi
93c2d65398 fix: restore discord username lookup and align minimax test (#3131) (thanks @bonald) 2026-01-28 11:04:07 +05:30
Jarvis
f897f17c6e test: update MiniMax API URL expectation to match #3064
The MiniMax provider config was updated to use api.minimax.chat
instead of api.minimax.io in PR #3064, but the test expectation
was not updated.

🤖 Generated with Claude Code
2026-01-28 11:04:07 +05:30
Jarvis
cd72b80011 fix(discord): add missing type exports and fix unused imports
- Re-export DirectoryConfigParams and ChannelDirectoryEntry from channels/targets
- Remove unused ChannelDirectoryEntry and resolveDiscordAccount imports
- Fix parseDiscordTarget calls to not pass incompatible options type
- Fix unused catch parameter

Fixes CI build failures on main.

🤖 Generated with Claude Code
2026-01-28 11:04:07 +05:30
Shadow
6fc3ca4996
CI: add auto-response labels 2026-01-27 23:17:22 -06:00
Shadow
61ab348dd3
Discord: fix target type imports 2026-01-27 22:56:12 -06:00
Shadow
b01612c262
Discord: gate username lookups 2026-01-27 22:48:18 -06:00
Ayaan Zaidi
14e4b88bf0 fix: keep telegram dm thread sessions (#2731) (thanks @dylanneve1) 2026-01-28 09:32:20 +05:30
Dylan Neve
915497114e fix(telegram): ignore message_thread_id for non-forum group sessions
Regular Telegram groups (without Topics/Forums enabled) can send
message_thread_id when users reply to messages. This was incorrectly
being used to create separate session keys like '-123:topic:42',
causing each reply chain to get its own conversation context.

Now resolveTelegramForumThreadId only returns a thread ID when the
chat is actually a forum (is_forum=true). For regular groups, the
thread ID is ignored, ensuring all messages share the same session.

DMs continue to use messageThreadId for thread sessions as before.
2026-01-28 09:32:20 +05:30
Gustavo Madeira Santana
8f452dbc08
Update wizard header with new ASCII art 2026-01-27 22:30:38 -05:00
Gustavo Madeira Santana
c5effb78f3
Modify CLI banner ASCII art
Updated the ASCII art for the CLI banner.
2026-01-27 22:29:09 -05:00
Shadow
d0ef4d3b85 fix: update Moonshot Kimi model references (#2762) (thanks @MarvinCui) 2026-01-27 21:10:59 -06:00
Boran Cui
b8aa041dcc Update Moonshot Kimi model references to kimi-k2.5 2026-01-27 21:10:59 -06:00
Boran Cui
394308076a Update Moonshot Kimi model references from kimi-k2-0905-preview to the latest kimi-k2.5 2026-01-27 21:10:59 -06:00
Shadow
7bfe6ab2d6 fix: resolve Discord usernames for outbound sends (#2649) (thanks @nonggialiang) 2026-01-27 21:05:37 -06:00
Shadow
cf827f03e8 tests: cover Discord username resolution 2026-01-27 21:05:37 -06:00
nonggia.liang
7958ead91a fix: resolve Discord usernames to user IDs for outbound messages
When sending Discord messages via cron jobs or the message tool,
usernames like "john.doe" were incorrectly treated as channel names,
causing silent delivery failures.

This fix adds a resolveDiscordTarget() function that:
- Queries Discord directory to resolve usernames to user IDs
- Falls back to standard parsing for known formats
- Enables sending DMs by username without requiring explicit user:ID format

Changes:
- Added resolveDiscordTarget() in targets.ts with directory lookup
- Added parseAndResolveRecipient() in send.shared.ts
- Updated all outbound send functions to use username resolution

Fixes #2627
2026-01-27 21:05:37 -06:00
Shadow
57d9c09f6e fix: expand Telegram polling network recovery (#3013) (thanks @ryancontent) 2026-01-27 19:56:24 -06:00
ryan
558b64f5fa fix: handle Telegram network errors gracefully to prevent gateway crashes
- Expand recoverable error codes (ECONNABORTED, ERR_NETWORK)
- Add message patterns for 'typeerror: fetch failed' and 'undici' errors
- Add isNetworkRelatedError() helper for broad network failure detection
- Retry on all network-related errors instead of crashing gateway
- Remove unnecessary 'void' from fire-and-forget patterns
- Add tests for new error patterns

Fixes #3005
2026-01-27 19:56:24 -06:00
Shadow
eb50314d7d fix: update MiniMax provider config (#3064) (thanks @hlbbbbbbb) 2026-01-27 19:48:38 -06:00