Skip to content

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

Merged
Kitenite merged 20 commits into
ParadevAI:mainfrom
ThomsenDrake:feat/mistral-vibe-agent
Jul 9, 2026
Merged

Kitenite merged 20 commits into
ParadevAI:mainfrom
ThomsenDrake:feat/mistral-vibe-agent

Conversation

@ThomsenDrake

@ThomsenDrake ThomsenDrake commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

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.

Written for commit f786a22. Summary will update on new commits.

Review in cubic

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.

@ghost

ghost commented Jul 9, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 7 individual chapters for you:

Title
1 Document the Mistral Vibe integration plan
2 Register Vibe as a builtin terminal agent
3 Support env-based model selection for Vibe
4 Implement lifecycle hooks and event mapping
5 Provision Vibe PATH-wrapper and hooks.toml
6 Wire Vibe into UI and documentation
7 Other changes
Open in Stage

Chapters generated by Stage for commit f786a22 on Jul 9, 2026 10:55pm UTC.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds Mistral Vibe as a built-in terminal agent with registry and icon wiring, env-based model selection, managed lifecycle hooks, event mapping, documentation, discovery, and marketing updates.

Changes

Mistral Vibe agent support

Layer / File(s) Summary
Register vibe as built-in terminal agent and icon
packages/shared/src/builtin-terminal-agents.ts, packages/ui/.../preset-icons/index.ts, apps/desktop/.../AgentIconPicker/..., apps/desktop/.../default-v2-terminal-presets.ts, packages/shared/src/agent-command.test.ts
Adds Vibe to the built-in catalog, icon registries, desktop picker, default presets, and registration tests.
Env-based model selection for Vibe
packages/shared/src/agent-models.ts, packages/shared/src/agent-models.test.ts, packages/host-service/src/trpc/router/agents/agents.ts
Adds modelEnv support, the Vibe model catalog, VIBE_ACTIVE_MODEL construction, tests, and launch-environment overlay.
Vibe hooks and desktop setup
apps/desktop/src/main/lib/agent-setup/*
Adds managed Vibe wrapper and hooks.toml merging, shares notify-hook generation with Claude, and registers desktop setup actions and runners.
Hook event mapping
packages/host-service/src/events/map-event-type.ts, map-event-type.test.ts
Maps before_tool to Start and post_agent_turn to Stop, with test coverage.
Discovery, docs, and marketing surfaces
AGENTS.md, apps/docs/..., apps/desktop/.../settings-search.ts, apps/mobile/store.config.json, apps/marketing/...
Adds Vibe keywords, compatibility and MCP configuration guidance, terminal preset documentation, mobile metadata, and marketing entries.
Planning documents
plans/20260709-mistral-vibe-agent-first-class.md, plans/20260709-mistral-vibe-agent-impl-plan.md
Adds design and implementation plans for the integration.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

Suggested reviewers: texpobros1984

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The implementation matches #5551: built-in Vibe agent, icon/preset, env-based model picker, managed hooks, event mapping, and docs/discovery updates.
Out of Scope Changes check ✅ Passed The extra docs, marketing, mobile, and planning-file updates support discoverability and rollout rather than introducing unrelated scope.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding Mistral Vibe as a first-class coding agent.
Description check ✅ Passed The description follows the template well and includes description, related issue, change type, testing, screenshots, and notes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Mistral Vibe (vibe) as a first-class terminal coding agent, matching the depth of existing Claude/Codex integrations across every touch point: registry entry, icon, env-based model picker (VIBE_ACTIVE_MODEL), desktop lifecycle hooks via a PATH wrapper + marker-guarded ~/.vibe/hooks.toml, and event mapping for the working-indicator/chime pipeline.

  • Registry & launch: one createBuiltinTerminalAgent entry in builtin-terminal-agents.ts auto-propagates the agent type union, labels, preset seeds, and wire schemas; the default argv prompt transport appends the task as a positional arg that Vibe auto-submits into its TUI.
  • Env-based model picker: new buildAgentModelEnv in agent-models.ts delivers the selected model via VIBE_ACTIVE_MODEL (Vibe has no --model flag); the runTerminalAgent path in agents.ts merges this env after config.env so the picker selection takes precedence.
  • Lifecycle hooks: a new agent-wrappers-vibe.ts generates the PATH wrapper (sets VIBE_ENABLE_EXPERIMENTAL_HOOKS=true) and writes a marker-guarded hooks.toml block; map-event-type.ts maps before_tool → Start and post_agent_turn → Stop to drive the working indicator and completion chime.

Confidence Score: 4/5

The change is additive and well-contained — one registry entry drives all derived surfaces, new plumbing follows existing patterns exactly, and tests cover the main paths. The only gap is a missing guard in the hooks.toml writer for the case where a prior partial write left an orphaned start marker.

The architecture is methodical and every touch point (registry, model layer, wrapper, event mapping, docs) is covered and tested. The getVibeHooksTomlContent function has an edge case when the end marker is absent from a corrupted file: the old partial block is not stripped before the new one is appended, leading to duplicate hooks firing until the next provisioning run. This is a narrow, self-healing scenario but no test covers it and no guard documents it.

apps/desktop/src/main/lib/agent-setup/agent-wrappers-vibe.ts — specifically the orphaned-start-marker branch in getVibeHooksTomlContent.

Important Files Changed

Filename Overview
apps/desktop/src/main/lib/agent-setup/agent-wrappers-vibe.ts New file: implements the Vibe PATH-wrapper (exports VIBE_ENABLE_EXPERIMENTAL_HOOKS=true) and marker-guarded ~/.vibe/hooks.toml writer; logic is clean with one edge case when the end marker is missing from a prior partial write.
packages/shared/src/agent-models.ts Adds optional modelEnv field to AgentModelSupport and new buildAgentModelEnv for env-based model delivery; vibe entry added with VIBE_ACTIVE_MODEL and two model aliases; consistent with buildAgentModelArgs contract.
packages/host-service/src/trpc/router/agents/agents.ts Merges buildAgentModelEnv result into the env overlay after config.env, giving the picker-selected model precedence; correct spread order and clean integration.
packages/shared/src/builtin-terminal-agents.ts Registers vibe with id 'vibe', label 'Mistral Vibe', command 'vibe --trust --auto-approve', includeInDefaultTerminalPresets=true; default argv transport auto-submits the positional prompt.
packages/host-service/src/events/map-event-type.ts Maps Vibe's before_tool → Start and post_agent_turn → Stop; correct placement in existing branches, covered by new test cases.
apps/desktop/src/main/lib/agent-setup/desktop-agent-capabilities.ts Registers vibe-hooks-toml and vibe-wrapper action slugs and DESKTOP_AGENT_SETUP_TARGETS entry; satisfies the compile-enforced actions union.
packages/ui/src/assets/icons/preset-icons/index.ts Imports vibe.svg and wires PRESET_ICONS.vibe with same icon for light and dark modes; consistent with amp/claude/gemini which also use a single SVG for both themes.
apps/desktop/src/main/lib/agent-setup/agent-wrappers.test.ts Adds wrapper and hooks.toml unit tests covering happy-path idempotency and user-hook preservation; missing coverage for the orphaned-start-marker edge case.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant Desktop as Desktop (renderer)
    participant HostService as host-service (agents.ts)
    participant Wrapper as ~/.superset/bin/vibe (wrapper)
    participant Vibe as vibe CLI
    participant NotifySh as notify.sh

    User->>Desktop: Select Mistral Vibe + model, launch task
    Desktop->>HostService: "agents.run({ presetId:"vibe", model:"mistral-medium-3.5", prompt })"
    HostService->>HostService: "buildAgentModelEnv → { VIBE_ACTIVE_MODEL: "mistral-medium-3.5" }"
    HostService->>HostService: buildAgentModelArgs("vibe",...) → [] (no --model flag)
    HostService->>Desktop: "spawn PTY: VIBE_ACTIVE_MODEL=... vibe --trust --auto-approve '<prompt>'"
    Desktop->>Wrapper: exec vibe
    Wrapper->>Wrapper: "export VIBE_ENABLE_EXPERIMENTAL_HOOKS=true + SUPERSET_AGENT_ID=vibe"
    Wrapper->>Vibe: exec real vibe binary
    Vibe->>NotifySh: before_tool hook fires
    NotifySh->>HostService: "POST /notify (eventType=before_tool)"
    HostService->>HostService: mapEventType(before_tool) → Start
    HostService->>Desktop: working indicator ON
    Vibe->>NotifySh: post_agent_turn hook fires
    NotifySh->>HostService: "POST /notify (eventType=post_agent_turn)"
    HostService->>HostService: mapEventType(post_agent_turn) → Stop
    HostService->>Desktop: working indicator OFF + completion chime
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant Desktop as Desktop (renderer)
    participant HostService as host-service (agents.ts)
    participant Wrapper as ~/.superset/bin/vibe (wrapper)
    participant Vibe as vibe CLI
    participant NotifySh as notify.sh

    User->>Desktop: Select Mistral Vibe + model, launch task
    Desktop->>HostService: "agents.run({ presetId:"vibe", model:"mistral-medium-3.5", prompt })"
    HostService->>HostService: "buildAgentModelEnv → { VIBE_ACTIVE_MODEL: "mistral-medium-3.5" }"
    HostService->>HostService: buildAgentModelArgs("vibe",...) → [] (no --model flag)
    HostService->>Desktop: "spawn PTY: VIBE_ACTIVE_MODEL=... vibe --trust --auto-approve '<prompt>'"
    Desktop->>Wrapper: exec vibe
    Wrapper->>Wrapper: "export VIBE_ENABLE_EXPERIMENTAL_HOOKS=true + SUPERSET_AGENT_ID=vibe"
    Wrapper->>Vibe: exec real vibe binary
    Vibe->>NotifySh: before_tool hook fires
    NotifySh->>HostService: "POST /notify (eventType=before_tool)"
    HostService->>HostService: mapEventType(before_tool) → Start
    HostService->>Desktop: working indicator ON
    Vibe->>NotifySh: post_agent_turn hook fires
    NotifySh->>HostService: "POST /notify (eventType=post_agent_turn)"
    HostService->>HostService: mapEventType(post_agent_turn) → Stop
    HostService->>Desktop: working indicator OFF + completion chime
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/desktop/src/main/lib/agent-setup/agent-wrappers-vibe.ts:51-57
**Orphaned start marker silently skips cleanup**

When `VIBE_HOOKS_MARKER_START` is present in an existing `hooks.toml` but `VIBE_HOOKS_MARKER_END` is missing (e.g. a previous partial write), the `if (end !== -1)` guard skips stripping and the function appends a fresh complete block. The resulting file has two start markers and one end marker. On the **next** call, `indexOf(VIBE_HOOKS_MARKER_END, start)` finds the end marker of the newly-appended block, so everything between the two markers is removed — which spans the entire second managed block including the freshly written hooks. In the interim Vibe loads a `hooks.toml` with a dangling partial managed block and duplicate `before_tool`/`post_agent_turn` entries, causing double-firing chimes until the next provisioning run fixes it.

A minimal guard — stripping from `start` to end-of-file when `end === -1` — avoids the transient duplicate state.

```suggestion
	if (start !== -1) {
		const end = base.indexOf(VIBE_HOOKS_MARKER_END, start);
		if (end !== -1) {
			base =
				base.slice(0, start) + base.slice(end + VIBE_HOOKS_MARKER_END.length);
		} else {
			// Orphaned start marker (truncated/partial write) — remove everything
			// from the start marker to end of file so we don't accumulate blocks.
			base = base.slice(0, start);
		}
	}
```

Reviews (1): Last reviewed commit: "feat(ui): use the official Mistral Vibe ..." | Re-trigger Greptile

Comment on lines +51 to +57
if (start !== -1) {
const end = base.indexOf(VIBE_HOOKS_MARKER_END, start);
if (end !== -1) {
base =
base.slice(0, start) + base.slice(end + VIBE_HOOKS_MARKER_END.length);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Orphaned start marker silently skips cleanup

When VIBE_HOOKS_MARKER_START is present in an existing hooks.toml but VIBE_HOOKS_MARKER_END is missing (e.g. a previous partial write), the if (end !== -1) guard skips stripping and the function appends a fresh complete block. The resulting file has two start markers and one end marker. On the next call, indexOf(VIBE_HOOKS_MARKER_END, start) finds the end marker of the newly-appended block, so everything between the two markers is removed — which spans the entire second managed block including the freshly written hooks. In the interim Vibe loads a hooks.toml with a dangling partial managed block and duplicate before_tool/post_agent_turn entries, causing double-firing chimes until the next provisioning run fixes it.

A minimal guard — stripping from start to end-of-file when end === -1 — avoids the transient duplicate state.

Suggested change
if (start !== -1) {
const end = base.indexOf(VIBE_HOOKS_MARKER_END, start);
if (end !== -1) {
base =
base.slice(0, start) + base.slice(end + VIBE_HOOKS_MARKER_END.length);
}
}
if (start !== -1) {
const end = base.indexOf(VIBE_HOOKS_MARKER_END, start);
if (end !== -1) {
base =
base.slice(0, start) + base.slice(end + VIBE_HOOKS_MARKER_END.length);
} else {
// Orphaned start marker (truncated/partial write) — remove everything
// from the start marker to end of file so we don't accumulate blocks.
base = base.slice(0, start);
}
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/main/lib/agent-setup/agent-wrappers-vibe.ts
Line: 51-57

Comment:
**Orphaned start marker silently skips cleanup**

When `VIBE_HOOKS_MARKER_START` is present in an existing `hooks.toml` but `VIBE_HOOKS_MARKER_END` is missing (e.g. a previous partial write), the `if (end !== -1)` guard skips stripping and the function appends a fresh complete block. The resulting file has two start markers and one end marker. On the **next** call, `indexOf(VIBE_HOOKS_MARKER_END, start)` finds the end marker of the newly-appended block, so everything between the two markers is removed — which spans the entire second managed block including the freshly written hooks. In the interim Vibe loads a `hooks.toml` with a dangling partial managed block and duplicate `before_tool`/`post_agent_turn` entries, causing double-firing chimes until the next provisioning run fixes it.

A minimal guard — stripping from `start` to end-of-file when `end === -1` — avoids the transient duplicate state.

```suggestion
	if (start !== -1) {
		const end = base.indexOf(VIBE_HOOKS_MARKER_END, start);
		if (end !== -1) {
			base =
				base.slice(0, start) + base.slice(end + VIBE_HOOKS_MARKER_END.length);
		} else {
			// Orphaned start marker (truncated/partial write) — remove everything
			// from the start marker to end of file so we don't accumulate blocks.
			base = base.slice(0, start);
		}
	}
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 420b6cf.

getVibeHooksTomlContent now strips from the start marker to end-of-file when VIBE_HOOKS_MARKER_END is absent:

} else {
  // Orphaned start marker (partial/interrupted write) — strip to EOF.
  base = base.slice(0, start);
}

so an orphaned/partial block can no longer produce duplicate [[hooks]] entries or a dangling marker. Added a regression test ("cleans up an orphaned start marker left by a partial write") covering the missing-end-marker path.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop/src/main/lib/agent-setup/agent-wrappers-vibe.ts`:
- Around line 48-61: Update getVibeHooksTomlContent so it removes an existing
managed block even when VIBE_HOOKS_MARKER_START is present but
VIBE_HOOKS_MARKER_END is missing. In the existing marker handling branch, after
locating VIBE_HOOKS_MARKER_START, treat a missing end marker as “strip from
start to end-of-file” instead of leaving the old block in place, then continue
with the existing trim-and-append flow using buildVibeManagedHooksBlock so
duplicate [[hooks]] entries and dangling markers are not emitted.

In `@plans/20260709-mistral-vibe-agent-impl-plan.md`:
- Around line 658-664: The Task 4.3 “optional” labeling is incorrect because the
marketing/docs discovery surfaces are part of the required core scope. Update
the plan section so the Mistral Vibe additions are treated as mandatory across
the referenced surfaces, including the marketing components, docs enumerations,
and mobile store keywords; keep the existing file references like
UniversalCompatibilityDemo, AppMockup/constants, mcp.mdx, terminal-presets.mdx,
and store.config.json aligned with the required scope.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6fe7507e-da7e-41ea-aadc-595f4f4d6f7e

📥 Commits

Reviewing files that changed from the base of the PR and between b8fbf3d and 527aa13.

⛔ Files ignored due to path filters (3)
  • apps/marketing/public/app-icons/vibe.svg is excluded by !**/*.svg
  • bun.lock is excluded by !**/*.lock
  • packages/ui/src/assets/icons/preset-icons/vibe.svg is excluded by !**/*.svg
