Skip to content

fix(taskctl): notifyPM does not wake up PM session in the UI — missing event vs Task tool completion mechanism #314

@randomm

Description

@randomm

Problem

When taskctl's notifyPM fires (e.g. task complete, job complete), the PM agent does NOT wake up in the active UI session. The user sees the notification visually but the PM agentic loop does not resume.

By contrast, when a Task tool subagent completes, the parent session DOES wake up automatically — because it publishes BackgroundTaskEvent.Completed with parentSessionID set correctly, which triggers enableAutoWakeup()triggerWakeup().

Root Cause

In pulse-verdicts.ts, Bus.publish(BackgroundTaskEvent.Completed, ...) is called with parentSessionID: undefined in 3 places (lines ~247, ~282, ~321). The enableAutoWakeup() subscriber only fires when parentSessionID === sessionID — so with undefined, the PM session never wakes up.

Fix: Set parentSessionID: pmSessionId (PM is its own parent for wakeup purposes) in all 3 publish calls.

Acceptance Criteria

  • When notifyPM fires (task done, job done, escalation), the PM session wakes up autonomously
  • Same behavior as Task tool subagent completion wakeup
  • Tests cover the parentSessionID being set correctly
  • No @ts-ignore or as any introduced

Quality Gates (Non-Negotiable)

  • TDD: tests first
  • Linting passes
  • Typecheck passes
  • Local verification complete

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions