Skip to content

feat(vibe): add managed hook transport, live status, and session resume - #18813

Open
Djiit wants to merge 5 commits into
stablyai:mainfrom
Djiit:feat/vibe-hook-integration
Open

Djiit wants to merge 5 commits into
stablyai:mainfrom
Djiit:feat/vibe-hook-integration

Conversation

@Djiit

@Djiit Djiit commented Sep 5, 2026 •

Copy link
Copy Markdown

Summary

Mistral Vibe was registered as a launchable agent but had no integration with Orca's hook, status, or resume systems. Vibe now supports hooks (TOML [[hooks]] blocks: pre_tool, post_tool, post_agent), so this brings it to parity with Kimi and Claude.

Wired: managed hook install into ~/.vibe/hooks.toml, HTTP route /hook/mistral-vibe with event normalization, and session resume via vibe --resume <id> (gated behind agent-session.vibe-resume.v1 capability). Local-only, and install is skipped on Windows where Vibe runs hooks through cmd.exe.

ELI5

Orca is a terminal app that watches coding agents (like Claude Code or Codex) and shows their live status in a sidebar (what tool they're running, when they're done) and lets you resume a past session. To do this, the agent must emit lifecycle events Orca can listen to.

Mistral Vibe was launchable from Orca but emitted nothing Orca understood, so its sidebar stayed blank and you couldn't resume its sessions. Vibe recently added a hook system (lifecycle events), so this PR plugs Vibe into Orca's existing listener, same pattern as Kimi, giving Vibe live status, tool display, and resume.

What Changed

  • New src/main/vibe/: managed hook service modeled on Kimi. Writes a marker-delimited block of three [[hooks]] entries (orca-pre-tool, orca-post-tool, orca-post-agent) into ~/.vibe/hooks.toml, plus a POSIX launcher script that captures stdin, POSTs to Orca's local hook server, and spools on failure. Orca is a read-only observer: the script always exits 0 with empty stdout and never denies or rewrites Vibe's tool decisions.
  • New providers: vibe-events.ts normalizes pre_tool/post_tool to working, post_agent to done; vibe-tool-fields.ts extracts tool_name/tool_input/tool_output/tool_error.
  • Wired into registries and switches: AgentHookTarget, AgentHookSource, /hook/mistral-vibe route, provider dispatch, isNewTurnEvent/extractToolFields exhaustive switches, all four managed-hook-registry arrays, RESUMABLE_TUI_AGENTS + getAgentResumeArgv (vibe --resume <id>).
  • New runtime capability agent-session.vibe-resume.v1: gates the resume path so an older remote host answers the unknown enum member safely instead of dying.
  • Windows gate: VibeHookService skips install on win32 (returns skipReason: "platform_unsupported") because Vibe runs hooks via cmd.exe and cannot execute a /bin/sh script. install() and remove() also strip any stale managed block left by a prior macOS/Linux install, so a reused home directory does not leave Vibe a broken hook. Added platform_unsupported to AgentHookInstallSkipReason and a MANAGED_HOOK_POSIX_ONLY_AGENTS allowlist the managed-hook-script-refresh coverage test reads to exempt Vibe under a forced win32 platform.

Why

Vibe is in Orca's catalog and process recognition, but without hook/status/resume integration it had no live status, no tool visibility, and no session continuity. Vibe's new hook contract is structurally identical to Claude's (stdin JSON + exit-code/stdout) but TOML-configured like Kimi, so the Kimi marker-block template is the right fit: simple, local-only, no trust system needed. The read-only-observer discipline matters because Vibe's pre_tool can gate or rewrite tools, so Orca must never interfere, only observe.

The Windows gate exists because, unlike Kimi (whose shell is Git Bash on Windows and accepts a forward-slashed .sh), Vibe has no working shell for .sh on win32. Installing anyway would write a hook Vibe cannot run, and a failed pre_tool could gate tools instead of passing through.

Linked Issue

Fixes #19261

Visual Proof

