Skip to content

Commit 54626e4

Browse files
feat: allow up to 20 guidance prompts to wait for the next step
10 was a conservative guess rather than a measured limit. The queue drains at the next request boundary, so this only caps how many instructions can pile up faster than one step of the turn (a long tool run or a long streaming answer). Raising it to 20 keeps that burst covered while still bounding the cost: every queued prompt travels with each remaining request of the turn, so an unbounded queue could inflate the context (and any attached images) without limit. - the queue is not dropped or reordered; it still drains in FIFO order before every LLM call of the turn - when the limit is reached the prompt is refused but stays in the input box, so nothing the user typed is lost Refs lessweb#113, lessweb#117
1 parent fa47951 commit 54626e4

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎README-en.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ turn. The model therefore reads it together with the work it already did and can
102102
supersede the earlier instructions. If the model is in the middle of writing an answer, press
103103
`Ctrl+Enter` to cut that answer short so the prompt is read immediately - its text stays in the
104104
conversation. Set `steerMode: "interrupt"` to make `Ctrl+Enter` the default for `Enter` as well.
105-
Up to 10 messages can wait; press `Backspace` on an empty prompt to drop the last one. Running
105+
Up to 20 messages can wait; press `Backspace` on an empty prompt to drop the last one. Running
106106
commands are never interrupted, `Esc` still interrupts the turn immediately, and slash commands
107107
still wait for the turn to finish.
108108

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Skills 会按以下优先级扫描:
9898
AI 正在回复时,`Enter` 不再被拒绝,也不必等到本轮结束:消息会作为补充指引,在本轮下一次
9999
LLM 调用前作为 user 消息追加到对话中。模型因此能读到它,并结合已完成的工作修改甚至推翻之前的
100100
指令。如果模型正在输出回答,按 `Ctrl+Enter` 可以截断该回答、立即读取新指令(已生成内容仍保留在
101-
对话里);把 `steerMode` 设为 `"interrupt"` 则让普通 `Enter` 也具备同样行为。最多可排队 10 条;
101+
对话里);把 `steerMode` 设为 `"interrupt"` 则让普通 `Enter` 也具备同样行为。最多可排队 20 条;
102102
输入框为空时按 `Backspace` 可移除最后一条。正在执行的命令不会被中断,按 `Esc` 仍会立即中断本轮,
103103
斜杠命令仍需等待本轮结束。
104104

‎packages/core/src/session.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,15 @@ export type SupplementaryPrompt = {
374374
createTime: string;
375375
};
376376

377-
/** Maximum number of prompts that may wait for the next LLM call of a turn. */
378-
export const MAX_SUPPLEMENTARY_PROMPTS = 10;
377+
/**
378+
* Maximum number of prompts that may wait for the next LLM call of a turn.
379+
*
380+
* The queue drains at the next request boundary, so this only caps how many
381+
* instructions can pile up faster than one step of the turn. Every queued prompt
382+
* travels with each remaining request of that turn, so the limit keeps a burst
383+
* from inflating the context (and any attached images) without bound.
384+
*/
385+
export const MAX_SUPPLEMENTARY_PROMPTS = 20;
379386

380387
export type SessionManagerOptions = {
381388
projectRoot: string;

0 commit comments

Comments
 (0)