UAT: nox -e unit_tests crashes with AmbiguousStep — tui_thought_block_steps.py and tui_first_run_steps.py both define @then('the rendered text should contain "{text}"') #1791

Open
opened 2026-04-02 23:50:57 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/uat-ambiguous-step-rendered-text-collision
  • Commit Message: fix(tests): resolve AmbiguousStep collision between tui_thought_block_steps and tui_first_run_steps
  • Milestone: v3.2.0
  • Parent Epic: #739

Problem

The nox -e unit_tests quality gate crashes immediately with a behave.step_registry.AmbiguousStep error, preventing any unit tests from running. This is a blocking failure of the quality gate discovered during UAT.

What was tested:
Running nox -e unit_tests in a clean clone of the repository.

Expected behavior (from spec/CONTRIBUTING.md):
nox -e unit_tests must pass. The spec mandates that all nox quality gates pass. The Behave test suite must run to completion.

Actual behavior:
The session crashes immediately during step definition loading with:

behave.step_registry.AmbiguousStep: @then('the rendered text should contain "{text}"') has already been defined in
  existing step @then('the rendered text should contain "{text}"') at features/steps/tui_first_run_steps.py:236

The crash occurs at features/steps/tui_thought_block_steps.py:126 when Behave tries to register @then('the rendered text should contain "{text}"') which is already registered at features/steps/tui_first_run_steps.py:236.

Steps to reproduce:

  1. Clone the repository
  2. Run nox -e unit_tests
  3. Observe immediate crash with AmbiguousStep error

Code locations:

  • features/steps/tui_thought_block_steps.py:126 — defines @then('the rendered text should contain "{text}"')
  • features/steps/tui_first_run_steps.py:236 — also defines @then('the rendered text should contain "{text}"')

Impact:

  • nox -e unit_tests is completely broken — zero tests run
  • nox -e coverage_report also fails because it depends on the same Behave step loading
  • This is a blocking quality gate failure

Note: Issue #1609 is a broader fix task for 114 ambiguous step patterns across the entire codebase. This issue specifically documents the observable quality gate failure caused by the tui_thought_block_steps.py vs tui_first_run_steps.py collision, which must be resolved to unblock UAT.

Subtasks

  • Confirm the exact duplicate step definition at tui_thought_block_steps.py:126 and tui_first_run_steps.py:236
  • Rename the step in tui_thought_block_steps.py to a unique, domain-prefixed pattern (e.g., @then('the thought block rendered text should contain "{text}"'))
  • Update all .feature files that reference the old step pattern in thought-block scenarios to use the new pattern
  • Rename the step in tui_first_run_steps.py if it is also too generic, applying a domain prefix (e.g., @then('the first run rendered text should contain "{text}"'))
  • Update all .feature files that reference the old step pattern in first-run scenarios to use the new pattern
  • Run behave --dry-run to confirm zero AmbiguousStep errors for this pattern
  • Run nox -e unit_tests to confirm the quality gate passes

Definition of Done

  • nox -e unit_tests runs to completion with no AmbiguousStep crash
  • nox -e coverage_report passes with coverage ≥ 97%
  • Zero AmbiguousStep errors for the 'the rendered text should contain "{text}"' pattern
  • All affected .feature files updated to use the renamed step patterns
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/uat-ambiguous-step-rendered-text-collision` - **Commit Message**: `fix(tests): resolve AmbiguousStep collision between tui_thought_block_steps and tui_first_run_steps` - **Milestone**: v3.2.0 - **Parent Epic**: #739 ## Problem The `nox -e unit_tests` quality gate crashes immediately with a `behave.step_registry.AmbiguousStep` error, preventing **any** unit tests from running. This is a blocking failure of the quality gate discovered during UAT. **What was tested:** Running `nox -e unit_tests` in a clean clone of the repository. **Expected behavior (from spec/CONTRIBUTING.md):** `nox -e unit_tests` must pass. The spec mandates that all nox quality gates pass. The Behave test suite must run to completion. **Actual behavior:** The session crashes immediately during step definition loading with: ``` behave.step_registry.AmbiguousStep: @then('the rendered text should contain "{text}"') has already been defined in existing step @then('the rendered text should contain "{text}"') at features/steps/tui_first_run_steps.py:236 ``` The crash occurs at `features/steps/tui_thought_block_steps.py:126` when Behave tries to register `@then('the rendered text should contain "{text}"')` which is already registered at `features/steps/tui_first_run_steps.py:236`. **Steps to reproduce:** 1. Clone the repository 2. Run `nox -e unit_tests` 3. Observe immediate crash with AmbiguousStep error **Code locations:** - `features/steps/tui_thought_block_steps.py:126` — defines `@then('the rendered text should contain "{text}"')` - `features/steps/tui_first_run_steps.py:236` — also defines `@then('the rendered text should contain "{text}"')` **Impact:** - `nox -e unit_tests` is completely broken — zero tests run - `nox -e coverage_report` also fails because it depends on the same Behave step loading - This is a blocking quality gate failure **Note:** Issue #1609 is a broader fix task for 114 ambiguous step patterns across the entire codebase. This issue specifically documents the observable quality gate failure caused by the `tui_thought_block_steps.py` vs `tui_first_run_steps.py` collision, which must be resolved to unblock UAT. ## Subtasks - [ ] Confirm the exact duplicate step definition at `tui_thought_block_steps.py:126` and `tui_first_run_steps.py:236` - [ ] Rename the step in `tui_thought_block_steps.py` to a unique, domain-prefixed pattern (e.g., `@then('the thought block rendered text should contain "{text}"')`) - [ ] Update all `.feature` files that reference the old step pattern in thought-block scenarios to use the new pattern - [ ] Rename the step in `tui_first_run_steps.py` if it is also too generic, applying a domain prefix (e.g., `@then('the first run rendered text should contain "{text}"')`) - [ ] Update all `.feature` files that reference the old step pattern in first-run scenarios to use the new pattern - [ ] Run `behave --dry-run` to confirm zero `AmbiguousStep` errors for this pattern - [ ] Run `nox -e unit_tests` to confirm the quality gate passes ## Definition of Done - [ ] `nox -e unit_tests` runs to completion with no `AmbiguousStep` crash - [ ] `nox -e coverage_report` passes with coverage ≥ 97% - [ ] Zero `AmbiguousStep` errors for the `'the rendered text should contain "{text}"'` pattern - [ ] All affected `.feature` files updated to use the renamed step patterns - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.2.0 milestone 2026-04-02 23:51:10 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Should Have — bug or error handling improvement.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Should Have — bug or error handling improvement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#1791
No description provided.