Skip to content

fix(agent-manager): queue prompts for busy sessions - #13548

Merged
marius-kilocode merged 1 commit into
mainfrom
queue-messages-for-busy-sessions
Aug 28, 2026
Merged

fix(agent-manager): queue prompts for busy sessions#13548
marius-kilocode merged 1 commit into
mainfrom
queue-messages-for-busy-sessions

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

agent_manager prompts waited up to 30 seconds for the target session to become idle, then failed with only idle sessions can be prompted. This prevented one agent from sending a follow-up while another agent was working, even though manual chat messages already used the backend prompt queue.

Why This Change Was Made

Submit validated prompts directly to the existing backend queue instead of polling for idle. This uses the same queue and cancellation behavior as chat rather than adding another queue in the extension.

Keep managed-session ownership checks, pending-question and permission checks, pre-submission cancellation checks, stable message IDs, and bridge request deduplication. Tool output now confirms prompt acceptance rather than implying that execution has finished.

User Impact

Prompts to busy or retrying sessions are accepted without waiting for idle. The follow-up appears as queued while active work continues. Pending questions and permissions still block orchestration prompts and must be resolved first. No new configuration is required.

Evidence

  • The extension unit suite passed: 4,447 tests. The CLI Agent Manager tool suite passed: 37 tests. Focused regressions cover busy/retry submission, blockers, cancellation during validation, and acknowledgement retries without duplicate delivery.
  • Extension and CLI typechecks, extension lint/build/Knip, and repository guards passed. Root lint completed with warnings and no errors.
  • Manually tested the compiled extension in isolated VS Code with a loopback-only test provider. A controller session listed sessions, prompted the busy target through agent_manager, and received acceptance while the target response remained open. The target showed Queued. After the active response was released, the follow-up ran once and completed. The test environment was cleaned up. This exercised one queued follow-up, not multi-message FIFO ordering or a live model provider.

Queued while the target is busy:

Agent Manager target remains busy while the follow-up message shows Queued

Follow-up completes after the active response:

Agent Manager shows the queued follow-up completed once after the active response

@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • .changeset/queue-busy-agent-manager-prompts.md
  • packages/kilo-docs/pages/automate/agent-manager.md
  • packages/kilo-vscode/src/agent-manager/orchestration-domain.ts
  • packages/kilo-vscode/tests/unit/agent-manager-orchestration-bridge.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-orchestration-domain.test.ts
  • packages/opencode/src/kilocode/tool/agent-manager.ts
  • packages/opencode/src/kilocode/tool/agent-manager.txt
  • packages/opencode/test/kilocode/agent-manager-tool.test.ts

Reviewed by grok-4.6 · Input: 106.4K · Output: 10.3K · Cached: 681.7K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 768b38f into main Aug 28, 2026
35 checks passed
@marius-kilocode
marius-kilocode deleted the queue-messages-for-busy-sessions branch August 28, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants