feat: add Mistral Vibe external agent plugin#4
Conversation
… script Analyze Mistral Vibe (v2.6.2) for external agent protocol compatibility. Key findings: no native hook system, but rich session management via ~/.vibe/logs/session/ with meta.json + messages.jsonl (structured JSONL). Capabilities: transcript_analyzer=true, token_calculator=true, hooks=false. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 21de3e7235f8
Comprehensive reference for adding lifecycle hooks to Mistral Vibe's open source codebase. Covers hook config format, payload schemas, integration points in the agent loop, and how it maps to the Entire CLI external agent protocol. Designed to be used as a standalone reference by an implementing agent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 8b8486ede423
Implement the entire-agent-mistral-vibe binary with full protocol subcommand support (info, detect, sessions, transcripts, hooks, transcript analysis). Add 30 E2E tests covering all subcommands and register Mistral Vibe as an agent for shared lifecycle tests. Updated AGENT.md to reflect verified lifecycle hooks (session_start, user_prompt_submit, pre_tool_use, post_tool_use, turn_end) with captured payloads from real Vibe sessions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 5cdc3adc6a68
- InstallHooks now adds the repo to ~/.vibe/trusted_folders.toml so Vibe reads project-level .vibe/config.toml (required for hooks to fire) - ParseHook turn-end now globs ~/.vibe/logs/session/ to find the actual session directory matching the session ID prefix - Add comprehensive unit tests for agent, hooks, and transcript analysis using golden JSONL data from real Vibe session captures Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: e108d2f670de
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
| } | ||
|
|
||
| return os.WriteFile(configPath, []byte(strings.Join(filteredLines, "\n")), 0o600) | ||
| } |
There was a problem hiding this comment.
UninstallHooks leaves orphan TOML table headers in config
High Severity
UninstallHooks only filters lines containing hookMarker ("entire hooks mistral-vibe"), but the TOML section headers like [[hooks.session_start]] don't contain that marker. After filtering, orphan [[hooks.session_start]], [[hooks.user_prompt_submit]], etc. lines remain. The remaining check only handles empty or "[hooks]", so these orphan headers cause the file to be rewritten with invalid leftover TOML instead of being deleted. This leaves .vibe/config.toml in a broken state after uninstall.
| content := strings.Join(tomlLines, "\n") | ||
| if err := os.WriteFile(configPath, []byte(content), 0o600); err != nil { | ||
| return 0, fmt.Errorf("failed to write config.toml: %w", err) | ||
| } |
There was a problem hiding this comment.
InstallHooks overwrites existing project config file entirely
High Severity
InstallHooks builds hook TOML lines from scratch and writes them via os.WriteFile, which truncates .vibe/config.toml. Any existing Vibe project-level configuration (model settings, custom tools, other TOML sections) in that file is silently destroyed. The Kiro agent avoids this by writing hooks to separate dedicated files rather than the main config.
| return a | ||
| } | ||
| return b | ||
| } |
…ead min Extract duplicated session ID fallback above the switch in ParseHook, simplify redundant sessionRef guard in ReadSession, and remove unused min helper (builtin in Go 1.21+). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: caf6d3c50a6a
SessionPersistence: ParseHook(turn-end) returned empty SessionRef when
Vibe's native logs were absent (e.g. test envs), so the entire CLI
skipped session writing. Add ensurePlaceholderTranscript() fallback that
creates a {} file at .entire/tmp/{id}.json, matching Kiro's pattern.
RewindAfterCommit: WaitForCheckpoint only waited for checkpoint branch
advancement, but condensation runs async. Replace the single rewind-list
check with condition-based polling (30s) for the shadow point to become
logs-only.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 99e4793da14a
The entire CLI does not call write-session during hook processing.
For Kiro, captureTranscriptForStop copies the transcript into
.entire/tmp/ as a side effect of parse-hook, so a session file exists.
Vibe was returning the native log path (~/.vibe/logs/session/...)
directly as SessionRef — nothing was written to .entire/tmp/.
Add cacheTranscriptForTurnEnd which copies the native Vibe transcript
into .entire/tmp/{sessionID}.json and returns the local path. Falls
back to a {} placeholder when native logs are absent.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: cd955dffa249
Replace magic numbers (1, 2, 3) for event types with named constants EventTypeSessionStart, EventTypeTurnStart, EventTypeTurnEnd. Remove unused NativeToProtocolHook map and its test — the mapping was only tested, never used in production code. Remove unused VibeSessionMeta and VibeSessionStats types (placeholder definitions with no consumers). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: d140fbb39172


Summary
Add Mistral Vibe as an external agent plugin for the Entire CLI, implementing the full agent binary protocol.
entire-agent-mistral-vibe) with all protocol subcommands:info,detect,get-session-id,get-session-dir,resolve-session-file,read-session,write-session,read-transcript,chunk-transcript,reassemble-transcript,format-resume-command,parse-hook,install-hooks,uninstall-hooks,are-hooks-installed,get-transcript-position,extract-modified-files,extract-prompts,extract-summary.vibe/config.tomland trusts the repo directory via~/.vibe/trusted_folders.tomlcreatePlaceholderTranscriptpattern)RewindAfterCommittest timing: condition-based polling for condensation instead of single checkTest plan
go test ./...— 40/40 passgo vet -tags=e2e ./...SessionPersistence,RewindAfterCommit(requires full Entire CLI + Vibe binary)entire enable --agent mistral-vibein a repo with.vibe/🤖 Generated with Claude Code