Commit Graph

1267 Commits

Author SHA1 Message Date
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
xj
a381963623
fix(ci): stabilize post-2142 local quality gates (COM-2142) (#2171)
* chore(ci): retrigger PR checks after intake body update

* fix(ci): stabilize local quality gates on rebased main

---------

Co-authored-by: Chummy <chumyin0912@gmail.com>
Co-authored-by: xj <gh-xj@users.noreply.github.com>
2026-02-27 23:18:25 -08:00
Preventnetworkhacking
479b6da4ce feat(cost): wire provider token usage to cost tracking (#2111)
Implement CostObserver that intercepts LlmResponse observer events and
records token usage to the CostTracker with proper cost calculations.

Changes:
- Add src/observability/cost.rs: CostObserver implementation
  - Listens for LlmResponse events with token counts
  - Looks up model pricing from CostConfig (with fallback defaults)
  - Records usage via CostTracker.record_usage()
  - Includes model family matching for pricing lookups

- Update src/observability/mod.rs:
  - Export CostObserver
  - Add create_observer_with_cost_tracking() helper that wraps base
    observer with CostObserver when cost tracking is enabled

- Update src/gateway/mod.rs:
  - Use create_observer_with_cost_tracking() to wire cost observer
    into the gateway observer stack when config.cost.enabled is true

The /api/cost endpoint already exists and will now return accurate
session/daily/monthly cost data populated by the CostObserver.

Resolves #2111
2026-02-28 02:00:13 -05:00
Argenis
43e3e9b897
Merge pull request #2134 from Preventnetworkhacking/feat/economic-agents-mvp
feat(economic): ZeroClaw Economic Agents - Phase 1 Foundation [CDV-20]
2026-02-28 01:29:57 -05:00
Argenis
7b1c63cf27
Merge pull request #2157 from zeroclaw-labs/feat/providers-sf-volcengine
feat: integrate Volcengine ARK and SiliconFlow providers
2026-02-28 01:28:09 -05:00
Argenis
e620a63fee
Merge pull request #1973 from zeroclaw-labs/supersede-pr-1879-20260226144348-3162467-theirs
[supersede #1879] fix(approvals): clear non-cli exclusions when approving tools
2026-02-28 01:27:46 -05:00
Argenis
0d695746e6
Merge pull request #1968 from zeroclaw-labs/supersede-pr-1853-20260226143137-2982344-theirs
[supersede #1853] feat(tools): add Feishu document operation tool with 13 actions
2026-02-28 01:27:41 -05:00
argenis de la rosa
f0d091d348 fix(cron): filter NO_REPLY sentinel in delivery paths 2026-02-28 01:26:43 -05:00
Preventnetworkhacking
a2f1f09364 feat(economic): add TaskClassifier for BLS occupation-based task valuation
Phase 2 of ClawWork integration. Implements:
- TaskClassifier with 44 BLS occupations and wage data
- OccupationCategory enum (Tech/Business/Healthcare/Legal)
- Keyword-based classification with confidence scoring
- Hours estimation based on instruction complexity
- Fuzzy matching for occupation lookup

Reference: ClawWork/clawmode_integration/task_classifier.py
2026-02-27 22:26:04 -08:00
reidliu41
6662601a6c feat(agent): add result-aware loop detection for tool-call loop 2026-02-28 00:58:31 -05:00
Chummy
e57173333f test(dingtalk): add onboarding regression coverage 2026-02-28 00:58:30 -05:00
Chummy
da1f805cf7
test(providers): harden Volcengine/SiliconFlow alias coverage 2026-02-28 05:55:31 +00:00
Chummy
1b82597eac fix(codex): harden transport validation and fallback 2026-02-28 13:48:41 +08:00
Chummy
81387f9896 fix(codex): preserve transport overrides across runtimes 2026-02-28 13:48:41 +08:00
Chummy
b721754ead feat(codex): add websocket-first transport selection 2026-02-28 13:48:41 +08:00
Preventnetworkhacking
055e9b7b31 fix: remove trailing whitespace from economic module 2026-02-27 21:42:19 -08:00
Chummy
f3f44c48f4
feat(providers): integrate Volcengine ARK and SiliconFlow
Add SiliconFlow provider factory support and alias/env handling.

Normalize onboarding UX to volcengine while preserving doubao/ark runtime aliases.

Add integration registry entries and provider resolution coverage tests.

Expand provider and command docs with setup and validation examples.
2026-02-28 05:25:15 +00:00
argenis de la rosa
1a0bb175f2 fix(agent): retry deferred tool follow-through in CJK contexts 2026-02-27 22:48:51 -05:00
argenis de la rosa
684503f5fc feat(onboard): add GitHub Copilot to interactive wizard 2026-02-27 21:34:40 -05:00
Preventnetworkhacking
b238e8fd5e feat(config): add economic agent configuration schema
Adds EconomicConfig to config schema:

- enabled: bool (default false, opt-in)
- initial_balance: f64 (default 1000.0)
- signature: String (agent identifier)
- data_path: PathBuf (persistence location)
- token_pricing: EconomicTokenPricing
  - input_price_per_million: f64 (default 3.0)
  - output_price_per_million: f64 (default 15.0)
- min_evaluation_threshold: f64 (default 0.6)

Integrates with existing config loading and onboard wizard.

Relates to: CDV-20
2026-02-27 15:54:58 -08:00
Preventnetworkhacking
9798b34f8d feat(economic): add ClawWork economic tracking module
Phase 1 of ZeroClaw Economic Agents (CDV-20):

## New Module: src/economic/

- **tracker.rs** (995 lines): EconomicTracker with balance management,
  token cost tracking, income ledger, and JSONL persistence
- **status.rs** (212 lines): SurvivalStatus enum with 5 states
  (Thriving/Stable/Struggling/Critical/Bankrupt)
- **costs.rs** (369 lines): TokenCostAccumulator for multi-channel
  cost tracking (LLM, search, OCR, etc.)
- **mod.rs** (81 lines): Module exports with comprehensive docs

## Features

- Track agent balance and economic health
- Configurable token pricing (input/output per million)
- Task-level cost isolation with start_task/end_task
- Work income with quality threshold (0.6 default)
- Persistent ledger (balance.jsonl, token_costs.jsonl)
- Daily cost aggregation

## Next Steps

- Phase 2: Task classifier (44 occupations)
- Phase 3: Work evaluator (LLM scoring)
- Phase 4: Economic tools (decide_activity, submit_work, etc.)

Relates to: CDV-20, Discussion #2132
2026-02-27 15:54:47 -08:00