Skip to content

v8: #983/#984 console-dedup gates break 7 executor tests (FakeBot lacks _live_event_console_available) #986

Description

@enarjord

Reporter: Claude (automated continuous reviewer) — retrospective finding on merged code.

Summary

The console-dedup gates merged in #983 (order-wave summaries) and #984 (account-state summaries) call self._live_event_console_available() directly inside Passivbot logging helpers. Several pre-existing tests in tests/test_exchange_config_updates.py drive these code paths through duck-typed FakeBot stubs that borrow the bound methods but do not define _live_event_console_available, so they now fail with:

src/passivbot.py:4504: AttributeError: 'FakeBot' object has no attribute '_live_event_console_available'

Evidence (local, clean /tmp worktrees)

  • At c7a89c9c (pre-Dedupe order wave console summaries #983, Clarify flat coin HSL cooldown severity #982 merge): pytest tests/test_exchange_config_updates.py -k "execute_to_exchange or execute_order_plan"8 passed.
  • At f6700c5c (Dedupe order wave console summaries #983 merge) and b15da359 (Dedupe account state console summaries #984 merge, current tip): 7 of those tests fail with the AttributeError above:
    • test_execute_to_exchange_allows_cancellations_when_balance_too_low
    • test_execute_to_exchange_allows_reduce_only_create_when_balance_too_low
    • test_execute_to_exchange_configures_only_symbols_with_creations
    • test_execute_to_exchange_emits_recent_execution_deferred_event
    • test_execute_to_exchange_emits_state_change_skipped_event
    • test_execute_order_plan_posts_replacement_matching_cancel_same_cycle
    • test_execute_to_exchange_skips_creations_pending_exchange_config
  • The module's other failures (hedge-mode/exchange-config parametrized tests) fail at c7a89c9c too — pre-existing environment-class failures, not part of this finding.
  • PR Project low-balance create skips to event console #985 (563075a4, open) already fixes one of the seven (allows_cancellations_when_balance_too_low) by updating its stub, and its executor-side gate demonstrates the defensive pattern (getattr(passivbot_cls, "_live_event_console_available", None) + callable check).

Impact

Production is unaffected — real Passivbot instances always have the helper (it's a class method). This is a test-suite breakage on the v8 tip: seven previously-green tests covering the order-execution plan path now fail, reducing regression coverage for exactly the paths the dedup wave touches.

Suggested fix (either works)

  1. Tests: add _live_event_console_available = lambda self: False (or the real helper) to the FakeBot stubs in tests/test_exchange_config_updates.py — the Project low-balance create skips to event console #985 approach, applied to the remaining six; or
  2. Code: make the passivbot.py gates defensive like Project low-balance create skips to event console #985's executor gate (getattr(self, "_live_event_console_available", None)), so duck-typed callers degrade to the legacy logging path.

Option 1 keeps production code simplest; option 2 makes the helper contract robust for all borrowed-method callers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions