Skip to content

Let the rich hook notification win the OSC 9 dedupe instead of the boilerplate one #666

Description

@serenNan

When a Claude Code agent needs input, two notifications can fire for the same event: the agent's own OSC 9 desktop notification and the hook-driven rich notification (OSC 3008). They are deduped by timing in WorktreeTerminalState.handleAgentOSCNotification, and in practice the OSC 9 one usually wins. That is the worse of the two: its title is just the tab title (the truncated first prompt, e.g. "Check Supacode memory us…") and its body is the fixed string "Claude is waiting for your input" — no detail about what the agent is asking. The richer hook payload (which can carry last_assistant_message) gets dropped. So the surviving notification is consistently the least informative one.

Proposed solution

Make the dedupe prefer content over timing: when both paths represent the same event for a surface, keep the hook notification and drop the OSC 9 one, rather than letting whichever committed first win. A small, contained change in handleAgentOSCNotification / appendHookNotification. Happy to align on the exact tie-break rule.

Alternatives considered

Supacode version

0.10.6

Are you planning to build this yourself?

Yes — I intend to open a pull request once this is approved and marked ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions