Files
tty7/docs/agents/overview.mdx
Austin Spragginsandl0ng-ai 2cdc26f357 Wire hooks, resume and detection for Kimi Code CLI (#694)
* feat(agents): wire hooks, resume and detection for Kimi Code

Kimi Code CLI takes its hooks as [[hooks]] entries in the same
config.toml that holds the user's providers and models, so this adds a
third install strategy — a format-preserving TOML merge on toml_edit —
beside the JSON map merge and the owned files. Like Qwen it reports
permission requests first-class, so it gets no Notification hook.
Resume rides `kimi --session <id>`; fork stays unwired, Kimi
documents none.

Closes #693

Signed-off-by: Austin Spraggins <spragginsdesigns@gmail.com>

* fix(agents): harden the Kimi Code TOML hook merge and its resume flags

The TOML merge strategy the Kimi wiring introduces round-trips a shared
config.toml cleanly, but three gaps sat behind it.

`hooks_state` counted only the marked entries that still named an event,
so a hand-edit that dropped the key off one of nine entries left the
remaining eight matching the roster exactly and the file reported
Installed with a broken entry in it. Every marked entry now counts,
which is what the JSON merge already did and what `refresh_hooks` needs
to see.

A `hooks = []` spelled as an empty inline array made install fail
outright -- toml_edit keeps an empty array and an array of tables apart,
but the two say the same thing and neither carries any configuration. It
is now promoted rather than refused. Every other wrong-shaped `hooks`
key -- a string, a table, a non-empty inline array -- still refuses with
the file left byte-for-byte alone.

`Stop` is not the only way a Kimi turn ends: its own event reference says
`Stop` does not fire on interrupts and `Interrupt` fires instead, and a
turn that dies on an error reports `StopFailure`. Without those two an
Esc or a failed turn left the pane on "working" for good and `tty7 wait`
could only ever time out. Both are observation-only events and report
the same end of turn `Stop` does.

On resume, `--agent` and `--agent-file` join the stale flags: Kimi
rejects either next to `--session` at startup, and resuming rebinds the
session agent by itself, so replaying them turned a working resume into
a launch error.

Tests cover the wrong-shaped `hooks` keys, a config.toml that does not
parse on both install and uninstall, a file that does not exist yet, a
second install being byte-for-byte the first, mangled and surplus marked
entries, an uninstall threading between the user's own entries and the
tables after them, and the `--session=<id>`, bare `--session`,
`--continue` and `--agent` spellings on the resume path.

---------

Signed-off-by: Austin Spraggins <spragginsdesigns@gmail.com>
Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
2026-08-20 09:51:05 +08:00

109 lines
3.4 KiB
Plaintext

---
title: "Coding agents"
description: "What tty7 does around Claude Code, Codex, and 17 others — without ever wrapping them."
---
tty7 recognises coding agents running in a pane and builds around them. It does
not wrap them, proxy them, or replace their interface: the agent you start is
the agent you get, running in a normal PTY, with its own UI. tty7 adds the
things a terminal is in a position to add — who is running where, what they
need, and what changed.
<Frame caption="Placeholder — screenshot: a sidebar of agent sessions across several repos, each with a brand avatar and status dot">
<img src="/images/placeholder.svg" alt="Agent sessions in the tty7 sidebar" />
</Frame>
## Which agents
Nineteen CLIs are recognised on sight, by the command running in the pane:
| Agent | Command |
|---|---|
| Claude Code | `claude`, `claude-code` |
| Codex | `codex`, `codex-cli` |
| Gemini | `gemini`, `gemini-cli` |
| Copilot | `copilot` |
| Cursor | `cursor-agent` |
| Amp | `amp` |
| OpenCode | `opencode` |
| Aider | `aider`, `aider-chat` |
| Goose | `goose` |
| Droid | `droid` |
| Grok | `grok` |
| Qwen Code | `qwen`, `qwen-code` |
| Kimi Code | `kimi`, `kimi-code` |
| Auggie | `auggie` |
| Hermes | `hermes` |
| Vibe | `vibe`, `vibe-acp` |
| Antigravity | `agy`, `antigravity` |
| Pi | `pi` |
| Oh My Pi | `omp` |
Detection sees through the usual disguises: a full path, a `.cmd` or `.exe` on
Windows, leading environment assignments, and an interpreter in front
(`node .../claude/cli.js`).
### Your own wrapper
If you launch agents through a wrapper script, map its name to an agent in
`config.json`:
```json
{
"agent_commands": {
"cc": "claude",
"work": "codex"
}
}
```
The key is your command's name; the value is one of the slugs above (`claude`,
`codex`, `gemini`, `aider`, `amp`, `opencode`, `copilot`, `cursor`, `goose`,
`droid`, `pi`, `auggie`, `hermes`, `vibe`, `antigravity`, `grok`, `qwen`,
`omp`, `kimi`).
## What you get for free
Just by running an agent in a pane:
<CardGroup cols={2}>
<Card title="Brand avatars" icon="id-badge">
The tab chip and sidebar row show which agent runs where, so ten tabs stay
legible.
</Card>
<Card title="Git context" icon="code-branch">
The branch and working-tree diff on the row, refreshed as the agent works.
</Card>
<Card title="Session resume" icon="rotate-left">
A pane lost to a reboot relaunches the conversation, carrying its original
flags. [More →](/agents/sessions)
</Card>
<Card title="Context feed" icon="paper-plane">
Palette commands that hand the current selection or the repo's `git diff` to
the running agent as a prompt.
</Card>
</CardGroup>
## What needs a hook
Live status — **working**, **needs your input**, **done** — comes from the agent
itself, over a channel tty7 installs into that agent's configuration. It powers
the status dots, the notifications, the tray icon, and `tty7 wait`.
Installing takes one click per agent under **Settings → Agents**.
[Status and notifications →](/agents/status)
## Where to go next
<CardGroup cols={3}>
<Card title="Status and notifications" icon="circle-dot" href="/agents/status">
Hooks, status dots, the tray icon.
</Card>
<Card title="Sessions" icon="code-branch" href="/agents/sessions">
Resume, fork, and copying a session id.
</Card>
<Card title="Orchestration" icon="diagram-project" href="/agents/orchestration">
One agent driving another with `tty7 wait`.
</Card>
</CardGroup>