Skip to content

Fix false error notifications for NotebookEdit and investigate spurious "input needed" alerts #7

@Helmi

Description

@Helmi

Description

CCNotify is triggering false notifications in two scenarios:

  1. NotebookEdit operations always report as "failed" even when successful
  2. "Input needed" notifications appear even when permissions are bypassed

Context

  • Project Area: Core notification logic
  • Complexity: 2/10 (Simple fix)
  • User Impact: Creates notification fatigue and reduces trust in alerts

Current Behavior

Issue 1: NotebookEdit False Failures

Every NotebookEdit operation triggers an error notification because the tool response includes an empty "error": "" field. The current error detection logic treats any presence of the "error" key as a failure.

Log evidence:

2025-08-10 11:45:24,750 - DEBUG - PostToolUse response for NotebookEdit: {
  ...
  "error": ""
}
2025-08-10 11:45:24,750 - INFO - Sending notification: event_type=error, message=[stempelwiese dashboard] Error in NotebookEdit: 

Issue 2: False "Input Needed" Alerts

Users report receiving "input needed" notifications during automated operations where permissions are already bypassed and no actual input is required.

Technical Details

Affected File: src/ccnotify/notify.py

Problematic code (lines 783-784):

if (isinstance(tool_response, dict) and 
    (tool_response.get("type") == "error" or "error" in tool_response)):

The condition "error" in tool_response returns True even when the error field is an empty string.

Requirements

  1. Fix NotebookEdit error detection to only trigger on actual errors
  2. Investigate and fix false "input needed" notifications
  3. Ensure no other tools are affected by similar issues

Implementation Steps

  • Change error detection logic to check for non-empty error values
  • Add specific handling for NotebookEdit responses if needed
  • Add debug logging to identify what triggers false "input needed" events
  • Test with various Claude Code tools to ensure no regressions

Proposed Fix

# Change line 783-784 to:
if (isinstance(tool_response, dict) and 
    (tool_response.get("type") == "error" or 
     (tool_response.get("error") and tool_response.get("error") \!= ""))):

Acceptance Criteria

  • NotebookEdit operations only trigger error notifications on actual failures
  • Empty error fields are ignored in all tool responses
  • "Input needed" notifications only appear when user input is genuinely required
  • No regression in error detection for other tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions