Commit Graph

1288 Commits

Author SHA1 Message Date
Argenis
2f1380a03f
Merge pull request #2064 from peitschie/fix/cron-matrix-delivery
RMN-218: feat(channels): add matrix integration for sovereign communication
2026-02-28 12:05:26 -05:00
weykon
9ecb8dffa6 feat(memory): add sqlite_journal_mode config for shared filesystem support
SQLite WAL mode requires shared-memory (mmap/shm) which is unavailable
on many network and virtual shared filesystems (NFS, SMB/CIFS,
UTM/VirtioFS, VirtualBox shared folders), causing xShmMap I/O errors
at startup.

Add `sqlite_journal_mode` config option under `[memory]` that accepts
"wal" (default) or "delete". When set to "delete", SQLite uses the
legacy DELETE journal mode and disables mmap, allowing ZeroClaw to run
with workspaces on shared/network filesystems.

Usage:
  [memory]
  sqlite_journal_mode = "delete"

Changes:
- config/schema.rs: Add sqlite_journal_mode field to MemoryConfig
- memory/sqlite.rs: Add with_options() supporting journal mode selection
- memory/mod.rs: Pass journal_mode from config to SqliteMemory
- onboard/wizard.rs: Include new field in default MemoryConfig
2026-02-28 12:04:46 -05:00
loydccc
2044e828de fix(channel): mark discord inbound image attachments as [IMAGE]
# Conflicts:
#	src/channels/discord.rs
2026-02-28 11:57:17 -05:00
argenis de la rosa
b287b2420a fix(cron): avoid merge conflict in matrix scheduler tests 2026-02-28 11:48:22 -05:00
Chummy
3aa1eb1fd5 chore(fmt): normalize rustfmt output to satisfy quality gate 2026-03-01 00:45:18 +08:00
argenis de la rosa
74c8cae95d fix(quota): wire provider quota modules on main replay 2026-02-28 11:45:02 -05:00
ZeroClaw Bot
5ac9c3e955 fix(quota): address CodeRabbit review feedback
- Fix low-quota warning format string readability (parenthesized percentage)
- Add QuotaFormat enum for CLI --format validation (fail-fast on invalid input)
- Fix backoff eviction strategy comments (soonest-to-expire, not LRU)
- Custom Default for ProviderUsageMetrics (last_reset_at = Utc::now())
- Fix fail_count==0 always-fail case in stress test
- Add providers-quota to commands-reference.md
- Document fresh ProviderHealthTracker intent in quota_tools.rs

Made-with: Cursor
2026-02-28 11:45:02 -05:00
ZeroClaw Bot
d5fe47acff feat(tools): wire auth_profile + quota tools into agent loop and persist switch_provider
- Register 4 new tools (ManageAuthProfileTool, CheckProviderQuotaTool,
  SwitchProviderTool, EstimateQuotaCostTool) in all_tools_with_runtime
- SwitchProviderTool now loads config from disk and calls save() to
  persist default_provider/default_model to config.toml
- Inject Provider & Budget Context section into system prompt when
  Config is available
- Remove emoji from tool output for cleaner parsing
- Replace format! push_str with std::fmt::Write for consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:45:02 -05:00
ZeroClaw Bot
8c0be20422 feat(providers): add quota_metadata to ChatResponse across all providers
Wire QuotaMetadata into ChatResponse for all provider implementations,
enabling quota tracking data to flow from API responses through the
agent loop to quota monitoring tools.

