BUG-HUNT: [error-handling] Silent error in EventBusBridge._on_domain_event #5904

Open
opened 2026-04-09 11:39:26 +00:00 by HAL9000 · 0 comments
Owner

Bug Report: [error-handling] — Silent error in EventBusBridge._on_domain_event

Severity Assessment

  • Impact: Events may be silently dropped if the event queue is closed, which can hide bugs and make debugging difficult.
  • Likelihood: High, as this is the designed behavior.
  • Priority: Medium

Location

  • File: src/cleveragents/a2a/events.py
  • Function/Class: EventBusBridge._on_domain_event
  • Lines: 288-289

Description

The with contextlib.suppress(RuntimeError): in EventBusBridge._on_domain_event will silently drop events if the event queue is closed. This might be the desired behavior in some cases, but it can also hide bugs and make it difficult to debug issues where events are not being processed as expected.

Evidence

        import contextlib

        with contextlib.suppress(RuntimeError):
            self._event_queue.publish(a2a_event)

Expected Behavior

The code should log a warning or an error when an event is dropped because the event queue is closed. This would provide visibility into the fact that events are being dropped and help with debugging.

Actual Behavior

The code silently drops events if the event queue is closed, which can hide bugs and make debugging difficult.

Suggested Fix

Remove the with contextlib.suppress(RuntimeError): and instead use a try...except RuntimeError: block to catch the exception and log a warning or an error message.

Category

error-handling

TDD Note

After this bug issue is verified, a corresponding Type/Testing issue will be
created for TDD. The test will use tags: @tdd_issue, @tdd_issue_,
and @tdd_expected_fail to prove the bug exists before fixing it.


Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: bug-hunter

## Bug Report: [error-handling] — Silent error in EventBusBridge._on_domain_event ### Severity Assessment - **Impact**: Events may be silently dropped if the event queue is closed, which can hide bugs and make debugging difficult. - **Likelihood**: High, as this is the designed behavior. - **Priority**: Medium ### Location - **File**: `src/cleveragents/a2a/events.py` - **Function/Class**: `EventBusBridge._on_domain_event` - **Lines**: 288-289 ### Description The `with contextlib.suppress(RuntimeError):` in `EventBusBridge._on_domain_event` will silently drop events if the event queue is closed. This might be the desired behavior in some cases, but it can also hide bugs and make it difficult to debug issues where events are not being processed as expected. ### Evidence ```python import contextlib with contextlib.suppress(RuntimeError): self._event_queue.publish(a2a_event) ``` ### Expected Behavior The code should log a warning or an error when an event is dropped because the event queue is closed. This would provide visibility into the fact that events are being dropped and help with debugging. ### Actual Behavior The code silently drops events if the event queue is closed, which can hide bugs and make debugging difficult. ### Suggested Fix Remove the `with contextlib.suppress(RuntimeError):` and instead use a `try...except RuntimeError:` block to catch the exception and log a warning or an error message. ### Category error-handling ### TDD Note After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_<this-issue-number>, and @tdd_expected_fail to prove the bug exists before fixing it. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: bug-hunter
HAL9000 added the
Points
2
Priority
Medium
State
Verified
labels 2026-04-09 12:08:34 +00:00
HAL9000 added
State
Unverified
Type
Bug
and removed
State
Verified
labels 2026-04-09 13:27:25 +00:00
HAL9000 added
State
Verified
and removed
State
Unverified
labels 2026-04-18 08:58:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: cleveragents/cleveragents-core#5904