image

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Manual: local vibe 2.24.3 on macOS. Confirmed ~/.vibe/hooks.toml gets three orca-* blocks, the managed script exists and POSTs, the sidebar shows working + tool name/input during tool calls and done at turn end, and vibe --resume <id> relaunches the session.

Automated: 3 new test files (22 tests): vibe/hook-config-toml.test.ts, vibe/hook-service.test.ts, providers/vibe-events.test.ts. pnpm tc clean; pnpm test agent-hook 1139 pass; coverage gate managed-hook-script-refresh passes; oxlint clean. Platforms tested: macOS. Windows not tested on-device, but the win32 skip and stale-block cleanup are covered by forced-platform unit tests. Remote SSH not tested (local-only scope by design).

AI Disclosure

I used vibe (obviously) and zAI GLM 5.2.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: Managed script is read-only/exit-0 and cannot influence Vibe's tool decisions. No user input flows into the shell; the endpoint file is sourced with errors suppressed. Config writes are atomic (temp+rename).

Cross-platform: POSIX /bin/sh only. Windows is skipped (platform_unsupported), and install()/remove() strip any stale managed block from a prior POSIX install so Vibe does not inherit a hook cmd.exe cannot run. macOS and Linux fully covered.

Remote SSH: Not wired (no installRemote), local-only by design. The remote-hook-service-installers.test.ts guard now lists Vibe (cast as local-only). Remote is future work.

Mobile: No mobile-specific change; the resume path mirrors existing resumable agents.

Backwards compatibility: New optional AgentHookSource member; the new capability is additive and probed before use, so mixed client/host versions degrade safely. No wire or opcode changes to existing agents.

Performance: Hook events are infrequent (per-tool, per-turn) with no hot-path impact. Config write is atomic with a rolling .bak.

Known limitation: Vibe appears in the sidebar only at the first pre_tool/post_agent event, not on TUI start, because Vibe has no session_start hook (upstream gap).

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@Djiit
Djiit marked this pull request as ready for review September 5, 2026 08:48
@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e89ceb5d-7b25-44e4-b2f4-390165ae2e9d

📥 Commits

Reviewing files that changed from the base of the PR and between 10e8c52c28c39b7afcba5bcd278d6bebc5fe2482 and c65f59ce8264024f3304da30784540e93d95922c.

📒 Files selected for processing (2)
  • src/main/agent-hooks/managed-hook-command-contract.test.ts
  • src/main/vibe/hook-service.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/agent-hooks/managed-hook-command-contract.test.ts
  • src/main/vibe/hook-service.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Adds Mistral Vibe as a supported local agent. The change installs and manages Vibe hooks.toml entries and a POSIX hook script on non-Windows platforms. It routes Vibe hook requests, extracts tool fields, and normalizes agent status events. It adds session extraction, resume arguments, runtime capability negotiation, registry wiring, platform skip handling, and related tests.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to c65f5

Linux users following the unpaired troubleshooting command may invoke a binary that cannot start the server. Correct the example before merge or ensure affected users are informed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 51.35% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 22 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes: managed hook transport, live status, and session resume support for Vibe.
Description check ✅ Passed The description includes all required template sections, explains the implementation and rationale, identifies issue #19261, documents visual proof, testing, platform scope, security, compatibility, a…
Linked Issues check ✅ Passed The PR meets the coding requirements in #19261. It adds the local /hook/mistral-vibe route, event normalization for pre_tool, post_tool, and post_agent, tool-field extraction, live status, and…
Out of Scope Changes check ✅ Passed The changes remain within #19261. The hook ownership, orphan-block protection, CRLF preservation, script refresh, and Windows cleanup support the required Vibe managed-hook lifecycle. The registry and…

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.

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 0e662573-f109-4ed0-8eb7-aae044b94ba7

📥 Commits

Reviewing files that changed from the base of the PR and between 9927edd and 2e0c381a8d57d1190fc5ff4a46a1c580e1283e29.

