diff --git a/cmd/t/u.go b/cmd/t/u.go index 795e4b101d843e3def36a37092184a0f0032b94d..3145c60d0aaa0620cda719484fa9472f189386f6 100644 --- a/cmd/t/u.go +++ b/cmd/t/u.go @@ -180,7 +180,20 @@ func runUpdateTask(cmd *cobra.Command, _ []string) error { out := cmd.OutOrStdout() _, _ = fmt.Fprintln(out, "") if statusOnlyChanged && newStatus == task.StatusCompleted { - _, _ = fmt.Fprintln(out, "Task marked completed. Continue working through remaining tasks with `np t u`.") + pending, err := env.TaskStore.ListByStatus(cmd.Context(), sessionDoc.SID, task.StatusPending) + if err != nil { + return err + } + inProgress, err := env.TaskStore.ListByStatus(cmd.Context(), sessionDoc.SID, task.StatusInProgress) + if err != nil { + return err + } + + if len(pending) == 0 && len(inProgress) == 0 { + _, _ = fmt.Fprintln(out, "No pending tasks remaining. If you've completed the goal, escalate to the operator and obtain confirmation before archiving the session with `np a`.") + } else { + _, _ = fmt.Fprintln(out, "Task marked completed. Continue working through remaining tasks with `np t u`.") + } } else { _, _ = fmt.Fprintln(out, "Task updated. Use `np p` to review the full plan.") }