You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 96f71c2
Browse filesBrowse the repository at this point in the historyBrowse files
feat: steer a streaming answer on request (opt-in, Ctrl+Enter)
Guidance injected before the next LLM call still had to wait for the answer that was
already streaming, so a long text answer could not be redirected until it finished on
its own. No API can rewrite output that has already been generated, so the only way to
have the guidance read sooner is to abort that one request and ask again.
The session now tracks the streaming request separately from the turn. When the user
asks to steer, that request is aborted, whatever the model already wrote is kept as an
assistant message marked meta.interrupted, and the loop immediately issues a new
request that carries the guidance. Tools are never interrupted: steering only targets
the model stream, so a running command finishes first and the guidance is injected at
the next request boundary.
Steering is opt-in, so an existing setup keeps behaving exactly as before:
- Ctrl+Enter steers that one message.
- steerMode: "interrupt" makes plain Enter steer as well; the default is "queue".
- session: steerActiveSession(), a per-request steer signal released once the request
settles, and LlmSteeredError carrying the partial answer
- session: a steered answer is not an interruption - the turn continues, the status
stays completed, and the aborted request is not retried
- settings: steerMode ("queue" by default)
- cli: Ctrl+Enter is parsed from its CSI-u sequence, forwarded as
PromptSubmission.steer, and the cut-short answer is labelled in the transcript;
the footer mentions the shortcut
- tests: core covers the aborted stream, the follow-up request payload, the kept
partial answer and the no-op case; the cli covers the key parsing, the steering
submit, and steerMode resolution
- docs: configuration table and section, README and quickstart key tables
Refs lessweb#113, lessweb#117
|`steerMode`| string | How a prompt sent while the model is writing is handled: `"interrupt"` (cut the answer short so the prompt is read immediately, default) or `"queue"` (wait for the next request boundary) |
36
37
|`filesApiEnabled`| boolean | Send images through the DeepSeek Files API (default `false`) |
37
38
|`filesApiTimeoutMs`| number | Per-image Files API timeout; defaults to `60000`, maximum `600000` ms |
38
39
|`fileExpiresAfterSeconds`| number | Remote file lifetime, default `604800` seconds |
@@ -106,6 +107,25 @@ Controls whether the current model is treated as a multimodal model that accepts
106
107
107
108
Use this to override the default detection when your model is not in the known-model list, or when its actual capability differs from the default.
108
109
110
+
#### `steerMode` — Steering While the Model Is Writing
111
+
112
+
Controls whether a prompt sent while the model is still producing an answer also cuts that answer
|`queue` (default) | The prompt waits and is injected before the next LLM call of the running turn |
118
+
|`interrupt`| The answer that is streaming is cut short; its text is kept in the conversation and the prompt is read immediately |
119
+
120
+
`Ctrl+Enter` cuts the streaming answer short for that one message regardless of this setting, so
121
+
steering stays available without changing the default for every prompt. On terminals that do not
122
+
report `Ctrl+Enter` (it needs modifyOtherKeys mode), set `steerMode: "interrupt"` instead.
123
+
124
+
Either way the prompt becomes a user message of the running turn, so the model can revise or
125
+
supersede the instructions it was already following. Running commands are never interrupted:
126
+
steering only affects the model stream, so a tool that is executing finishes first and the
127
+
prompt is injected at the next request boundary. Pressing `Esc` still interrupts the whole turn.
128
+
109
129
#### DeepSeek Files API
110
130
111
131
When `BASE_URL` is `https://api.deepseek.com`, enabling `filesApiEnabled` uploads images to the fixed `https://api.deepseek.com/files` endpoint and sends `file_id` references in chat requests. Other API endpoints do not enable this feature. An upload or cache-refresh failure fails the request; disabling the setting preserves the existing image path.
0 commit comments