chore: add inline guidance for block streaming

This commit is contained in:
Peter Steinberger
2026-01-03 18:46:59 +01:00
parent 72b34f7d03
commit 27a8f3d061
3 changed files with 4 additions and 1 deletions

View File

@@ -44,7 +44,7 @@
- Skills: add tmux skill + interactive coding guidance in coding-agent. - Skills: add tmux skill + interactive coding guidance in coding-agent.
- Gateway: document port configuration + multi-instance isolation. - Gateway: document port configuration + multi-instance isolation.
- Onboarding/Config: add protocol notes for wizard + schema RPC. - Onboarding/Config: add protocol notes for wizard + schema RPC.
- Queue: clarify steer-backlog behavior and update examples for streaming surfaces. - Queue: clarify steer-backlog behavior with inline commands and update examples for streaming surfaces.
## 2.0.0-beta5 — 2026-01-03 ## 2.0.0-beta5 — 2026-01-03

View File

@@ -30,6 +30,7 @@ Inbound messages can steer the current run, wait for a followup turn, or do both
Steer-backlog means you can get a followup response after the steered run, so Steer-backlog means you can get a followup response after the steered run, so
streaming surfaces can look like duplicates. Prefer `collect`/`steer` if you want streaming surfaces can look like duplicates. Prefer `collect`/`steer` if you want
one response per inbound message. one response per inbound message.
Inline fix: `/queue collect` (per-session) or set `routing.queue.bySurface.discord: "collect"`.
Defaults (when unset in config): Defaults (when unset in config):
- All surfaces → `collect` - All surfaces → `collect`

View File

@@ -259,6 +259,7 @@ export function subscribeEmbeddedPiSession(params: {
if (!blockChunking) return; if (!blockChunking) return;
const minChars = Math.max(1, Math.floor(blockChunking.minChars)); const minChars = Math.max(1, Math.floor(blockChunking.minChars));
const maxChars = Math.max(minChars, Math.floor(blockChunking.maxChars)); const maxChars = Math.max(minChars, Math.floor(blockChunking.maxChars));
// Force flush small remainders as a single chunk to avoid re-splitting.
if (force && blockBuffer.length > 0 && blockBuffer.length <= maxChars) { if (force && blockBuffer.length > 0 && blockBuffer.length <= maxChars) {
emitBlockChunk(blockBuffer); emitBlockChunk(blockBuffer);
blockBuffer = ""; blockBuffer = "";
@@ -457,6 +458,7 @@ export function subscribeEmbeddedPiSession(params: {
if (delta) { if (delta) {
chunk = delta; chunk = delta;
} else if (content) { } else if (content) {
// Providers may resend full content on text_end; append only the suffix.
if (content.startsWith(deltaBuffer)) { if (content.startsWith(deltaBuffer)) {
chunk = content.slice(deltaBuffer.length); chunk = content.slice(deltaBuffer.length);
} else if (deltaBuffer.startsWith(content)) { } else if (deltaBuffer.startsWith(content)) {