File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
apps/twig/src/renderer/features/sessions/service Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ const mockAuthStore = vi.hoisted(() => ({
6161 client : {
6262 createTaskRun : vi . fn ( ) ,
6363 appendTaskRunLog : vi . fn ( ) ,
64+ updateTaskRun : vi . fn ( ) . mockResolvedValue ( undefined ) ,
6465 } ,
6566 } ) ) ,
6667 } ,
@@ -237,6 +238,7 @@ describe("SessionService", () => {
237238 client : {
238239 createTaskRun : createTaskRunMock ,
239240 appendTaskRunLog : vi . fn ( ) ,
241+ updateTaskRun : vi . fn ( ) . mockResolvedValue ( undefined ) ,
240242 } ,
241243 } ) ;
242244
@@ -373,6 +375,7 @@ describe("SessionService", () => {
373375 client : {
374376 createTaskRun : createTaskRunMock ,
375377 appendTaskRunLog : vi . fn ( ) ,
378+ updateTaskRun : vi . fn ( ) . mockResolvedValue ( undefined ) ,
376379 } ,
377380 } ) ;
378381 mockTrpcAgent . start . mutate . mockResolvedValue ( {
Original file line number Diff line number Diff line change @@ -390,6 +390,11 @@ export class SessionService {
390390 throw new Error ( "Failed to create task run. Please try again." ) ;
391391 }
392392
393+ // Signal that the local run is now in progress
394+ auth . client
395+ . updateTaskRun ( taskId , taskRun . id , { status : "in_progress" } )
396+ . catch ( ( err ) => log . warn ( "Failed to update task run status" , { err } ) ) ;
397+
393398 const result = await trpcVanilla . agent . start . mutate ( {
394399 taskId,
395400 taskRunId : taskRun . id ,
@@ -896,6 +901,16 @@ export class SessionService {
896901 promptStartedAt : Date . now ( ) ,
897902 } ) ;
898903
904+ // Ensure task run status reflects active work
905+ const auth = useAuthStore . getState ( ) ;
906+ if ( auth . client ) {
907+ auth . client
908+ . updateTaskRun ( session . taskId , session . taskRunId , {
909+ status : "in_progress" ,
910+ } )
911+ . catch ( ( err ) => log . warn ( "Failed to update task run status" , { err } ) ) ;
912+ }
913+
899914 try {
900915 const result = await trpcVanilla . agent . prompt . mutate ( {
901916 sessionId : session . taskRunId ,
You can’t perform that action at this time.
0 commit comments