File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -303,12 +303,12 @@ export function TaskDetail({ task: initialTask }: TaskDetailProps) {
303303 < DataList . Label > Progress</ DataList . Label >
304304 < DataList . Value >
305305 < Text size = "2" >
306- { progress . completed_steps ?? 0 } /
306+ { ( progress . completed_steps ?? 0 ) + 1 } /
307307 { typeof progress . total_steps === "number"
308308 ? progress . total_steps
309309 : "-" }
310- { typeof progress . progress_percentage === "number" &&
311- ` · ${ Math . round ( progress . progress_percentage ) } %` }
310+ { typeof progress . total_steps === "number" &&
311+ ` · ${ Math . round ( ( ( ( progress . completed_steps ?? 0 ) + 1 ) / progress . total_steps ) * 100 ) } %` }
312312 { progress . current_step && ` · ${ progress . current_step } ` }
313313 </ Text >
314314 </ DataList . Value >
Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ const createProgressSignature = (progress: AgentTaskProgress): string =>
2828
2929const formatProgressLog = ( progress : AgentTaskProgress ) : string => {
3030 const statusLabel = progress . status ?. replace ( / _ / g, " " ) ?? "in progress" ;
31- const completed =
32- typeof progress . completed_steps === "number" ? progress . completed_steps : 0 ;
31+ const currentStep =
32+ typeof progress . completed_steps === "number"
33+ ? progress . completed_steps + 1
34+ : 1 ;
3335 const total =
3436 typeof progress . total_steps === "number" && progress . total_steps >= 0
3537 ? progress . total_steps
@@ -40,10 +42,10 @@ const formatProgressLog = (progress: AgentTaskProgress): string => {
4042 ? progress . current_step
4143 : "-" ;
4244 const percentage =
43- typeof progress . progress_percentage === "number"
44- ? ` ${ Math . round ( progress . progress_percentage ) } %`
45+ typeof progress . total_steps === "number" && progress . total_steps > 0
46+ ? ` ${ Math . round ( ( currentStep / progress . total_steps ) * 100 ) } %`
4547 : "" ;
46- return `📊 Progress: ${ statusLabel } | step=${ step } (${ completed } /${ total } )${ percentage } ` ;
48+ return `📊 Progress: ${ statusLabel } | step=${ step } (${ currentStep } /${ total } )${ percentage } ` ;
4749} ;
4850
4951interface TaskExecutionState {
You can’t perform that action at this time.
0 commit comments