📒 Files selected for processing (24)
  • AGENTS.md
  • apps/desktop/src/main/lib/agent-setup/agent-wrappers-vibe.ts
  • apps/desktop/src/main/lib/agent-setup/agent-wrappers.test.ts
  • apps/desktop/src/main/lib/agent-setup/agent-wrappers.ts
  • apps/desktop/src/main/lib/agent-setup/desktop-agent-capabilities.ts
  • apps/desktop/src/main/lib/agent-setup/desktop-agent-setup.ts
  • apps/desktop/src/renderer/routes/_authenticated/components/AgentHooks/hooks/useDefaultV2TerminalPresets/default-v2-terminal-presets.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/agents/components/V2AgentsSettings/components/AgentIconPicker/agent-icon-options.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts
  • apps/docs/content/docs/mcp.mdx
  • apps/docs/content/docs/terminal-presets.mdx
  • apps/marketing/src/app/components/FeaturesSection/components/UniversalCompatibilityDemo/UniversalCompatibilityDemo.tsx
  • apps/marketing/src/app/components/HeroSection/components/AppMockup/constants.ts
  • apps/mobile/store.config.json
  • packages/host-service/src/events/map-event-type.test.ts
  • packages/host-service/src/events/map-event-type.ts
  • packages/host-service/src/trpc/router/agents/agents.ts
  • packages/shared/src/agent-command.test.ts
  • packages/shared/src/agent-models.test.ts
  • packages/shared/src/agent-models.ts
  • packages/shared/src/builtin-terminal-agents.ts
  • packages/ui/src/assets/icons/preset-icons/index.ts
  • plans/20260709-mistral-vibe-agent-first-class.md
  • plans/20260709-mistral-vibe-agent-impl-plan.md

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 27 files

