Skip to content

suppress Subagent - #183

Open
CollinViz wants to merge 1 commit into
pantheon-org:mainfrom
CollinViz:feat/subagent-silence
Open

suppress Subagent#183
CollinViz wants to merge 1 commit into
pantheon-org:mainfrom
CollinViz:feat/subagent-silence

Conversation

@CollinViz

Copy link
Copy Markdown

Add Subagent Silence Config
Problem
When a subagent (Task tool) is dispatched, the main session can briefly go idle between subtasks, triggering unwanted Warcraft II sound notifications while work is still happening.
Solution
Add two new config options to suppress idle sounds during subagent execution:

  • suppressDuringSubagent (boolean, default: false) — Skip sound when a subagent is running
  • subagentSilenceTimeoutMs (number, default: 30000, range: 1000–300000) — Timeout to clear subagent state if no completion signal is received
    Detection Strategy
  • Subtask start: message.part.updated with part.type === "subtask" — increments counter
  • Subtask completion: session.status with idle — decrements counter
  • Timeout fallback: Configurable timer clears counter if no completion signal received
  • Suppress rule: Skip sound in session.idle handler when subtasksRunning > 0
    Usage
    {
    "@pantheon-ai/opencode-warcraft-notifications": {
    "faction": "horde",
    "suppressDuringSubagent": true,
    "subagentSilenceTimeoutMs": 30000
    }
    }
    Files Changed
  • src/config/types.ts — Added interface fields
  • src/schema-validator.ts — Added Zod validation + updated error message
  • src/notification.ts — Added subtask tracking and suppression logic
    Verification
  1. Set "suppressDuringSubagent": true — dispatch a subagent — verify no sound during execution
  2. Wait for subagent to complete — verify sound plays on next idle
  3. Send a normal message — verify sound plays as before
  4. Set "suppressDuringSubagent": false — verify original behavior restored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant