Commit Graph

4 Commits

Author SHA1 Message Date
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
pluginmd
58ca515f9c style(docs/vi): polish Vietnamese translations for natural readability
- Convert all Title Case Vietnamese headings to sentence case
  (Vietnamese doesn't use Title Case)
- Replace calque translations with natural Vietnamese phrasing:
  "Bảo Mật Agnostic" → "Bảo mật không phụ thuộc nền tảng",
  "Bảo Mật Không Ma Sát" → "Bảo mật không gây cản trở",
  "tư thế bảo mật" → "tình trạng bảo mật",
  "kiềm chế ở cấp độ OS" → "cách ly cấp hệ điều hành"
- Standardize terminology: "rõ ràng" → "tường minh" for "explicit"
- Shorten verbose phrasing across navigation docs and references
- Make prose more direct and developer-friendly throughout

21 files touched, 168 lines changed (wording only, no structural changes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:16:53 +08:00
pluginmd
a2bbf1913b fix(docs/vi): correct ~40 broken/misdirected relative links
- Fix 3 critical broken links: wrong path depth for README.vi.md and
  CONTRIBUTING.md references
- Fix category READMEs (reference/, operations/, security/, hardware/)
  linking to English docs instead of Vietnamese siblings
- Fix 6 security proposal files pointing to English config/runbook/
  troubleshooting instead of local siblings
- Fix content cross-links in channels-reference, network-deployment,
  hardware-peripherals-design, matrix-e2ee-guide, proxy-agent-playbook
- Fix pr-workflow, reviewer-playbook, zai-glm-setup pointing to English
  docs hub instead of Vietnamese README.md
- Standardize date format to ISO 8601 (2026-02-20) across all files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 02:16:53 +08:00
pluginmd
79cc1bd30b docs(vi): add comprehensive Vietnamese localization under docs/vi/
Full Vietnamese translation of all documentation using directory-per-locale
structure (docs/vi/) instead of flat suffixes. Covers 41 docs across all
categories: getting-started, reference, operations, security, hardware,
datasheets, contributing, and project. Also includes python/README.vi.md.

Translation conventions: natural idiomatic Vietnamese for prose; technical
terms, CLI commands, config keys, and code blocks kept in English.

Supersedes flat-suffix approach from #1092.

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