Commit Graph

325 Commits

Author SHA1 Message Date
xj
ac27788a3b fix(plugins): wire provider routing and timeout permit release 2026-03-01 01:21:53 -08:00
xj
9b0aa53adf feat(plugins): enforce runtime limits and add echo plugin example 2026-02-28 21:33:11 -05:00
xj
49a520df3e feat(plugins): execute wasm tools/providers via host abi bridge 2026-02-28 21:33:11 -05:00
xj
11498ab099 fix(build): update history test call and apply rustfmt drift 2026-02-28 17:09:50 -08:00
xj
9095a54de3 fix(main): restore rust gates after bluebubbles merge 2026-02-28 17:00:18 -08:00
argenis de la rosa
5bc98842b7 chore: refresh lockfile and apply rustfmt 2026-02-28 19:51:37 -05:00
argenis de la rosa
ade0e91898 feat(plugins): route declared tools/providers through plugin registry 2026-02-28 19:51:37 -05:00
argenis de la rosa
0b72b45d90 fix(providers): harden circuit breaker cooldown and validation 2026-02-28 19:22:09 -05:00
Shadman Hossain
d5cea40fed fix(bedrock): auto-refresh AWS credentials before STS token expiry
Add CachedCredentials with 50-minute TTL that transparently refreshes
from the ECS container credential endpoint, env vars, or EC2 IMDS.

