[AUTO-BUG-2] TDD: session create silently suppresses all facade dispatch exceptions without logging #10414

Open
opened 2026-04-18 09:36:29 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: test(cli): add failing TDD test for session create silently suppressing facade dispatch exceptions
  • Branch Name: test/tdd-session-create-suppress-exception

Background and Context

session create in src/cleveragents/cli/commands/session.py (lines 199–205) uses contextlib.suppress(Exception) to silently suppress ALL exceptions from _facade_dispatch() without any logging. This means programming errors, unexpected failures, and infrastructure issues in the facade dispatch are completely invisible.

Code showing the bug (src/cleveragents/cli/commands/session.py, lines 199–205):

import contextlib

with contextlib.suppress(Exception):
    _facade_dispatch(
        "session.create",
        {"actor_name": actor or "", "session_id": session.session_id},
    )

There is no logging call before or after the contextlib.suppress block. Any exception raised by _facade_dispatch() is silently discarded, making it impossible to diagnose failures in the facade layer.

This TDD issue captures the failing test that must be written before the fix is applied.

Expected Behavior

When _facade_dispatch() raises an exception, it should be logged at WARNING level (not suppressed silently). The exception should still be non-fatal (the session creation should succeed even if facade dispatch fails), but it must be logged.

Acceptance Criteria

  • A failing test is written that verifies exceptions from _facade_dispatch() are logged when suppressed
  • The test is tagged with @tdd_issue, @tdd_issue_N, @tdd_expected_fail
  • The test fails before the fix is applied (no logging currently)
  • The test passes after the fix is applied (logging added)

Subtasks

  • Write failing BDD scenario tagged @tdd_issue, @tdd_expected_fail asserting facade dispatch exceptions are logged
  • Confirm test fails before fix (no logging currently)
  • Confirm test passes after fix is applied

Definition of Done

  • Failing test written and committed
  • Test is marked @tdd_expected_fail
  • Test fails for the right reason (no logging, not an import error)

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `test(cli): add failing TDD test for session create silently suppressing facade dispatch exceptions` - **Branch Name**: `test/tdd-session-create-suppress-exception` ## Background and Context `session create` in `src/cleveragents/cli/commands/session.py` (lines 199–205) uses `contextlib.suppress(Exception)` to silently suppress ALL exceptions from `_facade_dispatch()` without any logging. This means programming errors, unexpected failures, and infrastructure issues in the facade dispatch are completely invisible. **Code showing the bug** (`src/cleveragents/cli/commands/session.py`, lines 199–205): ```python import contextlib with contextlib.suppress(Exception): _facade_dispatch( "session.create", {"actor_name": actor or "", "session_id": session.session_id}, ) ``` There is no logging call before or after the `contextlib.suppress` block. Any exception raised by `_facade_dispatch()` is silently discarded, making it impossible to diagnose failures in the facade layer. This TDD issue captures the failing test that must be written before the fix is applied. ## Expected Behavior When `_facade_dispatch()` raises an exception, it should be logged at WARNING level (not suppressed silently). The exception should still be non-fatal (the session creation should succeed even if facade dispatch fails), but it must be logged. ## Acceptance Criteria - [x] A failing test is written that verifies exceptions from `_facade_dispatch()` are logged when suppressed - [x] The test is tagged with `@tdd_issue`, `@tdd_issue_N`, `@tdd_expected_fail` - [x] The test fails before the fix is applied (no logging currently) - [ ] The test passes after the fix is applied (logging added) ## Subtasks - [x] Write failing BDD scenario tagged `@tdd_issue`, `@tdd_expected_fail` asserting facade dispatch exceptions are logged - [x] Confirm test fails before fix (no logging currently) - [ ] Confirm test passes after fix is applied ## Definition of Done - [x] Failing test written and committed - [x] Test is marked `@tdd_expected_fail` - [x] Test fails for the right reason (no logging, not an import error) --- **Automated by CleverAgents Bot** Agent: new-issue-creator
Author
Owner

Implementation Attempt — Tier 1: Haiku — Success

Implemented the TDD failing test for issue #10414 (session create silently suppresses facade dispatch exceptions without logging).

What was done:

  • Created features/tdd_session_create_suppress_exception.feature with a scenario tagged @tdd_issue @tdd_issue_10414 @tdd_expected_fail
  • Created features/steps/tdd_session_create_suppress_exception_steps.py with step definitions that:
    • Mock the session service to return a valid session
    • Patch _facade_dispatch to raise a RuntimeError
    • Capture WARNING log records from the session module logger
    • Assert that a WARNING log entry was emitted (which FAILS before the fix)
  • The @tdd_expected_fail tag inverts the failing assertion to a CI pass

Quality gates:

  • lint ✓
  • typecheck ✓
  • unit_tests (targeted) ✓ (1 scenario passed via @tdd_expected_fail inversion)

PR created: #10749#10749


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

**Implementation Attempt** — Tier 1: Haiku — Success Implemented the TDD failing test for issue #10414 (session create silently suppresses facade dispatch exceptions without logging). **What was done:** - Created `features/tdd_session_create_suppress_exception.feature` with a scenario tagged `@tdd_issue @tdd_issue_10414 @tdd_expected_fail` - Created `features/steps/tdd_session_create_suppress_exception_steps.py` with step definitions that: - Mock the session service to return a valid session - Patch `_facade_dispatch` to raise a RuntimeError - Capture WARNING log records from the session module logger - Assert that a WARNING log entry was emitted (which FAILS before the fix) - The `@tdd_expected_fail` tag inverts the failing assertion to a CI pass **Quality gates:** - lint ✓ - typecheck ✓ - unit_tests (targeted) ✓ (1 scenario passed via @tdd_expected_fail inversion) **PR created:** #10749 — https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/10749 --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
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.

Dependencies

No dependencies set.

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