Two modes
- Chat — non-streaming, implemented as
ai_chat_sync. - Agent — streaming with tool calling, implemented as
run_agent_stream. In Agent mode the assistant can call tools on connected servers.
Two isolated kinds of chat
- Application-level chat in the inspector sidebar: it belongs to no terminal, and the backend refuses all of its shell tools.
- Terminal-bound chat docked in each pane: it can execute
run_command, read files and “send to terminal”.
This split is the main safety boundary: only the conversation attached to a terminal can act on that host.
Endpoint profiles
Several AiEndpointProfile entries can be saved, each with its own:
- API key (stored encrypted)
- Endpoint URL
- Model name
- System prompt
Available models can be pulled from {endpoint}/v1/models.
API key storage
Keys are encrypted with an AES-256-GCM file vault. The key file vault.key is bound to
the current machine; the operating system keychain is not used.
Using the assistant
- Images: attach images to a message, or paste them; clicking a thumbnail opens the full image.
- Templates: a template dropdown inserts prompts.
- Resend: edit any historical message and send it again.
- Cancel:
cancel_ai_chataborts an in-flight generation. - Send to terminal: code blocks or selected text are inserted into the target pane according to the connection type (SSH, local shell, serial or Telnet). Insertion only; nothing is executed.
Review before running. The insert-only behaviour is deliberate: you can inspect the generated command
in the terminal prompt and press Enter yourself.
Related chapters
- Chapter 12 — Data location, migration & backup: where the vault key lives.
- Chapter 13 — Troubleshooting: key errors after moving data.