@@ -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.")
}