Architecture diagram
sequenceDiagram
    participant User as Desktop User
    participant DesktopUI as Desktop Renderer
    participant HostService as Host Service (tRPC)
    participant Terminal as Terminal PTY
    participant VibeWrapper as Vibe PATH Wrapper
    participant VibeProc as Mistral Vibe Process
    participant NotifyScript as notify.sh (hooks)
    participant EventMapper as Event Mapper
    participant Indicator as Working Indicator / Chime

    Note over User,Indicator: Mistral Vibe launch & lifecycle flow

    User->>DesktopUI: Select "Mistral Vibe" + model
    DesktopUI->>HostService: agents.run (presetId: "vibe", model: "mistral-medium-3.5")
    HostService->>HostService: Build command: "vibe --trust --auto-approve '<prompt>'"
    HostService->>HostService: Build model env: { VIBE_ACTIVE_MODEL: "mistral-medium-3.5" }
    HostService->>Terminal: Create terminal session with env overlay (includes VIBE_ACTIVE_MODEL)
    Terminal->>Terminal: Spawn login shell, exec command via PATH
    Terminal->>VibeWrapper: Shell resolves "vibe" → managed wrapper script
    VibeWrapper->>VibeWrapper: export SUPERSET_AGENT_ID="vibe"
    VibeWrapper->>VibeWrapper: export VIBE_ENABLE_EXPERIMENTAL_HOOKS="true"
    VibeWrapper->>VibeProc: exec real vibe binary with same args
    VibeProc->>VibeProc: Read ~/.vibe/hooks.toml (pre-provisioned)
    Note over VibeProc: Hooks include before_tool & post_agent_turn → notify.sh
    VibeProc->>VibeProc: Start solving task (multiple tool calls)

    loop For each tool call
        VibeProc->>NotifyScript: Execute before_tool hook command (stdin JSON)
        NotifyScript->>EventMapper: POST event "before_tool"
        EventMapper->>EventMapper: mapEventType("before_tool") → "Start"
        EventMapper-->>Indicator: Update working indicator active
    end

    VibeProc->>NotifyScript: Execute post_agent_turn hook (agent idle)
    NotifyScript->>EventMapper: POST event "post_agent_turn"
    EventMapper->>EventMapper: mapEventType("post_agent_turn") → "Stop"
    EventMapper-->>Indicator: Stop working indicator + play chime
    Indicator-->>DesktopUI: Visual feedback (working / done)

    Note over VibeProc,NotifyScript: Agent setup (runs once before first launch)
    Note over VibeProc: ~/.vibe/hooks.toml written with marker guard<br/>before_tool & post_agent_turn entries
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@ThomsenDrake

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. Addressed the one actionable code finding — the orphaned start-marker edge case in the Vibe hooks.toml writer — in 420b6cf (fix + regression test).

