Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

refactor(control): log a breadcrumb when a steer note is dropped

Zhen Luofc23e76ac2a3
diff --git a/src/main/control.ts b/src/main/control.ts
index 93ec49f3..13ba1e58 100644
--- a/src/main/control.ts
+++ b/src/main/control.ts
@@ -79,7 +79,13 @@ export class ControlRegistry {
const t = text.trim();
if (!t) return;
const q = this.ensure(id).steerQueue;
- if (q.length >= MAX_PENDING_STEERS) q.shift(); // keep the newest note, drop the oldest
+ if (q.length >= MAX_PENDING_STEERS) {
+ // Drop the oldest so the newest instruction still reaches the next hook
+ // boundary. Log a breadcrumb so a note silently falling off the front is
+ // diagnosable — a full queue means the agent has been unreachable for a long time.
+ console.warn(`[control] ${id}: steer queue full (${MAX_PENDING_STEERS}) — dropping oldest note`);
+ q.shift(); // keep the newest note, drop the oldest
+ }
q.push(t.slice(0, 10000)); // hook additionalContext cap
}
/** Request a graceful stop at the next hook boundary. */