You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Architecture update (2026-07-24): #428 was superseded by #484. Terminal-action proposals now use a short-lived WTA CLI that connects directly to the owning Helper through a per-Helper named pipe; proposal payloads and state do not transit wta-master. This issue remains focused on delegate startup latency after the recommendation card is confirmed.
Summary
Confirming an open_and_send proposal with target=tab and destination=delegate can make Intelligent Terminal appear hung while the new tab is created. The recommendation proposal transport itself is not blocked; the delay occurs after card confirmation in the terminal-creation path.
Reproduction
Open the Terminal Agent pane with Copilot configured as the delegate agent.
Produce and confirm an open_and_send proposal with:
target=tab
destination=delegate
a non-empty prompt
Observe that the card/new-tab transition pauses, then the new tab remains idle while a standalone Copilot process starts.
The hidden per-tab agent-pane prewarm took about 0.31 seconds and started only after create_tab returned, so it was not the source of the initial pause. The delegated copilot.exe -i ... process also paid a separate cold-start cost: about 26 seconds elapsed between process creation and its prompt-submit hook.
Root cause
The current path couples "the tab exists" with "the terminal child has synchronously initialized":
wtcli new-tab calls the synchronous COM CreateTab method.
src/cascadia/WindowsTerminal/TerminalProtocolComServer.cpp blocks on page.CreateProtocolTab(...).get().
src/cascadia/TerminalApp/TerminalPage.Protocol.cpp creates the pane and then calls:
_tabContent.UpdateLayout(); // Force synchronous terminal initialization
The COM call therefore does not return until UI-thread terminal initialization has run. For a delegate action, the initial command is a new standalone agent CLI, so slow CLI startup is exposed directly in the card/new-tab UX.
This is independent of how recommendation proposals are transported or approved.
Potential solution
Phase 1: two-phase terminal creation
Separate terminal creation into Created and Ready states:
Add a protocol fast/deferred creation path for create_tab and split_pane.
Return session_id/tab_id after the pane is inserted, without forcing synchronous child-process initialization. A PID may be unavailable at this point; callers that need it can query later.
Use the existing connection_state: connected event as the readiness signal.
Update WTA coordinator behavior:
open and delegates using LaunchWithStartupPrompt: finish the card action as soon as the target is Created.
shell open_and_send using LaunchThenSend: wait asynchronously for Connected before sending input, replacing the fixed 700 ms sleep.
Show explicit startup feedback such as Starting Copilot... while a delegate process is cold-starting.
This removes the UI-blocking portion without weakening target routing or sending input before a pane is ready.
Phase 2: eliminate delegate cold start
Route delegated work through the already-running wta-master agent CLI and create a new ACP session instead of launching a separate copilot.exe -i process. This is a larger architectural change, especially for panel targets, but would remove the remaining standalone CLI cold-start cost rather than merely making it non-blocking.
Acceptance criteria
Confirming a delegate new-tab card does not block the existing Terminal UI while the delegate process starts.
The new tab becomes visible without waiting for agent CLI initialization.
Startup-prompt delivery occurs exactly once.
Shell open_and_send waits for an explicit readiness signal rather than a fixed delay.
Note
Architecture update (2026-07-24): #428 was superseded by #484. Terminal-action proposals now use a short-lived WTA CLI that connects directly to the owning Helper through a per-Helper named pipe; proposal payloads and state do not transit
wta-master. This issue remains focused on delegate startup latency after the recommendation card is confirmed.Summary
Confirming an
open_and_sendproposal withtarget=tabanddestination=delegatecan make Intelligent Terminal appear hung while the new tab is created. The recommendation proposal transport itself is not blocked; the delay occurs after card confirmation in the terminal-creation path.Reproduction
open_and_sendproposal with:target=tabdestination=delegateObserved timeline
From a Debug run on 2026-07-18:
The hidden per-tab agent-pane prewarm took about 0.31 seconds and started only after
create_tabreturned, so it was not the source of the initial pause. The delegatedcopilot.exe -i ...process also paid a separate cold-start cost: about 26 seconds elapsed between process creation and its prompt-submit hook.Root cause
The current path couples "the tab exists" with "the terminal child has synchronously initialized":
tools/wta/src/coordinator.rsawaitsShellManager::wt_create_tab.wtcli new-tabcalls the synchronous COMCreateTabmethod.src/cascadia/WindowsTerminal/TerminalProtocolComServer.cppblocks onpage.CreateProtocolTab(...).get().src/cascadia/TerminalApp/TerminalPage.Protocol.cppcreates the pane and then calls:_tabContent.UpdateLayout(); // Force synchronous terminal initializationThe COM call therefore does not return until UI-thread terminal initialization has run. For a delegate action, the initial command is a new standalone agent CLI, so slow CLI startup is exposed directly in the card/new-tab UX.
This is independent of how recommendation proposals are transported or approved.
Potential solution
Phase 1: two-phase terminal creation
Separate terminal creation into Created and Ready states:
create_tabandsplit_pane.session_id/tab_idafter the pane is inserted, without forcing synchronous child-process initialization. A PID may be unavailable at this point; callers that need it can query later.connection_state: connectedevent as the readiness signal.openand delegates usingLaunchWithStartupPrompt: finish the card action as soon as the target is Created.open_and_sendusingLaunchThenSend: wait asynchronously for Connected before sending input, replacing the fixed 700 ms sleep.Starting Copilot...while a delegate process is cold-starting.This removes the UI-blocking portion without weakening target routing or sending input before a pane is ready.
Phase 2: eliminate delegate cold start
Route delegated work through the already-running
wta-masteragent CLI and create a new ACP session instead of launching a separatecopilot.exe -iprocess. This is a larger architectural change, especially for panel targets, but would remove the remaining standalone CLI cold-start cost rather than merely making it non-blocking.Acceptance criteria
open_and_sendwaits for an explicit readiness signal rather than a fixed delay.