Skip to content

feat(opencode): mistral + vibe-direct providers behind the mistral-plan route - #5722

Merged
dezren39 merged 1 commit into
mainfrom
mistral-providers-1653
Nov 5, 2026
Merged

dezren39 merged 1 commit into
mainfrom
mistral-providers-1653

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Completes Drew's Mistral provider set (opencode#1653). The fleet side of developing-today-forks/opencode PR #1661 (merged 7774bf07): the native vibe provider, including the attribution-stamp fix — every wire request carries metadata.call_source: "vibe_code", the metering key for the Vibe quota marts (evidence + correction on opencode#1653).

Changes

  • flake.lock — opencode fork input 63c50eec → 7774bf07 (the merged mcpx(cli): shell completions strand command aliases — flag completion keys on canonical names only in bash/zsh, and fish never offers aliases at all #1661 rev; narHash updated by nix flake lock --update-input opencode, diff confined to that node).
  • .opencode/opencode.jsonc
    • mistral — @opencode/ai/providers/mistral, name "Mistral API (drewrypope)". Credential: the enrolled server credential (integration mistral, created + activated against the standing server; the key lives in Bitwarden as mistral.api-key). Model catalog stays with sync-models in the runtime overlay (code#4544).
    • vibe-direct — @opencode/ai/providers/vibe, name "Mistral Vibe Direct (native wire clone)". Vibe's 8 preset models are declared in config — models.dev has no vibe entry, so sync-models cannot maintain this catalog. Only the default preset's context limit (262144) was verified from the binary; the remaining entries carry the preset ids + names from Vibe's own catalog, no invented limits (opencode#1653's contract).
    • mistral-plan in experimental.provider_routes: {"providers": ["vibe-direct", "mistral"], "selection": "ordered"} — the Vibe-attributed leg is attempted first on every dispatch; the plain API leg is the reserve. Leg order changes in that list and nowhere else.
  • MISTRAL_API_KEY → the opencode server unit's environment (the vibe provider resolves it from the server process env; the mistral provider's env tier names the same variable):
    • secrets/sops/common/bws.yaml — re-mirrored via lib/bws-to-sops.sh; the only content change is + mistral.api-key (rest is sops re-encryption).
    • nixos/agent-auth/default.nix — declares agent-auth/mistral-api-key from the bws mirror (decrypts to /run/secrets/agent-auth/mistral-api-key, owner user, 0400).
    • home/common/default.nix — an ExecStartPre on the user unit materializes a systemd EnvironmentFile at every server start from that sops file, and the unit consumes it via EnvironmentFile — the openclaw-facade-auth-materialize pattern. The value never enters the Nix store or this repo.

Verification (laptop)

  • Config JSONC parses; both providers and the route assert-checked (8 vibe presets, ordered legs).
  • nix-instantiate --parse clean on both edited .nix files; targeted nix eval against nixosConfigurations.amd resolves the unit's merged ExecStartPre (materialize script) + EnvironmentFile, and the sops secret path.
  • Credential enrollment read back from GET /api/credential: exactly one mistral entry, active, stored value hash-matches the Bitwarden item (sha256 prefix 144cdb68d8d89c4b, len 45) — value never printed.
  • Quota: no numeric quota/balance surface exists for Mistral API keys (usage/billing/org endpoints 404; the Vibe whoami answers plan identity only: plan_type API, plan_name FREE). Nothing is invented for the dashboard; the providers report what the server lists.

Deploy = the next fleet switch (this PR's generation), then bin/sync-models.mjs once for the mistral catalog, then live completion proofs per leg with route-attempt records.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…an route

Completes Drew's Mistral provider set (opencode#1653):

- flake.lock: bump the opencode fork input 63c50eec -> 7774bf07 (PR #1661 merged: native vibe provider incl. the attribution-stamp fix — metadata.call_source vibe_code on every wire request, the metering key for the Vibe quota marts).

- .opencode/opencode.jsonc: provider mistral (@opencode/ai/providers/mistral; credential = the enrolled server credential, integration mistral) and provider vibe-direct (@opencode/ai/providers/vibe) with Vibe's 8 preset models declared in config (models.dev has no vibe entry for sync-models; only the default preset's context limit was verified from the binary). Route mistral-plan in experimental.provider_routes: ordered [vibe-direct, mistral] — the Vibe-attributed leg burns first, the plain API leg is the reserve.

- MISTRAL_API_KEY into the opencode server unit: Bitwarden mistral.api-key mirrored into secrets/sops/common/bws.yaml (lib/bws-to-sops.sh, +1 key), declared as sops secret agent-auth/mistral-api-key (nixos/agent-auth, /run/secrets/agent-auth/mistral-api-key, 0400), and materialized into a systemd EnvironmentFile by an ExecStartPre on the user unit (home/common) — the openclaw-facade-auth-materialize pattern; the value never enters the Nix store or the repo.
@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 5, 2026 00:36
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7fb05fd-2503-46de-8e1c-3f1bddf72a09

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant