Commit graph

918 commits

Author SHA1 Message Date
Alex Gorevski
9de77df235
Merge pull request #1020 from zeroclaw-labs/fix/code-scanning-alerts
fix(security): address CodeQL code-scanning alerts
2026-02-19 16:36:29 -08:00
Alex Gorevski
36f971a3d0 fix(security): address CodeQL code-scanning alerts
- Extract hard-coded test vector keys into named constants in bedrock.rs
  and linq.rs to resolve rust/hard-coded-cryptographic-value alerts
- Replace derived Debug impls with manual impls that redact sensitive
  fields (access_token, refresh_token, credential, api_key) on
  QwenOauthCredentials, QwenOauthProviderContext, and
  ResolvedEmbeddingConfig to resolve rust/cleartext-logging alerts
- Redact Matrix user_id and device_id hints in tracing::warn! diagnostic
  messages via crate::security::redact() to resolve cleartext-logging
  alert in matrix.rs

Addresses CodeQL alerts: #77, #95-106

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 16:31:03 -08:00
Alex Gorevski
0f69464a1f
Merge pull request #1018 from zeroclaw-labs/test/fuzz-target-expansion
test(fuzz): add webhook, provider response, and command validation fuzz targets
2026-02-19 16:17:14 -08:00
Alex Gorevski
7d945aea6a
Merge pull request #1017 from zeroclaw-labs/test/peripherals-unit-tests
test(peripherals): add unit tests for peripheral module configuration and listing
2026-02-19 16:17:07 -08:00
Alex Gorevski
9d0ff54037
Merge pull request #1016 from zeroclaw-labs/test/improve-test-assertions
test(quality): replace bare .unwrap() with .expect() in agent and shell tests
2026-02-19 16:16:42 -08:00
Alex Gorevski
1708243470
Merge pull request #1015 from zeroclaw-labs/test/gateway-idempotency-tests
test(gateway): add edge-case idempotency store tests
2026-02-19 16:16:28 -08:00
Alex Gorevski
2a106d051a
Merge pull request #1013 from zeroclaw-labs/fix/docs-inline-code-comments
docs(code): add decision-point comments to agent loop, security policy, and reliable provider
2026-02-19 16:01:19 -08:00
Alex Gorevski
88a036304d
Merge pull request #1012 from zeroclaw-labs/fix/docs-collection-indexes
docs: enhance getting-started, hardware, and project collection indexes
2026-02-19 16:00:56 -08:00
Alex Gorevski
7d7362439e
Merge pull request #1011 from zeroclaw-labs/fix/docs-config-struct-fields
docs(code): add comprehensive doc comments to config schema public fields
2026-02-19 16:00:34 -08:00
Alex Gorevski
200ce0d6fd
Merge pull request #1010 from zeroclaw-labs/fix/docs-trait-doc-comments
docs(code): expand doc comments on security, observability, runtime, and peripheral traits
2026-02-19 15:59:56 -08:00
Alex Gorevski
9f93b8ef89
Merge pull request #1009 from zeroclaw-labs/fix/docs-multilingual-readme-parity
docs: add architecture, subscription auth, and memory system sections to multilingual READMEs
2026-02-19 15:59:25 -08:00
Alex Gorevski
c6de02b93b
Merge pull request #1008 from zeroclaw-labs/fix/docs-module-level-docs
docs(code): add module-level doc blocks to providers, channels, tools, and security
2026-02-19 15:58:56 -08:00
Argenis
96d5ae0c43
fix(composio): pick first usable account when multiple exist, add connected_accounts alias (#1003)
Root cause of #959: resolve_connected_account_ref returned None when the entity had more than one connected account for an app, silently dropping auto-resolve and causing every execute call to fail with 'cannot find connected account'. The LLM then looped re-issuing the OAuth URL even though the account was already connected.

- resolve_connected_account_ref now picks the first usable account (ordered by updated_at DESC from the API) instead of returning None when multiple accounts exist
- Add 'connected_accounts' as a dispatch alias for 'list_accounts' in handler, schema enum, and description
- 8 new regression tests

Closes #959
2026-02-19 17:19:04 -05:00
Alex Gorevski
867a7a5cbd test(gateway): add edge-case idempotency store tests
Add five new idempotency store tests covering: different-key acceptance,
max_keys clamping to minimum of 1, rapid duplicate rejection, TTL-based
key expiry and re-acceptance, and eviction preserving newest entries.
Addresses audit finding on weak gateway idempotency test coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:28:24 -08:00
Alex Gorevski
673697a43e test(peripherals): add unit tests for peripheral module configuration and listing
Add tests for list_configured_boards() covering enabled/disabled states and
empty/non-empty board configurations. Add test verifying create_peripheral_tools()
returns empty when peripherals are disabled. Addresses audit finding CRITICAL-1
for the untested peripherals module — covers all non-hardware-gated logic paths.

Fix pre-existing Windows build errors in config/schema.rs: make non-unix
sync_directory async and gate unix-only imports behind #[cfg(unix)].

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:28:22 -08:00
Alex Gorevski
22bd03c65a test(quality): replace bare .unwrap() with .expect() in agent and shell tests
Replace bare .unwrap() calls with descriptive .expect() messages in
src/agent/agent.rs and src/tools/shell.rs test modules. Adds meaningful
failure context for memory creation, agent builder, and tool execution
assertions. Addresses audit finding on test assertion quality (§5.2).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:23:33 -08:00
Alex Gorevski
d407eb61f0 test(fuzz): add webhook, provider response, and command validation fuzz targets
Add three new fuzz targets expanding coverage from 2 to 5 targets:
- fuzz_webhook_payload: fuzzes webhook body JSON deserialization
- fuzz_provider_response: fuzzes provider API response parsing
- fuzz_command_validation: fuzzes security policy command validation
Addresses audit findings for critical fuzz coverage gaps in gateway,
provider, and security subsystems.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:19:56 -08:00
Alex Gorevski
dd541bd7e4 docs(code): add decision-point comments to agent loop, security policy, and reliable provider
Adds section markers and decision-point comments to the three most complex
control-flow modules. Comments explain loop invariants, retry/fallback
strategy, security policy precedence rules, and error handling rationale.

This improves maintainability by making the reasoning behind complex
branches explicit for reviewers and future contributors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:19:53 -08:00
Alex Gorevski
eae8a99584 docs(code): add comprehensive doc comments to config schema public fields
Every public field in the Config struct hierarchy now has a /// doc comment
explaining its purpose, default value, and usage context. This ensures
operators and extension developers can understand config options directly
from rustdoc without cross-referencing the config reference documentation.

Comments are consistent with docs/config-reference.md descriptions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:19:52 -08:00
Alex Gorevski
25fd10a538 docs(code): expand doc comments on security, observability, runtime, and peripheral traits
The four underdocumented core trait files now include trait-level doc blocks
explaining purpose and architecture role, method-level documentation with
parameter/return/error descriptions, and public struct/enum documentation.

This brings parity with the well-documented provider, channel, tool, and
memory traits, giving extension developers clear guidance for implementing
these core extension points.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:19:46 -08:00
Alex Gorevski
6d4bfb73ba docs: add architecture, subscription auth, and memory system sections to multilingual READMEs
The English README contains architecture overview (diagram + trait table),
subscription auth setup (OAuth flow + examples), and memory system design
(vector + FTS5 hybrid search) sections that were missing from the Chinese,
Japanese, and Russian translations.

This closes the content parity gap identified in the documentation audit,
ensuring non-English speakers have access to the same critical architectural
context and setup guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:19:46 -08:00
Alex Gorevski
4a7dff6ef1 docs(code): add module-level doc blocks to providers, channels, tools, and security
Each major subsystem mod.rs now includes a //! doc block explaining the
subsystem purpose, trait-driven architecture, factory registration pattern,
and extension guidance. This improves the generated rustdoc experience for
developers navigating ZeroClaw's modular architecture.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:19:46 -08:00
Alex Gorevski
3b471e74b7 docs: enhance getting-started, hardware, and project collection indexes
Adds onboarding decision tree to getting-started/README.md so users can
quickly identify the right setup command for their situation.

Adds hardware vision overview to hardware/README.md explaining the
Peripheral trait and supported board types.

Expands project/README.md with scope explanation describing the purpose
of project snapshots and how they relate to documentation maintenance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 13:04:11 -08:00
Alex Gorevski
bec1dc7b8c
Merge pull request #994 from zeroclaw-labs/algore/merge_fix
fix: resolve merge conflict in pull request template
2026-02-19 12:55:23 -08:00
Alex Gorevski
d22adb21e6 fix: resolve merge conflict in pull request template
Remove merge conflict markers in .github/pull_request_template.md,
keeping the spaced module label format (\<module>: <component>\)
from the chore/labeler-spacing-trusted-tier branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 12:54:42 -08:00
Alex Gorevski
835d51d7e1
Merge pull request #971 from zeroclaw-labs/docs/social-telegram-cn-ru-channels
docs(readme): add Telegram CN/RU channels to media matrix
2026-02-19 12:51:04 -08:00
Alex Gorevski
229f826656
Merge pull request #969 from zeroclaw-labs/docs/homebrew-install-readme
docs(readme): add Homebrew install instructions
2026-02-19 12:50:41 -08:00
Alex Gorevski
141d483aa4
Merge pull request #987 from ecschoye/fix/openrouter-embedding-provider
fix(memory): add openrouter as recognized embedding provider
2026-02-19 12:47:25 -08:00
Edvard
832facf5ef fix(memory): add openrouter as recognized embedding provider
The embedding provider factory only recognized "openai" and "custom:*",
causing "openrouter" to silently fall through to NoopEmbedding. This
made vector/semantic search completely non-functional — memory recall
fell back to BM25 keyword-only matching, with 70% of the hybrid score
always returning zero.

Route "openrouter" through OpenAiEmbedding with the OpenRouter API base
URL (https://openrouter.ai/api/v1), which is OpenAI-compatible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:10:25 -05:00
Alex Gorevski
007e9fa7ea
Merge pull request #984 from zeroclaw-labs/fix/improve-config-error-messages
fix(errors): improve config error messages with section paths and remediation hints
2026-02-19 11:56:45 -08:00
Alex Gorevski
9ab2b7be61
Merge pull request #983 from zeroclaw-labs/fix/env-example-missing-vars
docs(env): add missing environment variables to .env.example
2026-02-19 11:55:36 -08:00
Alex Gorevski
b6f99c31d1
Merge pull request #982 from zeroclaw-labs/fix/cli-help-text-improvements
docs(cli): add detailed help text and examples to complex subcommands
2026-02-19 11:54:38 -08:00
Alex Gorevski
f308353ab2
Merge pull request #981 from zeroclaw-labs/fix/config-validation-on-load
fix(config): add startup validation to catch invalid config values early
2026-02-19 11:52:57 -08:00
Alex Gorevski
63f3c5fe6d
Merge pull request #980 from zeroclaw-labs/fix/config-reference-missing-sections
docs(config): add missing config sections to config-reference.md
2026-02-19 11:51:31 -08:00
Alex Gorevski
b84f0e1956
Merge pull request #979 from zeroclaw-labs/fix/cli-argument-range-validation
fix(cli): add range validation for temperature argument
2026-02-19 11:50:08 -08:00
Alex Gorevski
39a09f007b fix(cli): add range validation for temperature argument
Add a custom value_parser for the --temperature CLI argument to enforce
the documented 0.0-2.0 range at parse time. Previously, the comment
stated the valid range but clap did not reject out-of-range values,
allowing invalid temperatures to propagate to provider API calls.

- Add parse_temperature() validator that rejects values outside 0.0..=2.0
- Wire it into the Agent subcommand's temperature arg via value_parser

Addresses API surface audit §2.3 (CLI argument range validation).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 11:45:12 -08:00
Alex Gorevski
cc07cb66c3 fix(errors): improve config error messages with section paths and remediation hints
Improve vague error messages in channel initialization and tool setup
to include specific config key paths and remediation steps, matching
the quality standard set by proxy validation errors.

Changes:
- telegram.rs: Include [channels.telegram] section path and required
  fields (bot_token, allowed_users) in missing-config error; add
  onboard hint; specify channels.telegram.allowed_users in pairing
  message; improve parse error context
- whatsapp.rs: Specify channels.whatsapp.allowed_numbers key path
  in unauthorized-number warning
- linq.rs: Specify channels.linq.allowed_senders key path in
  unauthorized-sender warning; add onboard hint
- web_search_tool.rs: Include tools.web_search.provider config path
  and valid values in unknown-provider error

Addresses API surface audit §8.2 (config context in error messages).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 11:44:04 -08:00
Alex Gorevski
9f1a306962 docs(cli): add detailed help text and examples to complex subcommands
Add long_about attributes with usage examples to the following commands:

src/main.rs (binary CLI):
- Agent: interactive/single-message modes, provider/peripheral options
- Gateway: port/host binding with examples
- Daemon: full runtime explanation with service install reference
- Cron: cron expression format, timezone handling, all scheduling modes
- Channel: supported types, JSON config format, bind-telegram
- Hardware: discover, introspect, info subcommands
- Peripheral: add, flash, board types
- Config: schema export

src/lib.rs (library enums):
- CronCommands::Add: cron syntax and timezone examples
- CronCommands::AddAt: RFC 3339 timestamp format
- CronCommands::AddEvery: interval in milliseconds
- CronCommands::Once: human-readable duration syntax
- CronCommands::Update: partial field update
- ChannelCommands::Add: JSON config and supported types
- ChannelCommands::BindTelegram: username/numeric ID format
- HardwareCommands::Discover, Introspect, Info: device paths and chip names
- PeripheralCommands::Add: board types and transport paths
- PeripheralCommands::Flash: serial port options

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 11:42:31 -08:00
Alex Gorevski
99cf2fdfee fix(config): add startup validation to catch invalid config values early
Add Config::validate() called from load_or_init() after env overrides
are applied. This catches obviously invalid configuration values at
startup instead of allowing them to silently cause runtime failures.

Validated fields:
- gateway.host: must not be empty
- autonomy.max_actions_per_hour: must be > 0
- scheduler.max_concurrent: must be > 0
- scheduler.max_tasks: must be > 0
- model_routes[*]: hint, provider, model must not be empty
- embedding_routes[*]: hint, provider, model must not be empty
- proxy: delegates to existing ProxyConfig::validate()

Previously, ProxyConfig::validate() was only called during
apply_env_overrides() and only warned/disabled on failure. The new
Config::validate() runs it as a hard error after all overrides are
resolved, ensuring proxy misconfiguration is surfaced early.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 11:37:30 -08:00
Alex Gorevski
753e90e0e7 docs(config): add missing config sections to config-reference.md
Add documentation for config schema sections that were undocumented:

- [cost] — daily/monthly spending limits and cost tracking
- [identity] — AIEOS / OpenClaw identity format
- [hardware] — hardware wizard config (STM32, serial, probe)
- [peripherals] — peripheral board configurations (STM32, RPi GPIO)
- [browser] — browser automation backend config
- [browser.computer_use] — computer-use sidecar endpoint config
- [http_request] — HTTP request tool config
- [agents.<name>] — delegate sub-agent configurations
- [query_classification] — automatic model hint routing

Also expanded existing sections:
- [agent] — added compact_context, max_history_messages, parallel_tools, tool_dispatcher
- [[model_routes]] — added field reference table
- [[embedding_routes]] — added field reference table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 11:34:48 -08:00
Alex Gorevski
7feb57ad53 docs(env): add missing environment variables to .env.example
Add env vars from apply_env_overrides() that were absent from .env.example:

- ZEROCLAW_REASONING_ENABLED / REASONING_ENABLED (reasoning mode)
- ZEROCLAW_STORAGE_PROVIDER (storage backend override)
- ZEROCLAW_STORAGE_DB_URL (remote storage connection URL)
- ZEROCLAW_STORAGE_CONNECT_TIMEOUT_SECS (storage connect timeout)
- ZEROCLAW_PROXY_ENABLED (proxy toggle)
- ZEROCLAW_HTTP_PROXY (HTTP proxy URL)
- ZEROCLAW_HTTPS_PROXY (HTTPS proxy URL)
- ZEROCLAW_ALL_PROXY (SOCKS/universal proxy URL)
- ZEROCLAW_NO_PROXY (proxy bypass list)
- ZEROCLAW_PROXY_SCOPE (proxy scope: environment|zeroclaw|services)
- ZEROCLAW_PROXY_SERVICES (service selector for scoped proxy)

Resolves audit finding §6.3.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 11:31:43 -08:00
Alex Gorevski
77609777ab
Merge pull request #951 from zeroclaw-labs/fix/per-client-pairing-lockout
fix(security): change pairing lockout to per-client accounting
2026-02-19 11:26:46 -08:00
Chummy
f7076183b9 docs(readme): add Telegram CN and RU channels to media matrix 2026-02-20 02:19:05 +08:00
Chummy
3733856093 Fix skill instruction/tool injection in system prompts 2026-02-20 02:16:41 +08:00
Nikolay Vyahhi
315985199b docs(readme): add Homebrew install instructions 2026-02-19 13:03:32 -05:00
Chummy
f2ffd653de fix(channel): preserve trailing user turn in normalization 2026-02-20 02:01:42 +08:00
Chummy
c5834b1077 fix(channel): normalize telegram history for MiniMax 2026-02-20 02:01:42 +08:00
Chummy
7173045f1c docs(readme): sync social badges to translated READMEs 2026-02-20 01:56:41 +08:00
Chummy
132a6b70e0 docs(readme): add X, Xiaohongshu, and Telegram media badges 2026-02-20 01:56:41 +08:00
Chummy
13dce49a5e docs(readme): add official Reddit badge and channel link 2026-02-20 01:56:41 +08:00