From dbc3b36f6d94d719cb1a07074e5d74ce22d2fad3 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Mon, 1 Jun 2026 07:51:23 +0900 Subject: fix(queue): consume queued messages after a turn ends (start a new turn) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A message queued while the agent was mid-turn was only handled if it arrived DURING a tool batch (injected as a [USER INTERRUPT]). If it landed after the last tool call — or the turn had no tools — the agent silently appended it to history and ended the turn with no response, so it sat there unanswered. This affected both user-queued messages and agent-queued ones (send_to_tab). - agent.ts: stop the end-of-turn drain that swallowed trailing queued messages into history. They now stay on the queue. - agent-manager: after a CLEAN turn settles, continueFromQueue() drains the queue and starts a fresh turn to answer it. Skipped on a user-stopped or errored turn (queue preserved for the next send). - Loop safety: continuation draws from the existing autoWakeBudget, so a runaway agent<->agent chain is bounded; human sends refill it, so human conversations are never throttled. - dequeueMessages now tags message-consumed with reason "interrupt" | "continuation"; the frontend collapses continuation- consumed queued bubbles into the next turn's initiator row (avoids the linger/dup traps documented in queue-interrupt-reconcile-edge-cases.md). - Tests: agent (no-swallow + interrupt regression), agent-manager (continuation, no-op when empty, user-stop preserves queue, bounded loop), frontend (continuation bubble becomes next initiator). - wishlist: remove the now-fixed item. --- notes/wishlist.md | 4 ---- 1 file changed, 4 deletions(-) (limited to 'notes') diff --git a/notes/wishlist.md b/notes/wishlist.md index 8c3f5ef..f4ecbeb 100644 --- a/notes/wishlist.md +++ b/notes/wishlist.md @@ -19,8 +19,6 @@ - **Track token usage in a tab.** Display token usage (e.g. prompt/completion/total tokens) for the chat within each tab. -- **Fix queue not being consumed after the AI finishes its turn.** When the AI completes its turn, a queued user message is just attached to the chat without continuing the conversation — the turn ends instead of consuming the queue and generating a response. The queued message should kick off a new turn. - - **Compaction tool.** A tool to compact/summarize the conversation history to reduce context size while preserving important information. - **Make the plus button on tabs always on top and to the left.** The "+" button for creating new tabs is currently mixed in with the scrollable tab list. It should be fixed/absolute positioned at the top-left of the tab bar so it's always visible regardless of horizontal scrolling. @@ -45,5 +43,3 @@ - **"User agents" — summon counterpart to subagents.** Currently agents can summon subagents which are owned by a parent tab (they appear indented under the parent in the tab bar). Add a "user agent" summon variant that spawns a standard top-level tab owned by the user rather than by another tab. This gives agents the ability to open new independent tabs (like a user would), enabling more complex multi-agent workflows where spawned agents persist as first-class tabs. - **Fix key switching not migrating context correctly.** When switching API keys (e.g. hitting usage limits on one key and switching to another), the new agent appears to receive only the initial system prompt — all subsequent thinking, tool calls, and conversation history are lost. The full chat context including all turns needs to be properly passed to the new key/model so the conversation continues seamlessly. - -- **Worktree workflow skill.** A skill for orchestration agents that enables executing several plans or feature implementations in parallel using git worktrees. Each worktree gets its own isolated checkout of the repo at a given branch/commit, so multiple agents can work independently on different features without stepping on each other. The orchestration agent manages creating worktrees, assigning tasks to sub-agents per worktree, reviewing results, and merging back. -- cgit v1.2.3