zeroclaw/src/channels
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
..
clawdtalk.rs Implement ChannelConfig for ClawdTalk 2026-02-21 19:38:19 +08:00
cli.rs fix(channels): preserve slack thread root ids 2026-02-19 18:52:30 +08:00
dingtalk.rs perf(build): gate Matrix channel for faster iteration 2026-02-19 21:29:53 +08:00
discord.rs fix(discord): send attachment markers as files/urls 2026-02-22 18:14:19 +08:00
email_channel.rs add ChannelConfig implement for EmailConfig 2026-02-21 19:38:19 +08:00
imessage.rs feat(channels): add threading support to message channels 2026-02-19 18:52:30 +08:00
irc.rs perf: eliminate unnecessary heap allocations across agent loop, memory, and channels 2026-02-19 07:06:27 -08:00
lark.rs chore: fix lint gate formatting and codex test runtime options 2026-02-24 15:59:49 +08:00
linq.rs fix(security): address CodeQL code-scanning alerts 2026-02-19 16:31:03 -08:00
matrix.rs fix(channels): add wildcard pattern for non-exhaustive Relation enum in matrix channel (#1702) 2026-02-24 18:33:38 -05:00
mattermost.rs feat(channels): add threading support to message channels 2026-02-19 18:52:30 +08:00
mod.rs feat(config): add model_support_vision override for per-model vision control 2026-02-25 10:56:31 +08:00
mqtt.rs fix(web): call doctor endpoint with authenticated POST 2026-02-22 21:32:34 -05:00
nextcloud_talk.rs feat(channel): add native nextcloud talk webhook integration 2026-02-20 23:28:18 +08:00
nostr.rs feat(channel): add Nostr channel with NIP-04 and NIP-17 support 2026-02-21 13:16:20 +08:00
qq.rs feat(qq): add webhook receive mode with challenge validation 2026-02-24 19:30:36 +08:00
signal.rs feat(channels): add threading support to message channels 2026-02-19 18:52:30 +08:00
slack.rs fix(slack): bootstrap poll cursor to avoid replay 2026-02-22 17:57:11 +08:00
telegram.rs Merge branch 'dev' into fix/issue-1469-voice-log 2026-02-24 11:37:12 -05:00
traits.rs feat(channels): add reaction support to Channel trait and Discord implementation 2026-02-21 12:46:22 +08:00
transcription.rs feat(channel): add voice message transcription via Whisper API 2026-02-21 12:48:47 +08:00
wati.rs feat: add WATI WhatsApp Business API channel (#1472) 2026-02-23 08:02:00 -05:00
whatsapp_storage.rs fix(security): remove sensitive fields from Debug impls 2026-02-20 22:06:21 -08:00
whatsapp_web.rs fix: resolve supersede 1267 CI failures 2026-02-25 10:45:00 +08:00
whatsapp.rs fix(errors): improve config error messages with section paths and remediation hints 2026-02-19 11:44:04 -08:00