📒 Files selected for processing (20)
  • config/tsconfig.cli.json
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/agent-hooks/server-retired-pane-new-turn.test.ts
  • src/main/vibe/hook-config-toml.test.ts
  • src/main/vibe/hook-config-toml.ts
  • src/main/vibe/hook-script-source.ts
  • src/main/vibe/hook-service.test.ts
  • src/main/vibe/hook-service.ts
  • src/renderer/src/runtime/agent-resume-host-authority-capability.ts
  • src/shared/agent-hook-listener/provider-dispatch.ts
  • src/shared/agent-hook-listener/provider-event-routing.ts
  • src/shared/agent-hook-listener/providers/vibe-events.test.ts
  • src/shared/agent-hook-listener/providers/vibe-events.ts
  • src/shared/agent-hook-listener/providers/vibe-tool-fields.ts
  • src/shared/agent-hook-listener/source-routing.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-session-resume.ts
  • src/shared/protocol-version.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/vibe/hook-config-toml.ts Resolved
Comment thread src/main/vibe/hook-script-source.ts Resolved

@pullfrog pullfrog 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.

Important

Vibe's hook installer is registered unconditionally, so a Windows machine with vibe on PATH installs a POSIX-only /bin/sh command into ~/.vibe/hooks.toml — a hook Vibe (via cmd.exe) can't execute. Gate the service on non-win32 (details inline).

Reviewed changes

  • Managed hook transport (src/main/vibe/): a marker-delimited [[hooks]] block written into ~/.vibe/hooks.toml plus a read-only POSIX observer script, modeled on Kimi's TOML install and Codex's post_*_hook script.
  • Event normalization (src/shared/agent-hook-listener/providers/vibe-*.ts): maps pre_tool/post_tool → working (with tool fields/output) and post_agent → done, which also doubles as the new-turn boundary.
  • Registries & switches: AgentHookSource/AgentHookTarget gain mistral-vibe, /hook/mistral-vibe route, and the exhaustive dispatch/tool-field/new-turn switches are extended.
  • Session resume: mistral-vibe joins RESUMABLE_TUI_AGENTS, resolves vibe --resume <id>, gated behind a new agent-session.vibe-resume.v1 capability.
  • Tests: three new suites (16 tests) covering the TOML block, the service, and event normalization, plus the remote-installer guard test.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Comment thread src/main/vibe/hook-service.ts Resolved
@Djiit

Djiit commented Sep 5, 2026

Copy link
Copy Markdown
Author

On the docstring coverage warning (41.67%, threshold 80%) — declining.

This repo's project convention (AGENTS.md: "Concise/Brief Non-obvious Comments ONLY — DO NOT be verbose, explain the obvious, walk through the code") is the opposite of an 80% docstring target. The new Vibe files follow that rule: comments explain only the non-obvious why (passthrough discipline, "exit" vs "empty-object" capture policy, marker-block preservation), not the what. Chasing an 80% docstring rate would add noise the project ruleset explicitly tells contributors to avoid.

@pullfrog pullfrog 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.

ℹ️ No critical issues — the Windows-gating fix lands cleanly; one minor cross-platform test suggestion inline.

Reviewed changes

  • Gated Vibe hooks on non-win32: VibeHookService.install() / getStatus() / remove() now return a skipped status (skipReason: "platform_unsupported") and refreshManagedScripts() no-ops on Windows, so Orca no longer writes a POSIX-only /bin/sh launcher into ~/.vibe/hooks.toml that cmd.exe can't execute.
  • Coverage-test exemption: a new MANAGED_HOOK_POSIX_ONLY_AGENTS allowlist lets managed-hook-script-refresh.test.ts skip the reverse refresher→file check for Vibe under a forced win32 platform.
  • New skip reason: platform_unsupported added to AgentHookInstallSkipReason, plus four Windows-path tests in hook-service.test.ts.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Comment thread src/main/vibe/hook-service.test.ts Resolved

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 5e66b3c0-4bc0-46f1-b3a9-db0f03eb6c87

📥 Commits

