bots-garden/mini-mepublic Fork
⑂ main
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
steering.md · 34 lines · 3.5 KBmarkdown
Blame HistoryOpen raw

Steering a running turn

What is this about?

A turn is often long: the model calls a tool, reads the result, calls another, and so on, sometimes for dozens of steps. When you see it going the wrong way, you want to tell it — without throwing away what it has done. In the line mode and in the window, a question sent during a turn does that: it reaches the model at its next call, inside the same turn (ticket 265). This page explains how, and why it works the way it does.

How it works

Each turn gets an inbox. A question sent during a turn (Enter) goes into it. Before every call to the model, the turn looks at the inbox, and when the call follows tool results it appends the waiting questions to the history as user messages, labelled [message from the user during this turn]. The label tells the model it is a correction of the task in progress, not a new task. From then on the question is part of the turn: the next calls carry it, the session keeps it, and ↑ recalls it without the label.

The hook is the same one that shrinks a long turn before a call when it passes the context threshold (in-turn compression): the one place where mm sees every model call of a turn and can change what the model reads.

Why only after tool results

A question is taken only by a call that follows tool results. A user message right after the question, or right after the model's own answer, is two user turns in a row or a turn after the end — shapes chat templates handle badly or not at all. After tool results, a user message is ordinary OpenAI wire; it was checked on llama.cpp with gpt-oss 20B, Qwen3.5 2B and LFM3 1.7B, which all answered with the correction applied.

The consequence: a question sent while the model writes its final answer — no tool call, so no call after it — comes too late for this turn. It is not lost: when the turn ends, mm runs it as the next question and says so.

Why Enter steers, and /queue waits

Before, Enter during a turn queued the question for after the turn (ticket 155), so the model only saw a correction once it had finished, often after many steps in the wrong direction. Steering is what a correction needs, so it got the key you press without thinking. Queueing is still useful — "and then, write the tests" — so it moved to /queue <question>, in both the line mode and the window. Alt-Enter was not used for it: it already inserts a newline, like Ctrl-J.

Slash commands are never steered: they act on the session (/new, /compact…) and wait for the turn to end, as before.

Where it does not exist

  • The editor (ACP): Zed keeps a message typed during an external agent's turn in its own queue and sends it when the turn ends; its "Steer" toggle serves Zed's own agent only. ACP's v2 prompt RFD lets a client send a prompt during a turn; once Zed and the Go SDK speak it, the same inbox can take it (ticket 266). Until then, /redirect <message> (ticket 267) is the nearest thing: sent with Zed's "Send Now", which cancels the turn first, it runs a turn on the history the cancelled one left — mm keeps its commands and results — with the message framed as a correction of that task. It is not a steer: the turn does stop, and a command running at that moment is stopped with it.
  • mm -p and asked agents have no user during the turn.

See also

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Steering a running turn

## What is this about?

A turn is often long: the model calls a tool, reads the result, calls another, and so on, sometimes for dozens of steps. When you see it going the wrong way, you want to tell it — without throwing away what it has done. In the line mode and in the window, a question sent during a turn does that: it reaches the model at its next call, inside the same turn (ticket 265). This page explains how, and why it works the way it does.

## How it works

Each turn gets an inbox. A question sent during a turn (Enter) goes into it. Before every call to the model, the turn looks at the inbox, and when the call follows tool results it appends the waiting questions to the history as user messages, labelled `[message from the user during this turn]`. The label tells the model it is a correction of the task in progress, not a new task. From then on the question is part of the turn: the next calls carry it, the session keeps it, and ↑ recalls it without the label.

The hook is the same one that shrinks a long turn before a call when it passes the context threshold (in-turn compression): the one place where mm sees every model call of a turn and can change what the model reads.

## Why only after tool results

A question is taken only by a call that follows tool results. A user message right after the question, or right after the model's own answer, is two user turns in a row or a turn after the end — shapes chat templates handle badly or not at all. After tool results, a user message is ordinary OpenAI wire; it was checked on llama.cpp with gpt-oss 20B, Qwen3.5 2B and LFM3 1.7B, which all answered with the correction applied.

The consequence: a question sent while the model writes its final answer — no tool call, so no call after it — comes too late for this turn. It is not lost: when the turn ends, mm runs it as the next question and says so.

## Why Enter steers, and `/queue` waits

Before, Enter during a turn queued the question for after the turn (ticket 155), so the model only saw a correction once it had finished, often after many steps in the wrong direction. Steering is what a correction needs, so it got the key you press without thinking. Queueing is still useful — "and then, write the tests" — so it moved to `/queue <question>`, in both the line mode and the window. Alt-Enter was not used for it: it already inserts a newline, like Ctrl-J.

Slash commands are never steered: they act on the session (`/new`, `/compact`…) and wait for the turn to end, as before.

## Where it does not exist

- **The editor (ACP)**: Zed keeps a message typed during an external agent's turn in its own queue and sends it when the turn ends; its "Steer" toggle serves Zed's own agent only. ACP's v2 prompt RFD lets a client send a prompt during a turn; once Zed and the Go SDK speak it, the same inbox can take it (ticket 266). Until then, `/redirect <message>` (ticket 267) is the nearest thing: sent with Zed's "Send Now", which cancels the turn first, it runs a turn on the history the cancelled one left — mm keeps its commands and results — with the message framed as a correction of that task. It is not a steer: the turn does stop, and a command running at that moment is stopped with it.
- **`mm -p` and asked agents** have no user during the turn.

## See also

- The keys and messages: [slash commands and window keys](../reference/slash-commands.md).
- Using it: [How to use the window mode](../how-to/use-the-window-mode.md).
- The other thing that rewrites a turn between calls: [context compression](context-compression.md).