forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Root Cause
notifyPM in pulse-verdicts.ts writes a synthetic assistant-role message to the PM session's message history, but never invokes SessionPrompt.prompt(). The PM's agentic loop only wakes up when SessionPrompt.prompt() is called — so the notification appears in the UI but the PM is never interrupted to act on it.
Key code path:
notifyPMcreates anrole: "assistant"message withproviderID: "system"- The agentic loop in
session/prompt.tslooks for the last user message to resume — assistant messages are skipped - No
BackgroundTaskEvent.Completedis published, so auto-wakeup never fires SessionPrompt.prompt()is never called directly
Fix
After writing the notification message to the DB, inject a synthetic user message and call SessionPrompt.prompt() directly on the PM session so the agentic loop resumes and the PM can act on the notification (retry, override, escalate, etc.).
The notification text should be the user message content so the PM sees it as an incoming request to respond to.
Acceptance Criteria
- When a task fails, PM session wakes up autonomously and can retry/override/escalate
- When a job completes, PM session wakes up autonomously
- When a task succeeds, PM session wakes up (or at minimum task-failed/job-complete wake PM)
-
bun testpasses -
bun run typecheckpasses
Quality Gates (Non-Negotiable)
- TDD: Write tests before implementation
- Coverage: 80%+ test coverage for new code
- Linting: All code passes project linting rules
- Local Verification: All tests pass locally before completion
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels