Two unit test failures on the PR branch:
1. settings_configuration.feature:200 — CLEVERAGENTS_DATABASE_URL env var
overrides the default
The _resolve_database_urls model validator applied _resolve_sqlite_url()
to ALL database_url values, including values explicitly provided by the
user via CLEVERAGENTS_DATABASE_URL. When a user set a relative SQLite
path (e.g. sqlite:///custom/path/mydb.db), the validator converted it
to an absolute CWD-based path, breaking the assertion.
Fix: skip resolution when the corresponding env var is set to a non-empty
value. Only DEFAULT values (generated by the default_factory when no env
var is present) are resolved against CLEVERAGENTS_HOME / CWD.
2. tdd_a2a_sdk_dependency.feature:21 — a2a SDK provides the A2AClient class
In a2a-sdk >=1.0.0 the A2AClient class was renamed to Client.
a2a.client no longer exports A2AClient, so getattr(a2a.client,
'A2AClient', None) returns None and the test fails.
Fix: update the scenario to check for Client (the current canonical name).
Also update settings_steps.py so the 'no environment variables are set'
step clears CLEVERAGENTS_DATABASE_URL, CLEVERAGENTS_TEST_DATABASE_URL, and
CLEVERAGENTS_HOME. Previously these were left in the environment, meaning
tests that set them explicitly had to contend with whatever before_scenario
injected, making the scenarios harder to reason about.
ISSUES CLOSED: #1024
- Fix Settings.database_url default from relative 'sqlite:///cleveragents.db'
to absolute 'sqlite:////home/<user>/.cleveragents/cleveragents.db' using
Path.home() / '.cleveragents' / 'cleveragents.db'
- Fix test_database_url default similarly to use ~/.cleveragents/cleveragents_test.db
- Fix alembic/env.py fallback default from Path.cwd() / '.cleveragents' / 'db.sqlite'
to Path.home() / '.cleveragents' / 'cleveragents.db' (matching Settings)
- Both Settings and alembic/env.py now resolve to the same absolute path
- CLEVERAGENTS_DATABASE_URL env var override still works correctly in both
- Update coverage_boost_steps.py assertions to match new correct defaults
- Add 3 new Behave scenarios covering correct database_url default and env var override
ISSUES CLOSED: #2871
The Settings class had data_dir defaulting to Path("data") — a relative
path — but the specification requires the default data directory to be
~/.cleveragents. This inconsistency caused any code reading Settings().data_dir
without setting CLEVERAGENTS_DATA_DIR to use a relative 'data/' directory
instead of the spec-required ~/.cleveragents, affecting log storage, database
location, cache, backups, and all persistent state.
Changes:
- Fix data_dir default_factory from Path("data") to Path.home() / ".cleveragents"
- Add Behave scenario: 'data_dir default is the spec-required home directory path'
- Add Behave scenario: 'data_dir env var override takes precedence over default'
- Add step definition: 'the data directory should equal the home cleveragents path'
Settings.data_dir is now consistent with ConfigService core.data-dir default
(~/.cleveragents). The CLEVERAGENTS_DATA_DIR env var override continues to work.
ISSUES CLOSED: #2851
Add Behave and Robot Framework regression tests for bug #647, where
plan tree, plan explain, and plan correct CLI commands crashed with
AttributeError when resolving DecisionService from the DI container.
Tests use a real DI container with seeded decisions (not MagicMock)
to catch the exact class of bug that existing M3 tests missed.
Assertions verify successful execution and command-specific output
content. Includes Settings.reset() classmethod for robust singleton
cleanup in test teardown.
Review feedback addressed (hurui200320 Round 5):
- Fixed Behave step engine leak by capturing UoW in cleanup closure
- Removed dead @then decorator; renamed to private _assert_command_succeeded
- Strengthened plan correct assertions with revert/dry-run content checks
- Updated misleading get_container() comment to reflect singleton warming
- Added test-only warning to Settings.reset() docstring
- Added type annotations to 4 settings step functions
- Fixed CONTRIBUTORS.md alphabetical ordering and removed duplicate entry
- Replaced glob.glob with pathlib suffix iteration in Robot helper
- Fixed feature description line break for readability
- Removed redundant TYPE_CHECKING import for Decision
ISSUES CLOSED: #648