@@ -280,7 +280,7 @@ export class TaskManager {
280280 }
281281 }
282282
283- public async getNextTask ( projectId : string ) : Promise < StandardResponse > {
283+ public async getNextTask ( projectId : string ) : Promise < StandardResponse < OpenTaskSuccessData | { message : string } > > {
284284 await this . ensureInitialized ( ) ;
285285 // Reload from disk to ensure we have the latest data
286286 await this . reloadFromDisk ( ) ;
@@ -316,15 +316,11 @@ export class TaskManager {
316316 ) ;
317317 }
318318
319- return {
320- status : "next_task" ,
321- data : {
322- id : nextTask . id ,
323- title : nextTask . title ,
324- description : nextTask . description ,
325- message : `Next task is ready. Task approval will be required after completion.\n`
326- }
327- } ;
319+ // Return the full task details similar to openTaskDetails
320+ return createSuccessResponse < OpenTaskSuccessData > ( {
321+ projectId : proj . projectId ,
322+ task : { ...nextTask } ,
323+ } ) ;
328324 }
329325
330326 public async approveTaskCompletion ( projectId : string , taskId : string ) : Promise < StandardResponse < ApproveTaskSuccessData > > {
@@ -428,23 +424,14 @@ export class TaskManager {
428424 await this . ensureInitialized ( ) ;
429425 // Reload from disk to ensure we have the latest data
430426 await this . reloadFromDisk ( ) ;
431-
427+
432428 for ( const proj of this . data . projects ) {
433429 const target = proj . tasks . find ( ( t ) => t . id === taskId ) ;
434430 if ( target ) {
431+ // Return only projectId and the full task object
435432 return createSuccessResponse ( {
436433 projectId : proj . projectId ,
437- initialPrompt : proj . initialPrompt ,
438- projectPlan : proj . projectPlan ,
439- completed : proj . completed ,
440- task : {
441- id : target . id ,
442- title : target . title ,
443- description : target . description ,
444- status : target . status ,
445- approved : target . approved ,
446- completedDetails : target . completedDetails ,
447- } ,
434+ task : { ...target } , // Return all fields from the found task
448435 } ) ;
449436 }
450437 }
0 commit comments