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
{{ message }}
Repository navigation
Commit 12550b9
Browse filesBrowse the repository at this point in the historyBrowse files
fix(sessions): close the delegation dialog without waiting for sessions to start (#1631)
* fix(sessions): close the delegation dialog without waiting for sessions to start
Start and immediate model changes answered only after every delegated
session had its worktree created and its CLI started (or stopped and
restarted), and the dialog ignored Close until then. The UI routes now
answer once the batch or change is accepted; the launch continues in the
background and reports through the batch and change state. The model's
own CreateSessions call still waits, since it needs the new session ids.
Closing the dialog is never blocked by an in-flight request.
* test(sessions): wait for both first messages before checking a launched batch
if(!response.ok||launched.state!=='launched'||!launched.sessions[0]?.sessionId)thrownewError(`confirm did not launch the child: ${JSON.stringify(launched)}`)
106
+
constaccepted=awaitresponse.json()asany
107
+
if(!response.ok||!['launching','launched'].includes(accepted.state))thrownewError(`confirm was not accepted: ${JSON.stringify(accepted)}`)
108
+
// The UI request answers once the batch is launching; the child starts after it.
if(launched.state!=='launched'||!launched.sessions[0]?.sessionId)thrownewError(`confirm did not launch the child: ${JSON.stringify(launched)}`)
108
116
construntime=launched.sessions[0].runtime
109
117
if(runtime.providerId!==ctx.target.providerId||runtime.modelId!==ctx.target.modelId)thrownewError('Child runtime did not preserve the selected provider and model')
if(!input.requestId?.trim()||!Array.isArray(input.selections)||!input.selections.length||input.selections.length>8||newSet(input.selections.map(item=>item.sessionId)).size!==input.selections.length)throwApiError.badRequest('Choose between one and eight distinct sessions')
396
410
if(!this.deps.models||!this.deps.runtime.apply||!this.deps.runtime.stopAndWait)throwApiError.conflict('Runtime changes are unavailable')
0 commit comments