Depends on: circuit breaker (#1842) + quota monitoring (#1904)

Made-with: Cursor
2026-02-28 11:45:02 -05:00
ZeroClaw Bot
247d89e39e feat(providers): implement quota monitoring system with CLI and agent tools
Add comprehensive quota monitoring: QuotaMetadata types, quota-aware
agent loop with proactive warnings, CLI providers-quota command, and
3 built-in tools (check_provider_quota, switch_provider,
estimate_quota_cost).

Depends on: circuit breaker + provider health (#1842)

Made-with: Cursor
2026-02-28 11:45:02 -05:00
argenis de la rosa
e854238a39 fix(channels): resolve main drift for matrix cron delivery 2026-02-28 11:44:21 -05:00
Chummy
cf59171937 test: align channel context defaults and de-flake proxy assertion 2026-02-28 23:01:53 +08:00
Chummy
a89f5c25be fix: resolve rebase drift in channel approval runtime 2026-02-28 23:01:53 +08:00
Chummy
42471f4d3e fix: restore ws query-token fallback and telegram test fixtures 2026-02-28 23:01:53 +08:00
Chummy
be8f7efe82 test: stabilize flaky threshold assertions 2026-02-28 23:01:53 +08:00
Chummy
5ee6024914 Fix channel turn persistence and low-sensitivity leak detection 2026-02-28 23:01:53 +08:00
Tim Stewart
f1adc79f38 fix(browser): add return before snapshot IIFE in rust_native backend
WebDriver's execute() wraps the script as a function body. The snapshot
script used an IIFE without a top-level return, so the IIFE's return
value was discarded and the WebDriver function returned undefined (null).

All other execute() calls in the file (scroll, scrollIntoView, click)
correctly use explicit return statements.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 09:27:42 -05:00
argenis de la rosa
b9d9798774 fix: resolve compilation errors in channels, tools, and gateway modules 2026-02-28 09:18:30 -05:00
argenis de la rosa
bb25e5fbf6 fix(tests): align channel runtime fixtures for main compatibility 2026-02-28 09:17:35 -05:00
Chummy
5cced82e3f fix(channels): import ApprovalResponse for runtime approval handling 2026-02-28 21:58:52 +08:00
argenis de la rosa
57fd23c381 fix: resolve 3 compilation errors 2026-02-28 08:54:29 -05:00
argenis de la rosa
a029c720a6 feat(security): add safety heartbeat reinjection with cadence fixes 2026-02-28 08:52:16 -05:00
Chummy
3341608d52 fix(channels): remove duplicate perplexity snapshot helper 2026-02-28 21:49:11 +08:00
Chummy
aa401f29c3 fix(channels): restore pending approval flow and docx tool export 2026-02-28 21:49:11 +08:00
Chummy
1509cc5b69 fix(telegram): unify mention gate and typing target handling 2026-02-28 21:49:11 +08:00
argenis de la rosa
62b719c447 fix(gateway): allow ws query fallback without subprotocol header 2026-02-28 08:36:18 -05:00
Chummy
d9cdaa0757 fix: resolve post-rebase compile and test stability issues 2026-02-28 21:30:37 +08:00
Chummy
51ad52d0e8 security: harden sensitive I/O and outbound leak controls 2026-02-28 21:30:37 +08:00
ake117
87fa327e0d feat(telegram): add ack_enabled option to control emoji reactions
Add configuration option to enable/disable Telegram emoji reaction
acknowledgments (️, 👌, 👀, 🔥, 👍) sent to incoming messages.

Changes:
- Add ack_enabled field to TelegramConfig (default: true)
- Add ack_enabled field to TelegramChannel struct
- Add with_ack_enabled() builder method
- Conditionally send reactions in try_add_ack_reaction_nonblocking()
- Update all call sites and tests
- Update documentation with usage example

Usage:
  [channels_config.telegram]
  ack_enabled = false  # Disable emoji reactions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 08:23:04 -05:00
Chummy
61e738287b chore(ws): mention query token auth in unauthorized hint 2026-02-28 21:21:33 +08:00
Chummy
2a865ac713 chore(gateway): remove unused ws chat artifacts 2026-02-28 21:21:33 +08:00
Chummy
32205fb038 fix(gateway): accept websocket token query fallback 2026-02-28 21:21:33 +08:00
Chummy
5ca656be07 fix(qq): keep sender-level history across messages 2026-02-28 08:19:23 -05:00
Argenis
58cf5b4cf3
Merge pull request #2197 from zeroclaw-labs/issue-2175
fix(build): restore missing runtime approval and docx symbols
2026-02-28 08:17:22 -05:00
Chummy
bebb881b5b fix(android): harden Termux source-build and wasm-tools fallback 2026-02-28 21:16:52 +08:00
argenis de la rosa
40de96ed77 fix(build): resolve main conflict for runtime approval wiring 2026-02-28 08:14:34 -05:00
argenis de la rosa
f0a5bbdb1b feat(http_request): add env credential profiles and onboarding guards 2026-02-28 08:07:37 -05:00
Chummy
46b50cbb49 fix: reconcile supersede replay with current main runtime 2026-02-28 20:56:09 +08:00
Jaime Linares
a88d37f3cb fix(whatsapp-web): strip MIME parameters before matching in audio_mime_to_filename
MIME strings like 'audio/webm; codecs=opus' were incorrectly matched by
the 'opus' branch (contains-check) before reaching the 'webm' branch,
returning 'voice.opus' instead of 'voice.webm'. This could cause the
Groq Whisper API to reject or misidentify the file format.

Fix: split on ';' to extract only the base MIME type, then match
exhaustively. Also add 'audio/x-wav' as a wav alias.

Adds a regression test: audio_mime_to_filename('audio/webm; codecs=opus')
must return 'voice.webm'.

Reported by CodeRabbit in PR review.

(cherry picked from commit 84861c727a)
2026-02-28 20:56:09 +08:00
Jaime Linares
f8eef67a03 feat(whatsapp-web): transcribe voice messages via Groq Whisper
Audio/voice messages on the WhatsApp Web channel were silently dropped
because `text_content()` returns an empty string for non-text messages
and no transcription path existed (unlike the Telegram channel which
already uses `transcription::transcribe_audio()`).

Changes:

- **Cargo.toml**: Move `qrcode` and all `wa-rs-*` crates out of the
  `[target.'cfg(any(linux|macos|windows))'.dependencies]` section into
  the unconditional `[dependencies]` section.  All affected crates are
  `optional = true`, so they add no compile cost unless
  `--features whatsapp-web` is active.  The previous placement caused
  Cargo to exclude them when targeting `android` (target_os = "android"
  does not match the cfg predicate), producing E0433 unresolved-crate
  errors for every wa-rs import in `whatsapp_web.rs` and
  `whatsapp_storage.rs` on Android cross-compilation.

- **whatsapp_web.rs**:
  - Add `transcription: Option<TranscriptionConfig>` field.
  - Add `with_transcription()` builder (mirrors `TelegramChannel`).
  - Add `audio_mime_to_filename()` helper mapping WhatsApp MIME types
    (e.g. `audio/ogg; codecs=opus`) to filenames the Groq Whisper API
    accepts.
  - Extend `Event::Message` handler: when text is empty, check
    `msg.audio_message`; download and decrypt audio via
    `client.download(audio_msg.as_ref())` (`.as_ref()` required because
    prost boxes nested proto fields as `Box<AudioMessage>`, which does
    not itself implement `Downloadable`); forward decrypted bytes to
    `transcription::transcribe_audio()`.
  - Add three unit tests: builder enable/disable guard and MIME mapping.

- **mod.rs**: Chain `.with_transcription(config.transcription.clone())`
  onto `WhatsAppWebChannel::new(...)` in the `"web"` factory branch so
  transcription is active whenever the global `[transcription]` section
  is enabled.

Activation: set `[transcription] enabled = true` and export
`GROQ_API_KEY` in the environment.

(cherry picked from commit 325241aeb6)
2026-02-28 20:56:09 +08:00
Chummy
6b89446b46
test(tools): guard docx_read registration in all_tools 2026-02-28 12:51:17 +00:00
argenis de la rosa
006eb4b9c2 fix(delivery): handle HEARTBEAT_OK sentinel case-insensitively 2026-02-28 07:31:45 -05:00
cyberpapi
4fe18d3548 fix(telegram): redact raw response body in register_commands error log
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:59:22 +08:00
cyberpapi
1177a83e4a feat(telegram): register bot commands with setMyCommands on startup
Register /new, /model, and /models commands with Telegram's Bot API
on startup so they appear in the command menu for users. Registration
is non-fatal — if the API call fails, a warning is logged and the
bot continues listening normally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:59:22 +08:00
cyberpapi
9125651775 fix(telegram): log specific deleteMessage failure reason in finalize_draft
Split the catch-all `_` match arm on the deleteMessage result into
separate `Ok(r)` and `Err(e)` arms so that HTTP status codes and
network errors are logged individually. The response body is not
logged (security policy).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:59:20 +08:00
cyberpapi
b2fc063d88 fix(telegram): prevent duplicate messages in finalize_draft fallback
When editMessageText returns 'message is not modified', the draft
already contains the correct content from update_draft. Detect this
Telegram API response and treat it as success rather than falling
through to the delete+send fallback, which would create a visible
duplicate message.

Also guard the final fallback: only send a new message after
successfully deleting the draft. If deleteMessage fails, the draft
still shows the response text, so sending would create a duplicate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:59:20 +08:00
Chummy
dea0d5e447
fix(build): restore missing runtime approval and docx symbols 2026-02-28 11:37:46 +00:00
Chummy
7470bded5d fix: harden browser and web search validation paths 2026-02-28 15:50:06 +08:00
Chummy
6716391502 feat: harden web access policy and add flexible web search/runtime config 2026-02-28 15:50:06 +08:00
killf
955c572c02 feat(tools): add Chrome/Firefox/Edge support to browser_open tool
Add support for Chrome, Firefox, and Edge browsers to the browser_open tool,
which previously only supported Brave. Users can now specify the browser
via the browser_open config option.

Changes:
- Add browser_open config field: "disable" | "brave" | "chrome" | "firefox" | "edge" | "default"
- Implement platform-specific launch commands for Chrome, Firefox, and Edge
- When set to "disable", only the browser automation tool is registered, not the browser_open tool
- Update tool descriptions and error messages to reflect browser selection

Co-Authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 15:50:06 +08:00