Agent chats

An agent chat is a conversation in the browser whose work — reading files, writing files, running commands — happens on a machine running the LLeMbas CLI. Nothing ever runs on the server itself.

What it takes

Three things on the server, all off by default on purpose:

  1. Admin → Agents switched on;
  2. the Run commands permission for the people who should use it;
  3. at least one model marked for agent execution under Admin → Models.

And on the machine where the work is, the LLeMbas CLI, logged in and running as a service, with at least one folder allowed:

shell
lembas login https://your-server
lembas service install
loginctl enable-linger $USER      # keep it running while nobody is logged in
lembas remote add ~/code          # a folder remote sessions may use

Or, on a desktop, LLeMbas Desktop: it carries the CLI and runs it for you. Choose Link this computer, then add folders under Settings…. There, the computer you are using is listed first, as Local.

No folders until you add one. A newly linked machine allows no folders. It is listed on the server all the same, but its directory browser says it allows none, and how to add one: in LLeMbas Desktop, or with lembas remote add <dir> on that machine. A running service picks the change up within seconds.

The machine decides what it allows, in the remote: block of its global config.yaml. lembas remote sets the common keys — add, remove, enable, disable, mode, terminal — without editing YAML (see the CLI page); the rest are written by hand:

yaml
remote:
  enabled: true
  roots: [/home/you/code, /srv/work]  # the only directories a remote session may use
  max_mode: edit                # the most a remote session may run in
  approval_timeout: 600         # seconds before an unanswered approval is a denial
  require_trust: true           # only directories trusted on this machine
  terminal: false               # true: allow the browser's terminal panel here

Choose the machine with care. The containment is that machine. A throwaway container built for the job is a very different thing from your own workstation, and LLeMbas cannot tell them apart. Choose roots and max_mode accordingly.

Start a chat

  1. Switch the sidebar to Agents. Each linked device has its own section; offline ones are dimmed. In LLeMbas Desktop, the computer you are using comes first, as Local — hover it for its name.
  2. Press the device’s +, and choose a directory and a mode. The chat starts in the directory you last worked in on that device; the directory button lists the ones you have used there, newest first, with Browse… for the device’s roots and trusted directories. On a device you have not used yet, the button goes straight to the browser, and the message waits until you pick one.
  3. Write your message. The directory and device are fixed once the chat exists; the mode and model can change at any time.

Modes

ModeReadsWrites filesRuns commands
Manualasksasksasks
Editfreefreeasks
Autofreefreefree
Planfreeasksasks

The mode is enforced at every step, not written into the prompt — anything a model reads may try to argue with a rule that lives only in text. The device may lower a mode to its own max_mode, never raise it. Plan finishes by putting a plan to you, with a button that carries it out in Edit (or Manual) — see Planning.

Approvals, questions and plans

When the agent needs you, a card appears in the chat: an approval for a command or a file change, a question with options (the recommended one marked, plus Something else), or a plan to approve, send back or dismiss. If the session is also open in a terminal, the same card is there — the first answer counts and the other goes away. An approval nobody answers becomes a denial after the device’s timeout.

Files, commands and attachments

  • @ lists the device’s own files, ranked the way its terminal ranks them. The device reads the file when the message arrives — nothing is copied to the server.
  • / offers the device’s commands after the server’s own, marked On the device: custom commands, skills and built-ins such as /compact, /undo, /review and /init.
  • Attachments reach the device: pictures as images, documents as text, anything else as a file — up to 10 MB a file and 25 MB a message.

One session, two places

A session runs in exactly one place — the device — and both the browser and the terminal are windows onto it.

  • With the service running, a session you open in a terminal (in a directory the remote: limits allow) appears as a chat, with its earlier turns, and every turn typed in the terminal shows up as it happens.
  • /remote in the terminal shares the current session by name, outside those limits, for as long as the terminal is open.
  • A message typed while the agent works goes in at its next step, from either side.
  • Switching model or effort on the device follows into the chat. A model that exists only on the device shows as on the device: ….
  • Renaming, compacting or deleting the chat reaches the device. A delete made while the device is offline is delivered when it is back.
  • A reply that was running when the server restarted is picked up again, never sent twice.
  • With LLeMbas CLI 1.3.0 on the device, Edit and Regenerate work on an agent chat as in any chat: the turn and every later one are taken out of the conversation and the device’s history, as /undo does there, and a terminal that has the session open is rewound and redrawn. Files the device changed in those turns are not undone — the rewind is of the conversation, not the working tree.
  • With LLeMbas CLI 1.5.0 on the device and LLeMbas Server 1.6.0, a Jobs strip above the message box lists the session’s background work — commands the agent runs in the background (or that went there when their time ran out) and subagents started with background: true — with how long each has run and a Stop button. A subagent’s row opens a side panel with its transcript, followed live, and a box to message it; a message to a finished subagent starts it again with its context intact. When a job ends, its note is given to the model and shown in the chat as the harness’s turn; the same strip and panel show the server’s own helpers in an ordinary chat.

The terminal panel

An agent chat has a Terminal button that opens a real shell on the device, in the chat’s directory, beside the conversation. It needs the Open a terminal permission on the server and remote.terminal: true on the device.

  • The modes do not apply: what you type is yours, as in any terminal. The model cannot see the panel.
  • Copy takes the last command and its output; Send puts it into the message box; Auto collects every command you run into your next message. Nothing is sent on its own.
  • With the device’s shell integration (bash, zsh, fish), the header follows the shell’s directory, each command gets a green or red mark for its exit status, and Ctrl+Shift+↑/↓ jump between commands.
  • Closing the panel does not end the shell; a build keeps running and you reattach with the scrollback.

Tokens and credits

A device using the server’s models does so through the server’s API, which counts and charges them once. A model of the device’s own costs the server nothing.