Skip to content
Mr-Shine09Public

About

Vibe Pet — an ambient desktop companion for Mistral Vibe CLI. Adds pre_agent and agent_waiting observer hooks. Mistral Vibe Hackathon, Track 02.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

114 Commits

Folders and files

Repository files navigation

Zephyr app logo

Zephyr

Your coding agent, when you are not at the keyboard.

Watch your Mistral Vibe session live. Talk to it. Answer it from your phone.

Mistral Vibe Hackathon · Track 02 — improving Mistral Vibe


Presentation assets

The image above is Zephyr's transparent character sprite, pre-scaled 4x with nearest-neighbor interpolation for slides. Download the presentation PNG, the native sprite, or the full animation contact sheet when presenting the mascot's live session states.


The forty minutes nobody talks about

You give your agent a real job. A migration, a refactor, a test suite to green. It starts working, so you go get coffee.

You come back forty minutes later. It has been stopped for thirty-eight of them, waiting for you to press y on a single shell command.

That is not a rare failure. It is the normal shape of agentic coding, and it is invisible: a CLI is headless, so the moment you switch windows you cannot tell working from finished from stopped an hour ago waiting on you. The agent did not fail. It waited. Politely. Into the void.

Zephyr makes that state visible, audible, and — the part that matters — answerable from wherever you actually are.


What it does

Codex and Claude tell you when a task is done. That is the wrong resolution. You want to know what your agent is doing now, and you want to be able to answer it — while it is still running.

🐈 Live, not "finished" The mascot tracks the session continuously — turn started, thinking, reading a file, running a shell command, failed, waiting on you. Every activity carries the tool's name, so the pet animates differently for each one. Not one notification at the end.
🎙 Call it by name "Hey Zephyr, also run the tests when you're done." The rest of the sentence becomes the agent's next instruction. You did not type it, you did not switch windows, you did not have to be in the room.
✋ Answer it When it stops for permission, the prompt comes to you — with the actual command — and your allow or deny is the real decision.
📱 Teleport it Attach a companion from your phone and it sees the same session. Control is not tied to the machine the agent runs on.
🔊 Hear it Voxtral both directions: it speaks when it needs you, and it transcribes what you say back.

The loop

you start a task  →  pet tracks every activity live  →  it stops, or you think of something
                                                              ↓
        agent carries on with it  ←  becomes the agent's next prompt  ←  you say it out loud

That is the whole product: a terminal you can watch from across the room and talk back to.


The wow

A companion is not a notification. It is a way to talk to a running terminal.

You said this to your pet. You never typed it.

$ you say out loud:       "hey zephyr, also tell me what python version this is"
$ what the terminal ran:  vibe -p "what is the capital of France"

  Paris
  Python 3.14.5

The second answer was never in the prompt. It was spoken to the companion while the turn was running, and it became the agent's next instruction. Vibe's post_agent denial injects its reason as a real Role.user turn — so the session does not restart, it simply carries on with what you said.

Recorded in companion/evidence/talking-to-the-companion.txt.

And when it asks permission, the answer steers it too. A companion attached from another device, and the person holding it said "Do not use ls. Use find . -maxdepth 1 -type f instead."

-- bash wants to run --
ls -la .../companion 2>/dev/null || echo "Directory not found"
deny  ->  "Do not use ls. Use 'find . -maxdepth 1 -type f' instead."

-- bash wants to run --
find .../companion -maxdepth 1 -type f

The agent's next command is the one the sentence asked for.

The denial does not merely stop the tool — its reason is handed to the model as feedback. So talking to your companion is not a stop button. It is steering, from a device that is not the one the agent is running on.

That transcript is in companion/evidence/companion-answers-a-real-session.txt, captured from live vibe runs.


Why this is a diff on Mistral's codebase, not an app beside it

Track 02 asks for missing capacities added to the open Vibe codebase. Here is the one we found.

Vibe's hooks could already gate a session (pre_tool) and audit it (post_tool, post_agent). They could not observe one. Two states had no signal at all:

  • A turn starting. post_agent fired when a turn ended. Nothing fired when one began.
  • A turn blocked on a human. pre_tool fires before the permission prompt, whether or not a prompt follows, and returns immediately. Nothing fired when the prompt actually appeared.

So the state a session spends the most wall-clock time in — stopped, waiting on a person, possibly for an hour — was invisible to every hook that existed.

This fork adds both, as a new class of hook:

// agent_waiting — fired when progress requires a human
{
  "hook_event_name": "agent_waiting",
  "session_id": "opaque-session-id",
  "waiting_on": "approval",        // or "user_input"
  "tool_name": "bash",
  "tool_call_id": "opaque-tool-call-id"
}

tool_input is deliberately absent. An observer needs to know the session is blocked, not what it was about to do — so nothing your pet says aloud can read out a file path or a command. There is a test asserting it never appears.

Observer hooks cannot deny, rewrite, or retry. A returned decision is parsed and dropped rather than treated as a failure, and match/strict are rejected at config load. A broken or opinionated desktop toy must never be able to change the coding session it is watching.


How it fits together

