feat(desktop): add first-class Mistral Vibe coding agent

Merged
TH
4mo ago
+1223-18

Description

Adds Mistral Vibe (vibe) as a first-class terminal coding agent, matching the depth of the existing Claude / Codex integrations: selectable in every agent picker with its own icon, launches into a PTY pane with a seeded prompt, exposes a model picker (env-based VIBE_ACTIVE_MODEL, since Vibe has no --model flag), and drives the working-indicator + completion-chime lifecycle via a managed wrapper + a marker-guarded ~/.vibe/hooks.toml. No changes to the Mistral Vibe CLI are required.

Everything flows from a single entry in BUILTIN_TERMINAL_AGENTS; the non-derived touch points (icon, model catalog, desktop hook pipeline, event mapping, docs) are updated to match.

Related Issues

closes #5551

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

  • bun run lint clean (0 findings), bun run typecheck 28/28, bunx sherif clean, bun install --frozen no changes.
  • New/updated suites pass 76/0: agent-command, agent-models (incl. buildAgentModelEnv), map-event-type (before_tool → Start, post_agent_turn → Stop), agent-wrappers (vibe wrapper + ~/.vibe/hooks.toml writer).
  • Manual smoke in a packaged desktop build: selected Mistral Vibe + a model, launched a task → pane runs VIBE_ACTIVE_MODEL=<model> vibe --trust --auto-approve '<prompt>'; working indicator lights on first tool call, completion chime fires once at idle. Verified the generated wrapper and ~/.vibe/hooks.toml provisioning, and drove the full superset CLI lifecycle from inside a Vibe session.

Screenshots (if applicable)

Additional Notes

  • Model picker exposes Vibe's built-in aliases (mistral-medium-3.5, devstral-small); delivered via VIBE_ACTIVE_MODEL because Vibe has no --model flag.
  • Out of scope (possible follow-ups): MCP wiring (Vibe uses TOML [[mcp_servers]], not .mcp.json), the vibe-acp ACP runtime, and optional upstream Vibe hooks (turn-start / permission-requested) for finer working-state fidelity.

Open in Stage

Summary by cubic

Adds Mistral Vibe (vibe) as a first-class terminal coding agent with full model selection and lifecycle hooks. Adds a shared notify-hook command and safer hooks.toml recovery to protect user-defined hooks.

  • New Features

    • Registry/UI: added to BUILTIN_TERMINAL_AGENTS, default terminal presets, icon sets, settings search, docs/marketing/mobile.
    • Launch: runs vibe --trust --auto-approve '<prompt>' (positional prompt auto-submits).
    • Model picker: env-based via VIBE_ACTIVE_MODEL; added modelEnv and buildAgentModelEnv, merged into the host launch env.
    • Lifecycle: wrapper enables VIBE_ENABLE_EXPERIMENTAL_HOOKS and stamps SUPERSET_AGENT_ID; provisions marker-guarded ~/.vibe/hooks.toml with before_tool and post_agent_turn hooks; mapped to Start/Stop.
    • Compatibility: Vibe reads AGENTS.md and .agents/skills/ (with --trust); MCP uses TOML [[mcp_servers]] in .vibe/config.toml.
    • Robustness: hooks.toml recovery now preserves user hooks/comments when the end marker is missing by removing only managed superset-notify-* tables and stopping at the first foreign TOML table.
    • Refactor: extracted shared getManagedNotifyHookCommand/MANAGED_NOTIFY_RELATIVE_PATH in agent-wrappers-common; applied to Claude and Vibe.
  • Migration

    • Ensure vibe is installed and MISTRAL_API_KEY is configured (or run vibe --setup).
    • No data migrations; the app auto-creates the wrapper and ~/.vibe/hooks.toml. Model picker includes mistral-medium-3.5 and devstral-small.

Summary by CodeRabbit

  • New Features
    • Added Mistral Vibe (vibe) as a built-in agent across the app, including icons, marketing/UX surfaces, default terminal presets, and quick-add templates.
    • Enabled Vibe lifecycle hooks with managed startup setup and mapped “start/stop” event behavior in the UI.
    • Introduced env-based model selection for Vibe so model choice no longer relies on a CLI --model flag.
  • Bug Fixes
    • Improved Vibe hook hooks.toml generation to be idempotent and robust against partial writes.
  • Documentation
    • Updated compatibility notes and MCP configuration docs for Vibe.
  • Tests
    • Added unit coverage for Vibe wrapper script, hooks.toml generation, and hook event mapping.