Commit graph

268 commits

Author SHA1 Message Date
Chummy
dfe648d5ae
chore(ci): establish PR governance for agent collaboration (#177)
* chore(ci): establish PR governance for agent collaboration

* docs: add AGENTS playbook and strengthen agent collaboration workflow

---------

Co-authored-by: chumyin <183474434+chumyin@users.noreply.github.com>
2026-02-15 12:41:16 -05:00
Argenis
dca95cac7a
fix: add channel message timeouts, Telegram fallback, and fix identity/observer tests
Closes #184
2026-02-15 12:31:40 -05:00
Chummy
be6474b815
feat(runtime): add Docker runtime MVP and runtime-aware command builder (#186)
Co-authored-by: chumyin <chumyin@users.noreply.github.com>
2026-02-15 12:24:10 -05:00
Chummy
91e17dfdcf
feat(security): add shell risk classification, approval gates, and action throttling (#187)
* feat(runtime): add Docker runtime MVP and runtime-aware command builder

* feat(security): add shell risk classification, approval gates, and action throttling

---------

Co-authored-by: chumyin <chumyin@users.noreply.github.com>
2026-02-15 12:23:23 -05:00
Chummy
9e55ab0cb8
feat(gateway): add per-endpoint rate limiting and webhook idempotency (#188)
* feat(runtime): add Docker runtime MVP and runtime-aware command builder

* feat(security): add shell risk classification, approval gates, and action throttling

* feat(gateway): add per-endpoint rate limiting and webhook idempotency

---------

Co-authored-by: chumyin <chumyin@users.noreply.github.com>
2026-02-15 12:19:39 -05:00
Chummy
b0e1e32819
feat(config): make config writes atomic with rollback-safe replacement (#190)
* feat(runtime): add Docker runtime MVP and runtime-aware command builder

* feat(security): add shell risk classification, approval gates, and action throttling

* feat(gateway): add per-endpoint rate limiting and webhook idempotency

* feat(config): make config writes atomic with rollback-safe replacement

---------

Co-authored-by: chumyin <chumyin@users.noreply.github.com>
2026-02-15 12:18:45 -05:00
Argenis
f1e3b1166d
feat: implement AIEOS identity support (#168)
Fixes #168

AIEOS (AI Entity Object Specification) v1.1 is now fully supported.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 11:46:02 -05:00
Argenis
1cfc63831c
feat(providers): add multi-model router for task-based provider routing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 11:40:58 -05:00
Argenis
eadeffef26
fix: correct Z.AI API endpoint to prevent 404 errors
Update Z.AI base URL to https://api.z.ai/api/coding/paas/v4
2026-02-15 11:28:33 -05:00
Argenis
716fb382ec
fix: correct API endpoints for z.ai, opencode, and glm providers (#167)
Fixes #167

- z.ai: https://api.z.aihttps://api.z.ai/api/paas/v4
- opencode: https://api.opencode.aihttps://opencode.ai/zen/v1  
- glm: https://open.bigmodel.cn/api/paashttps://open.bigmodel.cn/api/paas/v4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 11:22:03 -05:00
Argenis
b8c6937fbc
feat(agent): wire Composio tool into LLM tool descriptions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 11:17:28 -05:00
Argenis
20f857a55a
feat(dev): add containerized development environment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 11:10:45 -05:00
Argenis
128b30cdf1
fix: install default Rustls crypto provider to prevent TLS initialization error
Install ring-based crypto provider at startup to fix Rustls TLS initialization error
2026-02-15 11:10:28 -05:00
Argenis
ced4d70814
feat(channels): wire up email channel (IMAP/SMTP) into config and registration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:58:30 -05:00
Argenis
efe7ae53ce
fix: use UTF-8 safe truncation in bootstrap file preview
Fix panic when displaying workspace files containing multibyte UTF-8 characters by using char_indices().nth() to find safe character boundaries
2026-02-15 10:36:03 -05:00
Argenis
a5241f34ea
fix(discord): track gateway sequence number and handle reconnect opcodes (#159)
* feat(providers): add provider-aware API key resolution

- Add resolve_api_key() function that checks provider-specific env vars first
- For Anthropic, checks ANTHROPIC_OAUTH_TOKEN before ANTHROPIC_API_KEY
- Falls back to generic ZEROCLAW_API_KEY and API_KEY env vars
- Update create_provider() to use resolved_key instead of raw api_key
- Trim and filter empty strings from input keys

This enables setup-token support for Anthropic by checking ANTHROPIC_OAUTH_TOKEN
before ANTHROPIC_API_KEY when resolving credentials.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(providers): add Anthropic setup-token support

- Rename api_key field to credential for clarity
- Add is_setup_token() method to detect setup-token format (sk-ant-oat01-)
- Add input trimming and empty string filtering
- Use Bearer auth for setup-tokens, x-api-key for regular API keys
- Update error message to mention both ANTHROPIC_API_KEY and ANTHROPIC_OAUTH_TOKEN
- Add test for setup-token detection
- Add test for whitespace trimming in new()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: skip serialization of config_path and workspace_dir to prevent save() failures

The config_path and workspace_dir fields are computed paths that should not be
serialized to the config file. When loading from TOML, these fields would be
deserialized as empty paths (or stale paths), causing save() to fail with
"Failed to write config file".

Fixes #112

Changes:
- Add #[serde(skip)] to config_path and workspace_dir fields
- Set computed paths in load_or_init() after deserializing from TOML

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(discord): track gateway sequence number and handle reconnect opcodes

Three Discord Gateway issues fixed:

1. **Heartbeat sent `null` sequence** — Per Discord docs, the Gateway may
   disconnect bots that don't include the last sequence number in heartbeats.
   Now tracked via `sequence: i64` and included in every heartbeat.

2. **Dispatch sequence ignored** — The `s` field from dispatch events was
   never stored. Now extracted and tracked from every event.

3. **Opcodes 7/9 silently ignored** — Reconnect (op 7) and Invalid Session
   (op 9) caused the bot to hang on a dead connection. Now breaks the event
   loop so the daemon supervisor can restart the channel cleanly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(memory): use SHA-256 for embedding cache keys instead of DefaultHasher

- Replace DefaultHasher with SHA-256 for deterministic cache keys
- DefaultHasher is explicitly documented as unstable across Rust versions
- Truncate SHA-256 to 8 bytes (16 hex chars) to match previous format
- Ensures embedding cache is deterministic across Rust compiler versions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:25:38 -05:00
Argenis
722c99604c
fix(daemon): reset supervisor backoff after successful component run
Reset supervisor backoff after successful component run to prevent excessive delays.

- Reset backoff to initial value when component exits cleanly (Ok(()))
- Move backoff doubling to AFTER sleep so first error uses initial_backoff
- Applied to both channel listener and daemon component supervisors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:16:17 -05:00
Argenis
f8aef8bd62
feat: add anthropic-custom: prefix for Anthropic-compatible endpoints
Add support for custom Anthropic-compatible API endpoints via anthropic-custom: prefix
2026-02-15 10:13:18 -05:00
Argenis
8694c2e2d2
fix(providers): skip retries on non-retryable HTTP errors (4xx)
Skip retries on non-retryable HTTP client errors (4xx) to avoid wasting time on requests that will never succeed.

- Added is_non_retryable() function to detect non-retryable errors
- 4xx client errors (400, 401, 403, 404) are now non-retryable
- Exceptions: 429 (rate limiting) and 408 (timeout) remain retryable
- 5xx server errors remain retryable
- Fallback logic now skips retries for non-retryable errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:11:32 -05:00
Argenis
be135e07cf
feat: add Anthropic setup-token flow
Implements Anthropic setup-token flow from PR #103. All 907 tests pass.
2026-02-15 10:02:40 -05:00
Argenis
b208cc940e
feat: add IRC channel support
Add comprehensive IRC over TLS channel implementation with:
- TLS support with optional certificate verification
- SASL PLAIN authentication (IRCv3)
- NickServ IDENTIFY authentication
- Server password support (for bouncers like ZNC)
- Channel and private message (DM) support
- Message splitting for IRC 512-byte line limit
- UTF-8 safe splitting at character boundaries
- Case-insensitive nickname allowlist
- IRC style prefix for LLM responses (plain text only)
- Configurable via TOML or onboard wizard

All 959 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:00:15 -05:00
Argenis
ef00cc9a66
fix(channels): check response status in send() for Telegram, Slack, and Discord
Reliability fix: check HTTP response status in channel send methods
2026-02-15 09:48:58 -05:00
Argenis
64a64ccd3a
fix: ollama provider ignores api_key parameter to prevent builder error
Ollama is a local service that doesn't use API keys - the api_key parameter is now ignored to prevent it being misinterpreted as base_url
2026-02-15 09:47:57 -05:00
Argenis
322f24fd63
fix(tools): add 10 MB file size limit to file_read tool
Security fix: add 10 MB file size limit to file_read tool
2026-02-15 09:38:53 -05:00
Argenis
6899ad4b8e
feat: add GitHub Copilot as a provider
Add support for GitHub Copilot's OpenAI-compatible API at https://api.githubcopilot.com
2026-02-15 09:29:20 -05:00
Argenis
35b63d6b12
feat: SkillForge — automated skill discovery, evaluation & integration engine (#144)
* feat: add SkillForge — automated skill discovery, evaluation, and integration engine

SkillForge adds a 3-stage pipeline for autonomous skill management:

- Scout: discovers candidate skills from GitHub (extensible to ClawHub, HuggingFace)
- Evaluate: scores candidates on compatibility, quality, and security (weighted 0.30/0.35/0.35)
- Integrate: generates standard SKILL.toml + SKILL.md manifests for approved candidates

Thresholds: >=0.7 auto-integrate, 0.4-0.7 manual review, <0.4 skip.
Uses only existing dependencies (reqwest, serde, tokio, tracing, chrono, anyhow).
Includes unit tests for all modules.

* fix: address code review feedback on SkillForge PR #115

- evaluate: whole-word matching for BAD_PATTERNS (fixes hackathon false positive)
- evaluate: guard against future timestamps in recency bonus
- integrate: escape URLs in TOML output via escape_toml()
- integrate: handle control chars (\n, \r, \t, \b, \f) in escape_toml()
- mod: redact github_token in Debug impl to prevent log leakage
- mod: fix auto_integrated count when auto_integrate=false
- mod: per-candidate error handling (single failure no longer aborts pipeline)
- scout: add 30s request timeout, remove unused token field
- deps: enable chrono serde feature for DateTime serialization
- tests: add hackathon/exact-hack tests, update escape_toml test coverage

* fix: address round-2 CodeRabbit review feedback

- integrate: add sanitize_path_component() to prevent directory traversal
- mod: GitHub scout failure now logs warning and continues (no pipeline abort)
- scout: network/parse errors per-query use warn+continue instead of ?
- scout: implement std::str::FromStr for ScoutSource (replaces custom from_str)
- tests: add path sanitization tests (traversal, separators, dot trimming)

---------

Co-authored-by: stawky <stakeswky@gmail.com>
2026-02-15 09:26:13 -05:00
Argenis
2ac571f406
fix: harden private host detection against SSRF bypass via IP parsing
Security fix for browser tool SSRF prevention via proper IP parsing.
2026-02-15 09:13:12 -05:00
Argenis
1eadd88cf5
feat: Support Responses API fallback for OpenAI-compatible providers (#134)
- Add new structs for Responses API request/response format
- Add helper functions for extracting text from Responses API responses
- Refactor auth header application into a shared apply_auth_header method
- When chat completions returns 404 NOT_FOUND, fall back to Responses API
- Add tests for Responses API text extraction

This enables compatibility with providers that implement the Responses API
instead of Chat Completions (e.g., some newer Groq models).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 09:03:42 -05:00
Argenis
1e21c24e1b
fix: harden private host detection against SSRF bypass via IP parsing (#133)
- Handle IPv6 addresses with brackets correctly
- Parse IP addresses properly to catch all representations (decimal, hex, octal)
- Check for IPv4-mapped IPv6 addresses
- Check for IPv6 private ranges (unique-local fc00::/7, link-local fe80::/10)
- Add tests for IPv6 SSRF protection

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 08:52:01 -05:00
Argenis
031683aae6
fix(security): use path-component matching for forbidden paths (#132)
- Use Path::components() to check for actual .. path components instead of
  simple string matching (which was too conservative)
- Block URL-encoded traversal attempts (e.g., ..%2f)
- Expand tilde (~) for comparison
- Use path-component-aware matching for forbidden paths
- Update test to allow .. in filenames but block actual path traversal

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 08:30:48 -05:00
Argenis
73ced20765
fix(tools): check for symlinks before writing and reorder mkdir (#131)
- Move create_dir_all before canonicalize to prevent race condition where
  an attacker could create a symlink after the check but before the write
- Reject symlinks at the target path to prevent symlink attacks

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 08:26:39 -05:00
Argenis
b722189ef1
fix: clear environment variables in shell tool to prevent secret leakage
This fix addresses CWE-200 by clearing environment variables before
executing shell commands and only re-adding safe, functional variables.

- Add SAFE_ENV_VARS constant with whitelist of safe variables
- Use .env_clear() before executing commands
- Add tests for environment variable isolation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 08:24:01 -05:00
Argenis
1e19b12efd
fix(providers): warn on shared API key for fallbacks and warm up all providers (#130)
- Warn when fallback providers share the same API key as primary (could fail
  if providers require different keys)
- Warm up all providers instead of just the first, continuing on warmup failures

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 08:23:50 -05:00
Argenis
0fe4d2f712
chore: fix CHANGELOG date for version 0.1.0 (#128) 2026-02-15 08:20:45 -05:00
Argenis
641a5bf917
fix(skills): prevent path traversal in skill remove command
- Fix URL validation to check for https:// or http:// prefixes instead of partial string matching which could be bypassed
- Add path traversal protection in skill remove command to reject .., /, and verify canonical path is inside the skills directory
2026-02-15 08:15:41 -05:00
Argenis
da453f0b4b
fix: prevent panics from byte-level string slicing on multi-byte UTF-8
Uses floor_char_boundary() instead of direct byte indexing to prevent panics when slicing strings containing multi-byte UTF-8 characters.
2026-02-15 08:06:04 -05:00
Argenis
e3791aebcb
fix(imessage): escape newlines in AppleScript string interpolation
Prevents code injection via line breaks by escaping newline and carriage return characters in AppleScript string interpolation.
2026-02-15 08:00:59 -05:00
Argenis
e89415fc9a
chore: add .wt-pr37 Windsurf directory to gitignore
Also removes dead inject_openclaw_identity function and replaces unreachable macros with anyhow bail for cleaner error handling.
2026-02-15 07:44:50 -05:00
Edvard Schøyen
6725eb2995
fix(gateway): use constant-time comparison for WhatsApp verify_token
Uses constant_time_eq for verify_token to prevent timing attacks. Removes unused whatsapp_app_secret signature verification code for simplification.
2026-02-15 07:42:52 -05:00
Edvard Schøyen
bd02d73ecc
test: add comprehensive pairing code consumption tests
Add comprehensive tests for pairing code consumption feature
2026-02-15 07:36:54 -05:00
Argenis
dc654f6835
Merge pull request #121 from theonlyhennygod/docs/ram-update-final
docs: ZeroClaw <5MB RAM
2026-02-15 07:28:08 -05:00
argenis de la rosa
21607a72fa docs: update ZeroClaw RAM spec to <5MB 2026-02-15 07:28:04 -05:00
Argenis
ae97a76e64
Merge pull request #120 from theonlyhennygod/docs/comprehensive-benchmarks
docs: comprehensive benchmarks for ZeroClaw vs Others
2026-02-15 07:13:55 -05:00
argenis de la rosa
3c5166248a docs: add comprehensive benchmarks (NanoBot, PicoClaw, OpenClaw) 2026-02-15 07:12:15 -05:00
argenis de la rosa
80c599f215 fix: correct truncate_with_ellipsis to trim trailing whitespace
- Update truncate_with_ellipsis to trim trailing whitespace for cleaner output
- Fix test expectations to match trimmed behavior
- This resolves merge conflicts and ensures consistent string truncation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 07:06:56 -05:00
argenis de la rosa
b1c2cf865a merge: resolve conflicts with main and update README benchmarks 2026-02-15 07:02:41 -05:00
argenis de la rosa
fa5babb6a9 docs: update README with benchmarks, features, and specs comparison image 2026-02-15 06:58:30 -05:00
argenis de la rosa
085b57aa30 refactor: consolidate CLI command definitions to lib.rs
- Move all CLI command enums (ChannelCommands, SkillCommands, CronCommands, IntegrationCommands, MigrateCommands, ServiceCommands) to lib.rs
- Add clap derives for use in main.rs CLI parsing
- Update all modules to use crate:: prefix instead of super:: for command types
- Add mod util; to main.rs for binary compilation
- Export Config type from lib.rs for main.rs

This refactoring eliminates code duplication between library modules and binary, centralizing all CLI command definitions in one place.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 06:52:33 -05:00
Argenis
7b5e77f03c
fix: use safe Unicode string truncation to prevent panics (CWE-119)
Merge pull request #117 from theonlyhennygod/fix/unicode-truncation-panic
2026-02-15 06:49:48 -05:00
argenis de la rosa
9aaa5bfef1 fix: use safe Unicode string truncation to prevent panics (CWE-119)
Fixes Issue #55: Unicode string truncation causes panics with non-ASCII input

Previously, code used byte-index slicing (`&s[..n]`) which panics when the
slice boundary falls in the middle of a multi-byte UTF-8 character (emoji,
CJK, accented characters).

Changes:
- Added `truncate_with_ellipsis()` helper in `src/util.rs` that uses
  `char_indices()` to find safe character boundaries
- Replaced 2 unsafe truncations in `src/channels/mod.rs` with the safe helper
- Added 12 comprehensive tests covering emoji, CJK, accented chars, and edge cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 06:46:37 -05:00