@tdd_issue @tdd_issue_10395
Feature: TDD Issue #10395 — Silent except Exception: return 0 in LangChainChatProvider._estimate_token_usage() causes inaccurate cost tracking
  As a developer relying on accurate cost tracking
  I want token counting failures in LangChainChatProvider._estimate_token_usage() to propagate
  So that cost tracking never silently records zero tokens due to a suppressed exception

  The `_estimate_token_usage()` method in
  `cleveragents.providers.llm.langchain_chat_provider.LangChainChatProvider`
  contains a bare `except Exception: return 0` block. When the LLM's
  `get_num_tokens()` raises any exception, the method silently swallows it
  and returns 0. Downstream cost tracking then records zero tokens, producing
  inaccurate cost estimates with no visible error signal to the caller or
  operator.

  The scenario below is tagged `@tdd_expected_fail` because the assertion
  FAILS while the bug exists. The tag inversion mechanism causes CI to report
  the scenario as passed. Once the fix for #10395 is merged, the
  `@tdd_expected_fail` tag must be removed so the scenario runs normally as
  a regression guard.

  See CONTRIBUTING.md > Bug Fix Workflow > TDD Issue Test Tags.

  @tdd_expected_fail
  Scenario: Token counting failure propagates as an error rather than returning zero
    Given a LangChainChatProvider configured with a mock LLM that raises on token count
    When the provider attempts to count tokens for a message
    Then a token count exception should be raised by the provider
    And the cost tracker should not record a zero-token usage entry