- Add from_ecs() to credential resolve chain for ECS/Fargate support
- Move streaming credential fetch into async context for TTL validation
- Remove sync credential fallback (all paths now use TTL-aware cache)
- Double-checked locking prevents thundering herd on refresh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:51:57 -05:00
argenis de la rosa
f7de9cda3a Merge remote-tracking branch 'origin/main' into pr2093-mainmerge 2026-02-28 17:33:17 -05:00
argenis de la rosa
4af196ab04 fix(routing): normalize hint whitespace for default_model routes 2026-02-28 16:01:42 -05:00
argenis de la rosa
12018b4a03 fix(provider): include quota metadata in cursor chat response 2026-02-28 16:01:42 -05:00
argenis de la rosa
2d91536f92 feat(routing): support hint default_model during startup 2026-02-28 16:01:42 -05:00
dexter
f6278373cb
feat: add cursor headless cli support (#2195)
* Initial plan

* feat(providers): add Cursor headless CLI provider

Co-authored-by: langhuihui <3647405+langhuihui@users.noreply.github.com>

* fix(cursor): harden headless CLI invocation and safety guards

* chore(pr): retrigger intake after template and linear updates

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: langhuihui <3647405+langhuihui@users.noreply.github.com>
Co-authored-by: argenis de la rosa <theonlyhennygod@gmail.com>
2026-02-28 13:41:56 -05:00
argenis de la rosa
83f7399c72 fix(copilot): preserve first text while merging split tool calls 2026-02-28 13:29:04 -05:00
Tim Stewart
8b7b0b0776 fix(copilot): merge tool_calls from all response choices
The Copilot API proxy for Claude models (Opus 4.6, Opus 4.6-1m) splits
text content and tool_calls into separate choices. Previously only
choices[0] was read, causing all tool calls to be silently dropped
when they appeared in choices[1].

Merge text and tool_calls from all choices so tool calling works
regardless of how the proxy splits the response.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 13:29:04 -05: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
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
VirtualHotBar
0a357064d9 session/history: allowlist persistable roles (user, assistant) via ROLE_* constants; unify filtering in channel + agent; memory/session: reduce read contention with RwLock+AtomicI64 and refresh updated_at on get_history; providers: export role constants and helper; security: switch HMAC verifications to ring::hmac for Linq/Nextcloud/WhatsApp; channels tests: auto-approve mock_price to avoid non-CLI approval dead-wait; misc: ignore target_ci/.idea; main: use local rag module. 2026-02-28 18:40:48 +08: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
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
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
77c6aba24c feat(provider): add qwen-coding-plan endpoint alias 2026-02-26 22:40:07 -05:00
Argenis
7f3b7302b1 fix(config): resolve env credential reporting and safer compaction default
- report api_key_configured via provider credential resolution (env + overrides)\n- set agent.compact_context default to true for new configs\n- align docs and tests with the new default\n\nRefs: #1983\nRefs: #1984\nContext: #1358\n\nCo-authored-by: Argenis <144828210+theonlyhennygod@users.noreply.github.com>
2026-02-27 03:15:55 +00:00
argenis de la rosa
b27b44829a chore: promote dev snapshot to main (resolve #1978/#1970) 2026-02-26 21:09:33 -05:00
argenis de la rosa
b355956400 fix(model-routing): detect env-backed provider credentials
Compute api_key_configured through provider credential resolution so env-variable credentials are reported correctly for scenarios and delegate agents.

Closes #1983
2026-02-26 21:07:07 -05:00
Chum Yin
9b0e70b2f2
supersede: file-replay changes from #1895 (#1926)
Automated conflict recovery via changed-file replay on latest main.
2026-02-26 04:15:47 -05:00
Chummy
d3af83db63
fix: align merged code with dev to restore build 2026-02-26 03:47:01 +00:00
Chummy
e0f6f24a5e
merge: promote dev into main (dev-first conflict resolution) 2026-02-26 03:41:59 +00:00
Jeff Lee
56d4b7c25e fix(integrations): resolve CodeRabbit concurrency and provider-alias findings 2026-02-26 02:01:43 +08:00
Jeff Lee
03bf3f105d feat(integrations): enhance integrations settings UX and provider metadata
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-02-26 02:01:43 +08:00
Chummy
268b01fcf0 hardening(security): sanitize upstream error bodies across channels 2026-02-25 20:41:51 +08:00
Chummy
495d7717c7 hardening(logging): sanitize channel API error bodies 2026-02-25 19:59:31 +08:00
Chummy
d5cd65bc4f hardening: tighten gateway auth and secret lifecycle handling 2026-02-25 18:33:28 +08:00
Chummy
7ffb91105b style: apply rustfmt for reasoning-level changes 2026-02-25 17:51:00 +08:00
argenis de la rosa
aac87ca437 feat(provider): add reasoning level override
(cherry picked from commit 8d46469c40)
2026-02-25 17:51:00 +08:00
FlashFamily
931cf40636 fix: resolve all clippy warnings across codebase
Fix all clippy errors reported by `cargo clippy --all-targets -- -D warnings`
on Rust 1.93, covering both the original codebase and upstream dev changes.

Changes by category:
- format!() appended to String → write!/writeln! (telegram, discord)
- Redundant field names, unnecessary boolean not (agent/loop_)
- Long numeric literals (wati, nextcloud, telegram, gemini)
- Wildcard match on single variant (security/leak_detector)
- Derivable Default impls (config/schema)
- &Option<T> → Option<&T> or allow (config/schema, config/mod, gateway/api)
- Identical match arms merged (gateway/ws, observability, providers, main, onboard)
- Cast truncation allowed with rationale (discord, lark)
- Unnecessary borrows/returns removed (multiple files)
- Unused imports removed (channels/mod, peripherals/mod, tests)
- MSRV-gated APIs allowed locally (memory/hygiene, tools/shell, tools/screenshot)
- Unnecessary .get().is_none() → !contains_key() (gemini)
- Explicit iteration → reference loop (gateway/api)
- Test-only: useless vec!, field_reassign_with_default, doc indentation

Validated: cargo fmt, cargo clippy --all-targets -- -D warnings, cargo test
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 49e90cf3e4)
2026-02-25 17:50:56 +08:00
Chummy
8bbf256fa9 supersede: replay changes from #1661
Automated conflict recovery onto latest dev.
2026-02-25 17:39:37 +08:00
Chum Yin
db175c3690
[supersede #1545] feat(providers): implement Qwen OAuth quota tracking (#1746)
* feat(providers): implement Qwen OAuth quota tracking

Add static quota display for Qwen OAuth provider (portal.qwen.ai).
Qwen OAuth API does not return rate-limit headers, so this provides
a static quota indicator based on known OAuth free-tier limits.

Changes:
- Add QwenQuotaExtractor in quota_adapter.rs
  - Parses rate-limit errors for retry backoff
  - Registered for all Qwen aliases (qwen, qwen-code, dashscope, etc.)
- Add Qwen OAuth detection in quota_cli.rs
  - Auto-detects ~/.qwen/oauth_creds.json
  - Displays static quota: ?/1000 (unknown remaining, 1000/day total)
- Improve quota display formatting
  - Shows "?/total" when only total limit is known
- Add comprehensive test report and testing scripts
  - Full integration test report: docs/qwen-provider-test-report.md
  - Model availability, context window, and latency tests
  - Reusable test scripts in scripts/ directory

Test results:
- Available model: qwen3-coder-plus (verified)
- Context window: ~32K tokens
- Average latency: ~2.8s
- All 15 quota tests passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit fa91b6a170)

* docs: satisfy markdownlint spacing in qwen docs

---------

Co-authored-by: ZeroClaw Bot <zeroclaw_bot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 03:09:38 -05:00
Chummy
479df22ea7 supersede: file-replay changes from #1622
Automated conflict recovery via changed-file replay on latest dev.
2026-02-25 11:17:11 +08:00
Chummy
cd4d816a83 fix(providers): keep runtime options backward compatible 2026-02-25 10:56:31 +08:00
reidliu41
3a38c80c05 feat(config): add model_support_vision override for per-model vision control
`supports_vision` is currently hardcoded per-provider. The same Ollama instance can run `llava` (vision) or
  `codellama` (no vision), but the code fixes vision support at the provider level with no user override.

  This adds a top-level `model_support_vision: Option<bool>` config key — tri-state:
  - **Unset (default):** provider's built-in value, zero behavior change
  - **`true`:** force vision on (e.g. Ollama + llava)
  - **`false`:** force vision off

  Follows the exact same pattern as `reasoning_enabled`. Override is applied at the wrapper layer (`ReliableProvider` /
   `RouterProvider`) — no concrete provider code is touched.

  ## Changes

  **Config surface:**
  - Top-level `model_support_vision` field in `Config` struct with `#[serde(default)]`
  - Env override: `ZEROCLAW_MODEL_SUPPORT_VISION` / `MODEL_SUPPORT_VISION`

  **Provider wrappers (core logic):**
  - `ReliableProvider`: `vision_override` field + `with_vision_override()` builder + `supports_vision()` override
  - `RouterProvider`: same pattern

  **Wiring (1-line each):**
  - `ProviderRuntimeOptions` struct + factory functions
  - 5 construction sites: `loop_.rs`, `channels/mod.rs`, `gateway/mod.rs`, `tools/mod.rs`, `onboard/wizard.rs`

  **Docs (i18n parity):**
  - `config-reference.md` — Core Keys table
  - `providers-reference.md` — new "Ollama Vision Override" section
  - Vietnamese sync: `docs/i18n/vi/` + `docs/vi/` (4 files)

  ## Non-goals

  - Does not change any concrete provider implementation
  - Does not auto-detect model vision capability

  ## Test plan

  - [x] `cargo fmt --all -- --check`
  - [x] `cargo clippy --all-targets -- -D warnings` (no new errors)
  - [x] 5 new tests passing:
    - `model_support_vision_deserializes` — TOML parse + default None
    - `env_override_model_support_vision` — env var override + invalid value ignored
    - `vision_override_forces_true` — ReliableProvider override
    - `vision_override_forces_false` — ReliableProvider override
    - `vision_override_none_defers_to_provider` — passthrough behavior

  ## Risk and Rollback

  - **Risk:** Low. `None` default = zero behavior change for existing users.
  - **Rollback:** Revert commit. Field is `#[serde(default)]` so old configs without it will deserialize fine.

(cherry picked from commit a1b8dee785)
2026-02-25 10:56:31 +08:00
Chummy
bfe87b1c55 fix: resolve supersede 1267 CI failures 2026-02-25 10:45:00 +08:00
Chummy
b5ec2dce88 supersede: replay changes from #1267
Automated replay on latest dev.
2026-02-25 10:45:00 +08:00
Chummy
040bd95d84 fix(reliable): remap model fallbacks per provider 2026-02-24 23:21:39 +08:00
Shadman Hossain
a22244d266 fix: stream_chat_with_history delegates to stream_chat_with_system
The default trait implementation returned a single error chunk that the
SSE mapper silently converted to `data: [DONE]`, producing empty
streaming responses from the OpenAI-compatible endpoint. Mirror the
non-streaming chat_with_history pattern: extract system + last user
message and delegate to stream_chat_with_system, which all providers
already implement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 22:22:16 +08:00
Shadman Hossain
d6824afd21 style: fix clippy warnings and cargo fmt in new code
- Add underscores to long numeric literals (1234567890 → 1_234_567_890)
- Allow cast_possible_truncation for rough token estimates
- Replace loop/match with while-let for event stream parsing
- Merge identical match arms for event types
- Add #[allow(clippy::cast_possible_truncation)] on test helper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 22:22:16 +08:00