On the CodeRabbit pre-merge warnings:

  • Out-of-scope changes: the mobile store keywords and marketing/docs entries are the discovery surfaces that make the agent findable (the same treatment the existing built-in agents get), and the two plans/ docs follow this repo's plans/ convention (AGENTS.md rule Feat/tabs #6). Happy to split any of these into a follow-up if a tighter diff is preferred.
  • Docstring coverage: the new public helpers carry JSDoc; can expand coverage on the changed files if the threshold is enforced.

@ThomsenDrake

Copy link
Copy Markdown
Contributor Author

Hey @Kitenite I'd love to get a review on this. Myself and a couple of my coworkers at Mistral love Superset and would love to be able to use our Vibe CLI on it!

Kitenite added 2 commits July 9, 2026 15:25
…lock

When the end marker was missing, orphaned-block recovery stripped from the
start marker to end-of-file, silently deleting any user [[hooks]] that followed
our managed block. Strip only our own superset-notify-* tables and stop at the
first foreign TOML table instead.
Vibe re-implemented getClaudeManagedHookCommand verbatim (only SUPERSET_AGENT_ID
differed), so a rename of notify.sh or a change to the runtime guard would silently
drift the Vibe copy. Extract getManagedNotifyHookCommand(agentId) + a shared
MANAGED_NOTIFY_RELATIVE_PATH in agent-wrappers-common and route both Claude and
Vibe through it.
@Kitenite

