- features/steps/tdd_plan_generation_validate_steps.py: drop duplicate
@given/@then registrations (live in plan_generation_langgraph_coverage_
steps.py; redefinition caused AmbiguousStep errors crashing all 8
behave-parallel workers); have the @when step feed the docstring as the
FakeListLLM response so each scenario tests _validate()'s parsing of a
specific PASS/FAIL signal rather than the input code.
- features/tdd_plan_generation_validate_logic.feature: add the required
@tdd_issue tag alongside @tdd_issue_10746 (enforced by
features/environment.py); tighten scenario 4 wording to remove the
reference to the obsolete length guard.
- robot/plan_generation_graph.robot: drop assertion for handle_retry node
(retry is a conditional edge, not a fifth node) and update node-count
check from 5 to 4; update Should Retry test to assert _should_retry does
NOT mutate state (read-only contract for LangGraph conditional edges).
- src/cleveragents/agents/graphs/plan_generation.py:
* _validate: persist retry_count increment in return dict (FAIL path and
exception path) so LangGraph propagates it through the state graph.
* _should_retry: remove state mutation (conditional-edge functions are
read-only in LangGraph; mutations were silently dropped, causing
retry_count to remain 0 forever and the graph to loop infinitely).
Adjust comparison to retry_count <= max_retries because _validate has
already incremented before _should_retry runs.
* __init__: add max_context_files parameter (default 5, validated > 0)
and wire it into _format_context_summary in place of the hardcoded 5,
implementing the configurable-limits contract tested by
features/agent_configurable_limits.feature.
ISSUES CLOSED: #10746
Add two Behave scenarios tagged @tdd_issue, @tdd_issue_11121, and @tdd_expected_fail
that capture bug #11121: _create_sandbox_for_plan() calls
GitWorktreeSandbox.cleanup_stale() unconditionally on every execute invocation,
including when the plan is already in execute/complete state awaiting apply.
Scenario 1 asserts that the cleveragents/plan-<id> branch survives a second call
to _create_sandbox_for_plan() on an execute/complete plan. This assertion fails
because cleanup_stale deletes the branch regardless of plan state.
Scenario 2 asserts that plan apply would find at least one artifact after a
re-invoked execute on an execute/complete plan. This assertion fails because the
branch (holding execute output) was destroyed by cleanup_stale.
Both scenarios use @tdd_expected_fail so CI passes while the bug is unfixed.
The @mock_only tag ensures no database is created for these git-only tests.
The companion fix is tracked in issue #11121.
Additional CI fixes bundled in this commit:
- Fixed PlanGenerationGraph recursion bug: _should_retry() was mutating state
in-place but LangGraph conditional edge functions cannot persist state
mutations. Replaced with a proper _handle_retry() node that increments
retry_count via state returns, resolving the GraphRecursionError that was
crashing the integration tests. Updated the graph to include handle_retry
as the 5th node, routing validate→should_retry→handle_retry→analyze.
- Fixed TDD quality gate (scripts/tdd_quality_gate.py): Renamed @tdd_bug_N
tags to @tdd_issue_N to match the CONTRIBUTING.md specification. Added
_diff_is_tdd_issue_capture() detection so that TDD issue-capture PRs
(which add @tdd_expected_fail rather than remove it) pass the quality gate
correctly. Updated all related tests (Behave unit tests, Robot integration
tests, and test helpers) to use the new tag naming.
ISSUES CLOSED: #11120
Remove the local ${PYTHON} python (and python3) variable definitions from
the *** Variables *** sections of all affected robot files. These local
definitions were overriding the pabot-injected venv Python path passed via
--variable PYTHON:/path/to/venv/python, causing tests to use the system
Python (which lacks required packages like structlog, sqlalchemy, etc.)
instead of the nox venv Python.
The correct ${PYTHON} value is already set by Setup Test Environment in
common.resource via sys.executable, and pabot passes it via --variable.
The local fallback definitions are redundant and harmful in parallel runs.
Audit found 56 robot files with the pattern (more than the 9 originally
identified in the issue). All occurrences have been removed.
ISSUES CLOSED: #1309
TDD expected-fail tests proving bug #822 exists:
CheckpointService.rollback_to_checkpoint() returns a successful
RollbackResult but does not execute git reset --hard. Files modified
after the checkpoint remain unchanged after rollback.
Also fixes Robot Framework timeout robustness across the entire test
suite: all Run Process calls now use on_timeout=kill (prevents
SIGTERM-induced -15 exit codes under CI load) and timeouts increased
to 120s (prevents premature kills during heavy parallel execution).
ISSUES CLOSED: #839
Remove FakeListLLM as a silent fallback in agent graph constructors
(plan_generation.py, context_analysis.py, auto_debug.py). All three now
raise ValueError when llm=None, making missing-provider errors explicit.
Add Settings.mock_providers flag and validate_provider_availability()
method. Update container.get_ai_provider() to check Settings.mock_providers
first, with env-var fallback for backward compatibility.
Add resolve_provider_by_name() helper to the provider registry and export
it from cleveragents.providers. Add structlog trace logging to
ProviderRegistry.get_default_provider_type() to record selection reasoning.
Update all existing behave step files, robot tests, and benchmarks that
relied on the implicit FakeListLLM default to pass an explicit LLM
instance instead.
Add new BDD tests (features/provider_fixes.feature with 17 scenarios),
Robot Framework integration tests (robot/provider_detection_smoke.robot),
and ASV benchmarks (benchmarks/provider_selection_bench.py).
ISSUES CLOSED: #323
- Restore session.env["PATH"] in integration_tests nox session to ensure
Run Process uses venv Python instead of system Python
- Convert bare Resource references to ${CURDIR}/ absolute paths across
30 robot files to fix CI resolution failures
- Add timeout=30s to all Run Process calls in rxpy_route_validation.robot
to prevent hanging tests
- Tag 2 rxpy tests as slow (require running actors unavailable on CI)
- Fix LangGraph test to use correct config file (LANGGRAPH_CONFIG)
- All 204 tests pass (4 excluded: 2 slow + 2 discovery)