Reviewing files that changed from the base of the PR and between 2e0c381a8d57d1190fc5ff4a46a1c580e1283e29 and eb5e3a5bb77a23c12ced7d74e61312ff44349357.

📒 Files selected for processing (5)
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/managed-hook-script-refresh.test.ts
  • src/main/vibe/hook-service.test.ts
  • src/main/vibe/hook-service.ts
  • src/shared/agent-hook-types.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/vibe/hook-service.ts Resolved

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — one follow-up commit addressing the prior test-platform-gating thread, plus a Windows stale-hook cleanup.

  • POSIX test enforcement: the outer beforeEach now forces setPlatform('darwin') so the non-Windows tests run POSIX regardless of host platform (restored in afterEach), matching the antigravity/hook-service.test.ts precedent.
  • Stale-block cleanup on Windows: stripStaleManagedBlock() strips a managed block left by a prior macOS/Linux install before install()/remove() return skipped, so a reused home dir can't leave Vibe a POSIX pre_tool command cmd.exe can't execute. Idempotent — no write when the block is absent.
  • New tests: two Windows-path tests assert install/remove strip a POSIX-inherited block.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 088d9079-b85a-4ac4-bf90-e850f87a0a99

📥 Commits

Reviewing files that changed from the base of the PR and between eb5e3a5bb77a23c12ced7d74e61312ff44349357 and 6acb06b1ed451626bf4e2b777a9f77a89189eed3.

📒 Files selected for processing (7)
  • .github/workflows/cloud-deploy-relay-production-director.yml
  • config/scripts/verify-localization-catalog.mjs
  • docs/reference/windows-edr-posture.md
  • docs/site/content/docs/install.mdx
  • docs/site/content/docs/remote-servers.mdx
  • src/main/vibe/hook-service.test.ts
  • src/main/vibe/hook-service.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@Djiit
Djiit force-pushed the feat/vibe-hook-integration branch from 6acb06b to 9af4d08 Compare September 6, 2026 06:29

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Dropped unrelated doc/workflow noise: the formatter churn (cloud-deploy-relay-production-director.yml, verify-localization-catalog.mjs, windows-edr-posture.md, install.mdx, remote-servers.mdx) bundled into the prior revision is gone — the branch now touches only Vibe-hook files.
  • Rebased the stale-block + POSIX-test fix: 9af4d08 is a clean two-file commit. stripStaleManagedBlock() (idempotent cleanup of a macOS/Linux-managed block on the win32 install/remove path) and the outer setPlatform('darwin') beforeEach are unchanged from the previously approved version.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker

Copy link
Copy Markdown
Contributor

Heads-up from #20148 (fixes #18861) — this is not a review of the feature, just one file that will collide.

src/main/vibe/hook-config-toml.ts here is a copy of the Kimi module as it stood before the fix, including the regex at the heart of the data-loss bug:

const MANAGED_BLOCK_RE = new RegExp(
  `\\n*${escapeRegex(BLOCK_START)}[\\s\\S]*?(?:${escapeRegex(BLOCK_END)}[^\\n]*|$)`,
  'g'
)

The |$ alternative means that if the end marker ever goes missing — a hand-edit, or any tool that round-trips the file through a TOML serializer, since the markers are comments — everything from the start marker to EOF is treated as Orca's and deleted on the next install or uninstall. On a real config.toml that took a user's file from 3308 bytes to 134 and destroyed their API key and their own [[hooks]] table.

#20148 replaced that approach with src/main/agent-hooks/managed-toml-ownership.ts, shared across providers. Adopting it here is small: build the marker pair plus a recognizer for a [[hooks]] table whose command invokes the managed script, then stripManagedTomlRegions over both. Kimi's module is a worked example of the whole shape.

Credit to @cat-xierluo, who flagged this lockstep risk on #19033 before either PR landed.

No action needed if #20148 merges first and this branch rebases onto the shared module — flagging so the copy does not ship as-is.

@nwparker

Copy link
Copy Markdown
Contributor

Following up now that #20148 has merged (438e0f4) — restating this so it can't be missed by whoever picks this branch up.