flowchart LR
    V["Mistral Vibe session"]
    H["harness.py<br/>one live view"]
    M["macOS mascot<br/>unix socket, unchanged"]
    P["companion<br/>another device"]
    X["Voxtral<br/>speak / listen"]

    V -->|"mirror.py: every activity"| H
    V <-->|"gate.py: ask, then answer"| H
    H -->|"steer.py: your words become the next prompt"| V
    H --> M
    H <--> P
    H <--> X
Loading

Three ways in, one state:

  • Hooks speak HTTP. mirror.py posts every activity with its tool name; gate.py posts a tool call and blocks on the answer; steer.py picks up whatever you said and hands it to the model as the next instruction.
  • Companions attach over an authenticated newline-delimited JSON protocol on TCP — bidirectional, so they are told what is happening and may answer.
  • The existing mascot needs no changes at all. Every event is still pushed to its own unix socket, so the proven app keeps working while new companions attach alongside it.

Attach two companions and both see the same session. That is the teleport: control is not tied to the machine the agent is running on. Protocol v2 uses a random pairing token and enforces the active holder on the relay, so a device that is merely watching cannot answer an approval.

The trick that makes answering possible

agent_waiting is an observer and may only watch. But pre_tool is a gate — it may block, and it may return a decision. Run Vibe with --yolo so the local prompt steps aside, and whatever device you are holding becomes the session's real permission authority.

// harness -> companion
{"v":2,"type":"ask","request_id":"…","tool_name":"bash","tool_input":"rm -rf build/"}
// companion -> harness
{"type":"decision","request_id":"…","decision":"deny","reason":"Use the cache dir instead."}

And the same trick, one hook along, is what lets you talk to the session. post_agent denial injects its reason as a retry user message — a real Role.user turn, flagged injected — so a sentence said to a companion becomes the agent's next prompt. Vibe caps it at three per hook per turn, which is the right ceiling: a companion may steer a session, it may not seize one.

The observer hooks above are a change to Vibe's core. Neither of these two is: the gate/observer distinction and the post-turn retry were already in Vibe's design, and a companion you can watch and talk to falls out of using them as intended.

The mascot attaches through CompanionLink.swift — a connection the app keeps open, rather than the one-shot write a hook makes, so it can be told what the session is doing and answer back. COMPANION_LINK.md is the wiring guide. The command text a person must read to decide travels in its own type, kept deliberately outside the envelope that drives animation — the mascot never needs to know what the command was, and never learns.

The harness also has desktop-local Voxtral speech endpoints. POST /speak turns a sentence into audio; PUT /listen turns recorded audio into text and files it as the reason for the next decision. These remain loopback-only in the local-network MVP; phone voice will move onto an encrypted transport before it is enabled remotely.


Where this actually bites

Not hypotheticals — these are the situations the waiting state costs you:

  • The lunch-break refactor. Long job, you step away, it stops on command three of forty. You lose the whole break, not the whole job.
  • You are in a standup. The agent hits something destructive and waits. You glance at your phone, read the actual command, and deny it with a reason — without opening a laptop in a meeting.
  • Overnight and long-running work. Nothing could tell you a run had stalled versus finished. Now something can, and it can also be told to carry on.
  • Reviewing an agent you do not fully trust yet. --yolo plus a companion is strictly safer than --yolo alone: the prompt moves to your pocket instead of disappearing.
  • Anything built on Vibe's hooks. The two new hook types are not ours alone. Any observability tool, audit log, dashboard, or alerting integration can now see a turn begin and see a session block. That was simply not expressible before.

Try it

uv sync
uv run pytest tests/core/hooks -q          # 85 upstream + 6 new = 91 passing

The replay — no API key, no network, no agent. Launch Zephyr.app, click the pawprint in the menu bar, choose Summon Vibe, then:

uv run python companion/demo.py --list     # the seven beats
uv run python companion/demo.py            # walk the pet through a session

A companion deciding for a live session:

uv run python companion/install.py --project   # wire the hooks
uv run python companion/harness.py             # prints a vibepet:// pairing URI
uv run python companion/attach.py --token TOKEN
uv run vibe -p "run ls in this directory" --auto-approve --trust

The companion prints each activity as it happens, and stops on each tool call. Answer a, d, or type a sentence — a sentence is a denial with an instruction attached, and it is what the model reads next.

To talk to a running session without waiting for a prompt, say something and it becomes the agent's next instruction when the turn ends:

curl -X POST localhost:8787/say -d '{"text":"also run the tests when you are done"}'

Or just say its name:

uv run python companion/wake.py --name zephyr      # listens for "hey zephyr"
uv run python companion/wake.py --push-to-talk     # safer in a loud room
uv run python companion/wake.py --say "run the tests"   # no microphone at all

Three ways in on purpose. An open mic in a loud room is how a live demo dies, so the microphone is never the only path — --say has no audio driver and no Voxtral in it, and cannot fail.

Voice, if MISTRAL_API_KEY is set — the harness gives every companion the same one rather than each building its own:

curl -X POST localhost:8787/speak -d '{"text":"Vibe is waiting for you."}' -o say.wav
curl -X PUT  localhost:8787/listen --data-binary @say.wav      # -> {"text": "..."}