Kitenite commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

Looks great! one last note while i was testing was auth broke if i needed to sign in first into browser. i had to sign in first and then rerun the auth to work

https://console.mistral.ai/codestral/cli/authenticate?process_id=bd0b560b-41b2-4372-96e6-f1fac172fa33&complete_token=n2Rx7J1PMnDPSGzML03GpPqnFCiJGL67

Screenshot 2026-07-09 at 3 36 46 PM

@Kitenite

Kitenite commented Jul 9, 2026

Copy link
Copy Markdown
Member

There's also no running hook only stop hook?

@Kitenite

Kitenite commented Jul 9, 2026

Copy link
Copy Markdown
Member

Note on the orphaned-marker fix (420b6cf): the strip-to-EOF (base.slice(0, start) when the end marker is missing) that all three bots suggested silently deletes any user [[hooks]] sitting below the managed block — it trades a transient duplicate for real data loss. Safer to strip only our own superset-notify-* tables and stop at the first foreign TOML table, so trailing user hooks survive. Verified: with a user hook after an end-marker-less block, strip-to-EOF drops it.

This branch had an error being deployed

1 failed deployment
preview — f786a22f Deployed Jul 9, 2026 by Kitenite via Deploy Database (Neon) #6316
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.

[feat] First-class Mistral Vibe coding agent support

2 participants