UAT: plan.py A2A dispatch uses bare except Exception: pass — errors silently swallowed violating CONTRIBUTING.md fail-fast rule #5693

Open
opened 2026-04-09 08:37:57 +00:00 by HAL9000 · 1 comment
Owner

Summary

src/cleveragents/cli/commands/plan.py contains a bare except Exception: pass block at line 100 that silently swallows all exceptions from A2A dispatch operations. This directly violates the CONTRIBUTING.md error handling rule: "Do not suppress errors. Let exceptions propagate to top-level execution."

Code Location

# src/cleveragents/cli/commands/plan.py lines 95-101
try:
    from cleveragents.a2a.cli_bootstrap import get_facade

    facade = get_facade()
    request = A2aRequest(method=operation, params=params)
    facade.dispatch(request)
except Exception:
    pass  # <-- VIOLATION: bare exception swallow

Expected Behavior (per CONTRIBUTING.md)

Per CONTRIBUTING.md:

CRITICAL: Do not suppress errors. Let exceptions propagate to top-level execution.

  • Do not catch exceptions just to log and re-raise; let them propagate naturally.
  • Do not use bare catch-all exception handlers without re-raising unless you have specific recovery logic.
  • Only catch exceptions when you can meaningfully handle them (e.g., retry logic, resource cleanup, adding context). Otherwise, let them propagate.

The A2A dispatch failure should at minimum be logged at WARNING level so operators can diagnose A2A integration issues. If A2A dispatch is truly optional/best-effort, the code should use contextlib.suppress with a specific exception type and include a comment explaining why suppression is intentional.

Actual Behavior

Any exception from A2A dispatch (import errors, connection failures, serialization errors, authentication failures) is silently discarded. Users and operators have no visibility into A2A failures.

Second Instance

There is also a similar pattern at line 1829:

except Exception:
    pass  # Project context not available; skip propagation

This one has a comment explaining the intent (project context is optional), but it still swallows all exceptions including unexpected ones like AttributeError or TypeError that indicate programming errors. It should be narrowed to specific expected exceptions (e.g., except (NotFoundError, DatabaseError):).

Fix Required

For line 100: Either log the exception at WARNING level and continue, or use a specific exception type:

except ImportError:
    pass  # A2A module not available in this installation
except Exception:
    logger.warning("A2A dispatch failed", exc_info=True)

For line 1829: Narrow to specific expected exceptions:

except (NotFoundError, DatabaseError, AttributeError):
    pass  # Project context not available; skip propagation

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary `src/cleveragents/cli/commands/plan.py` contains a bare `except Exception: pass` block at line 100 that silently swallows all exceptions from A2A dispatch operations. This directly violates the CONTRIBUTING.md error handling rule: **"Do not suppress errors. Let exceptions propagate to top-level execution."** ## Code Location ```python # src/cleveragents/cli/commands/plan.py lines 95-101 try: from cleveragents.a2a.cli_bootstrap import get_facade facade = get_facade() request = A2aRequest(method=operation, params=params) facade.dispatch(request) except Exception: pass # <-- VIOLATION: bare exception swallow ``` ## Expected Behavior (per CONTRIBUTING.md) Per CONTRIBUTING.md: > **CRITICAL: Do not suppress errors. Let exceptions propagate to top-level execution.** > - Do not catch exceptions just to log and re-raise; let them propagate naturally. > - Do not use bare catch-all exception handlers without re-raising unless you have specific recovery logic. > - **Only catch exceptions when you can meaningfully handle them** (e.g., retry logic, resource cleanup, adding context). Otherwise, let them propagate. The A2A dispatch failure should at minimum be logged at WARNING level so operators can diagnose A2A integration issues. If A2A dispatch is truly optional/best-effort, the code should use `contextlib.suppress` with a specific exception type and include a comment explaining why suppression is intentional. ## Actual Behavior Any exception from A2A dispatch (import errors, connection failures, serialization errors, authentication failures) is silently discarded. Users and operators have no visibility into A2A failures. ## Second Instance There is also a similar pattern at line 1829: ```python except Exception: pass # Project context not available; skip propagation ``` This one has a comment explaining the intent (project context is optional), but it still swallows all exceptions including unexpected ones like `AttributeError` or `TypeError` that indicate programming errors. It should be narrowed to specific expected exceptions (e.g., `except (NotFoundError, DatabaseError):`). ## Fix Required For line 100: Either log the exception at WARNING level and continue, or use a specific exception type: ```python except ImportError: pass # A2A module not available in this installation except Exception: logger.warning("A2A dispatch failed", exc_info=True) ``` For line 1829: Narrow to specific expected exceptions: ```python except (NotFoundError, DatabaseError, AttributeError): pass # Project context not available; skip propagation ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 08:46:47 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#5693
No description provided.