Nothing here can break your session

This code runs inside somebody's real coding session, so every path fails open:

If this breaks What happens
Harness not running Hook exits 0 with empty stdout. The tool runs.
Mascot not summoned Delivery returns false. Nobody notices.
Companion crashes mid-decision Gate gives up at 45s — inside Vibe's 60s hook timeout, so what ends the wait is a decision, never a hook failure.
No MISTRAL_API_KEY The companion goes mute, not broken.
An observer hook throws Caught before it reaches the code that was about to start a turn.

Hooks never write to stdout — Vibe's contract is exit 0, empty stdout = passthrough — with exactly one exception: gate.py, which writes a denial, because that is the one thing a gate is for.


Zephyr on iPhone

The native SwiftUI client is in companion/ios. It renders the same Zephyr atlas as macOS, accepts vibepet:// pairing links, stores its pairing in the iOS Keychain, follows lifecycle events, transfers control, and answers tool approvals.

cd companion/ios
xcodegen generate
open ZephyrPhone.xcodeproj

Start the harness on the computer and paste its printed pairing URI into the app (or open the URI on the phone). The current transport is intended only for a trusted local network: pairing is authenticated and hook HTTP stays bound to loopback, but companion frames are not yet TLS-encrypted. Internet relay, background delivery, and push notifications are not part of this MVP.

Voice control from iPhone

Launch the harness from a shell that has MISTRAL_API_KEY available. After the phone connects and takes control, tap Speak to Vibe, say one short instruction, then tap Stop and Send. The phone records a bounded 16 kHz WAV; the authenticated companion link carries it to the harness, Voxtral transcribes it, and steer.py gives the transcript to the live Vibe session as its next instruction. The app displays the transcript and plays a Voxtral acknowledgement.

Spoken approval alerts are enabled by default. When a Bash or other tool approval arrives, the phone asks the harness to synthesize a short status line that includes only the tool name—never the command arguments. The toggle in the Voice control card can mute those alerts without disabling push-to-talk.

Phone-control proof

These captures are from a physical iPhone controlling a live Vibe session over the local network. The phone holds control, receives the exact Bash approval, can deny it with corrective instructions, and can hand authority back and forth with the desktop. The final terminal capture shows Vibe receiving the denial reason supplied on the phone.

Phone holds the session Live command approval Corrective denial
Zephyr connected with control on the iPhone A live Bash tool call awaiting approval on the iPhone A corrective denial instruction entered on the iPhone
Control on desktop Phone can take control Vibe receives the instruction
Zephyr showing that control is on the desktop Zephyr offering to take control and answer the approval Vibe terminal showing the tool denial and corrective phone instruction

Evidence

Every claim above has something behind it.

  • 127 passing Python tests — Vibe's hook, companion relay, steering, and voice coverage. The native macOS package has 259 passing tests, and the iPhone target has 5 passing tests.
  • Hooks on real sessions — all five types firing against live vibe runs, including the run that stops at an approval prompt.
  • A companion deciding for a real session — one run allowed, one denied, and the model obeying the denial's reason.
  • Physical iPhone control evidence — pairing, control ownership, a live Bash approval, corrective denial, control handoff, and the resulting instruction delivered to Vibe.
  • Talking to the companion — two live sessions given a new instruction by voice alone, and the note queue draining exactly once.
  • On screen — the mascot's waiting animation, driven by a real agent_waiting payload.
  • ~95 ms median for the agent_waiting hook against its 60-second timeout, because speech is handed to a detached process rather than awaited.
  • Voxtral verified live — round-tripped a sentence to WAV and back to text through /speak and /listen.
  • git diff upstream/main — the whole submission.

What's in here

vibe/core/hooks/models.py      two new HookTypes + their invocations
vibe/core/hooks/_observer.py   ObserverHandler — told what happened, cannot answer
vibe/core/hooks/manager.py     notify() — fire-and-forget, cannot raise upward
vibe/core/agent_loop/…         the two fire sites
tests/core/hooks/…             6 new tests

companion/harness.py           what companions plug into
companion/gate.py              pre_tool — asks the companion, may deny
companion/mirror.py            observers — every activity, with its tool name
companion/steer.py             post_agent — what you said becomes the next prompt
companion/wake.py              listens for the companion's name
companion/attach.py            reference companion + the way to drive it all
companion/speech.py            Voxtral, both directions
companion/hook.py, bridge.py   the macOS mascot path
companion/install.py           writes hooks.toml with absolute paths
companion/hooks.example.toml   what that config looks like
companion/demo.py              scripted replay, no network and no agent
companion/macos/               the native app: sprite atlas, 16 states, sound
  …/MascotTransport/CompanionLink.swift   the mascot's own link to the harness

Built on Mistral Vibe, Mistral AI's open-source CLI coding assistant. Upstream and this fork are Apache 2.0.

Vibe could already read you its answer. It could not tell you it was stuck.

About

Vibe Pet — an ambient desktop companion for Mistral Vibe CLI. Adds pre_agent and agent_waiting observer hooks. Mistral Vibe Hackathon, Track 02.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages