File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
packages/opencode/src/session Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,7 @@ export namespace SessionProcessor {
368368 sessionID : input . assistantMessage . sessionID ,
369369 error : input . assistantMessage . error ,
370370 } )
371+ SessionStatus . set ( input . sessionID , { type : "idle" } )
371372 }
372373 if ( snapshot ) {
373374 const patch = await Snapshot . patch ( snapshot )
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export namespace SessionPrompt {
6262 abort : AbortController
6363 callbacks : {
6464 resolve ( input : MessageV2 . WithParts ) : void
65- reject ( ) : void
65+ reject ( reason ?: any ) : void
6666 } [ ]
6767 }
6868 > = { }
@@ -72,7 +72,7 @@ export namespace SessionPrompt {
7272 for ( const item of Object . values ( current ) ) {
7373 item . abort . abort ( )
7474 for ( const callback of item . callbacks ) {
75- callback . reject ( )
75+ callback . reject ( new DOMException ( "Aborted" , "AbortError" ) )
7676 }
7777 }
7878 } ,
@@ -251,10 +251,13 @@ export namespace SessionPrompt {
251251 log . info ( "cancel" , { sessionID } )
252252 const s = state ( )
253253 const match = s [ sessionID ]
254- if ( ! match ) return
254+ if ( ! match ) {
255+ SessionStatus . set ( sessionID , { type : "idle" } )
256+ return
257+ }
255258 match . abort . abort ( )
256259 for ( const item of match . callbacks ) {
257- item . reject ( )
260+ item . reject ( new DOMException ( "Aborted" , "AbortError" ) )
258261 }
259262 delete s [ sessionID ]
260263 SessionStatus . set ( sessionID , { type : "idle" } )
You can’t perform that action at this time.
0 commit comments