Skip to content

fix(agent-manager): show initial worktree prompts immediately - #13738

Merged
marius-kilocode merged 1 commit into
mainfrom
investigate-worktree-creation-message-delay
Sep 3, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
investigate-worktree-creation-message-delay

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

After a new Agent Manager worktree is ready, the chat can show its empty screen until the backend returns the initial user message. The modal's first-send path bypasses the optimistic display already used by the normal composer.

Why This Change Was Made

Route prepared initial requests through the same optimistic message and submission handling as normal sends. Keep the existing request payload intact, including the target session/project, model, agent, reasoning variant, files, and browser feedback. Composer validation and setup/sandbox checks are unchanged.

Use one message ID for the pending bubble and backend request so confirmation updates the existing message rather than adding another one. When status events were missed while another project was active, completed history clears only the matching pending request. Ongoing tool turns and newer queued requests remain pending.

User Impact

Initial worktree prompts appear while they are being sent, rather than after backend preparation. Single-version and multi-version creation keep their existing routing. Creating a worktree without a prompt still leaves an empty conversation.

Evidence

  • Focused tests cover unloaded model catalogs, explicit/default/absent variants, project/session routing, files and browser feedback, late empty history, canonical message/part reconciliation, failed sends, and background completion without status events.
  • Full extension unit suite before rebase: 4,674 passed, 1 skipped. After rebasing onto current main, 100 focused tests, extension build, typecheck, lint, unused-code checks, and the Kilo-only marker guard passed again.
  • Isolated VS Code checks covered single-version, two-version, and prompt-free creation. Each prompted session showed one user message.
  • In one matched local error-path capture before and after, worktree-ready to prompt-visible time changed from 305 ms to 38 ms. Initial-send event to prompt-visible time changed from 300 ms to 22 ms. These measure display latency, not backend execution speed.
  • UI checks used an unavailable fixture model to avoid live model requests. Live provider responses were not tested. The screenshot shows the prompt retained once when that fixture reports its expected model error.

One initial worktree prompt remains visible above the fixture model error

@kilo-code-bot

kilo-code-bot Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • .changeset/optimistic-worktree-prompts.md
  • packages/kilo-vscode/tests/fixtures/session-provider-activity.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/src/context/session-types.ts
  • packages/kilo-vscode/webview-ui/src/context/session.tsx

Reviewed by grok-4.6 · Input: 415.6K · Output: 23.6K · Cached: 1.4M

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 8060a22 into main Sep 3, 2026
25 checks passed
@marius-kilocode
marius-kilocode deleted the investigate-worktree-creation-message-delay branch September 3, 2026 10:52
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