src/main/vibe/hook-config-toml.ts in this PR will reintroduce a data-loss bug (#18861) unless it's updated. It carries a verbatim copy of the regex that was the bug:

const MANAGED_BLOCK_RE = new RegExp(
  `\\n*${escapeRegex(BLOCK_START)}[\\s\\S]*?(?:${escapeRegex(BLOCK_END)}[^\\n]*|$)`,
  'g'
)

The |$ alternative means a missing end marker makes everything from the start marker to EOF "Orca's" and deletes it on the next install or uninstall. The markers are TOML comments, so they go missing on an ordinary hand-edit or any tool that round-trips the file through a TOML serializer. Measured on a real config.toml: 3308 bytes to 134, destroying the user's API key and their own [[hooks]] table.

What to use instead — src/main/agent-hooks/managed-toml-ownership.ts:

  • findManagedTomlBlocks(text, { startMarker, endMarker }) — marker extent. Compare markers against the whole trimmed line; an orphan owns only its own marker line.
  • findRecognizedManagedTables(text, recognize) — a [[hooks]] table whose command invokes the managed script, wherever it sits in the file.
  • stripManagedTomlRegions(text, [...blocks, ...tables]) — merges overlaps and splices once, offset-based so CRLF round-trips verbatim.

src/main/kimi/kimi-hook-config-toml.ts is the worked example; the Vibe version should be close to a rename. Two things worth copying rather than re-deriving:

  • Use the same recognition for remove, install and status. If status can't see a table that install doesn't remove, install appends a second table for the same event and the hook double-fires.
  • Fail closed on unknown table extent — if a key line follows a blank or comment inside the table, the extent isn't knowable by line scanning and splicing it strands keys without their header.

Credit to @cat-xierluo, who flagged this lockstep risk on #19033 before either PR landed.

Happy to review the swap if that's useful — no other comment on the feature itself.

@Djiit

Djiit commented Sep 14, 2026

Copy link
Copy Markdown
Author

Adopted. hook-config-toml.ts is now built on managed-toml-ownership.ts — findManagedTomlBlocks for the marker pair plus a recognizer for a [[hooks]] table whose command invokes the managed script, spliced via stripManagedTomlRegions. Close to a rename of the Kimi module as you suggested: install, remove and status share one module-level matcher (isManagedVibeCommand), the recognizer fails closed on unknown table extent, and the #18861 regression tests are ported (user tables appended after an orphaned block survive remove and reinstall; an orphan owns only its marker line; CRLF round-trips verbatim). Branch rebased onto main so the shared module is present. Thanks for the detailed heads-up.

@Djiit
Djiit force-pushed the feat/vibe-hook-integration branch from 9af4d08 to 10e8c52 Compare September 14, 2026 09:26

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f4d2e9c4-a01a-49f7-b57d-0a92aeb5b995

📥 Commits

Reviewing files that changed from the base of the PR and between 6acb06b1ed451626bf4e2b777a9f77a89189eed3 and 10e8c52c28c39b7afcba5bcd278d6bebc5fe2482.

📒 Files selected for processing (11)
  • config/tsconfig.cli.json
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/managed-hook-command-contract.test.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/vibe/hook-config-toml.test.ts
  • src/main/vibe/hook-config-toml.ts
  • src/main/vibe/hook-service.ts
  • src/shared/agent-hook-listener/provider-event-routing.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-session-resume.ts
  • src/shared/protocol-version.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/vibe/hook-service.ts Resolved

@pullfrog pullfrog 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.

ℹ️ No critical issues — the #18861 ownership port lands cleanly; one minor test-ratchet suggestion inline.

Reviewed changes — incremental delta since the prior pullfrog review (9af4d08): commit 10e8c52 rebuilds Vibe's TOML ownership on the shared managed-toml-ownership module.

  • Adopted shared TOML ownership: hook-config-toml.ts drops its verbatim Kimi marker regex for findManagedTomlBlocks + findRecognizedManagedTables + stripManagedTomlRegions, so install/remove/status share one ownership matcher and an orphaned start marker owns only its stray marker line (#18861).
  • Strict table recognizer: matchManagedHookTable parses the [[hooks]] key run and fails closed on unknown extent; readManagedVibeHookTypes counts managed tables wherever they sit.
  • CRLF-preserving writes: buildManagedVibeHooksBlock / apply / remove thread the config's EOL through, so a Windows-edited config round-trips verbatim.
  • Ported #18861 regression suite: orphaned block with a user tail, stray marker, user [[hooks]] table, customized managed table, and CRLF round-trip.
  • Registered mistral-vibe in the command contract as a local-only POSIX builder, plus a remote-direction exception for local-only agents.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — incremental delta since the prior pullfrog review (10e8c52, #5196238668): commit c65f59c addresses the one open inline thread and hardens the config write.

  • Narrowed the contract-test remote skip: the #7253 reverse ratchet in managed-hook-command-contract.test.ts now only skips agents that have a local builder, so exemption-only agents (amp, hermes) are asserted present in the remote registry again while Vibe's local-only exemption still holds.
  • Pinned the atomic hooks.toml write mode: writeConfigToml now uses 0600 for a new file and preserves the existing file's statSync().mode & 0o777, so the renameSync that replaces the inode can no longer promote a umask-derived temp-file mode onto the user's config.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Mistral Vibe was registered as a launchable agent but had no integration with
Orca's hook, status, or resume systems. Vibe now supports hooks (TOML
[[hooks]] blocks: pre_tool, post_tool, post_agent), so this closes the gap at
parity with Kimi/Claude.

Wired: managed hook install into ~/.vibe/hooks.toml, HTTP route
/hook/mistral-vibe with event normalization, and session resume via
vibe --resume <id> (gated behind agent-session.vibe-resume.v1 capability).
Local-only.
  Vibe spawns hook commands via asyncio.create_subprocess_shell, which is
  cmd.exe on Windows. The managed launcher is POSIX /bin/sh, so installing it
  on win32 writes a hook Vibe cannot execute — and a failed pre_tool could gate
  tools instead of passing through. Skip the whole service on win32 until a
  .cmd launcher exists.

  Adds a 'platform_unsupported' skip reason and a POSIX-only allowlist the
  managed-hook-script-refresh coverage test reads to exempt Vibe under a
  forced win32 platform.
  The non-Windows hook-service tests assumed POSIX but ran against the real
  process.platform, so they would fail on a Windows host where the service now
  returns 'skipped'. Force darwin in the outer beforeEach (the on-Windows block
  overrides to win32), mirroring antigravity/hook-service.test.ts.

  Also strip any existing managed Vibe block on the win32 install/remove path.
  A home dir reused after a macOS/Linux install can still hold the managed POSIX
  pre_tool command, which Vibe runs via cmd.exe on Windows and fails before tool
  calls. The strip is idempotent (no write when the block is absent).
…ck data loss (stablyai#18861)

The Vibe TOML module carried a verbatim copy of the Kimi marker-block
regex whose |$ fallback treated everything from an orphaned start marker
to EOF as Orca-owned. Rebuild it on managed-toml-ownership.ts: a marker
pair proves extent, and any [[hooks]] table whose command invokes the
managed script is reclaimed by recognition wherever it sits. Install,
remove and status share one ownership matcher; unknown table extent
fails closed; CRLF round-trips verbatim. Ports the stablyai#18861 regression
suite from Kimi and registers mistral-vibe in the managed-hook command
contract (local-only, POSIX-only).
…te mode

The contract-test skip for local-only agents also matched exemption-only
agents (amp, hermes), silencing the stablyai#7253 remote-registry ratchet for
them; narrow it to agents with a builder entry. And pin the atomic config
write: renameSync replaces the inode, so the umask-derived temp mode
became the config's mode — use 0600 for new files and preserve the
existing mode on update.

This branch has not been deployed

No deployments
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.

Vibe hook transport, live status, and session resume integration

2 participants