tdd(cli): prevent actor list from triggering database updates #1151
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/m3-actor-list-no-db-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
agents actor listno longer triggers database writes (upsert_actor,set_default_actor) by removingensure_built_in_actors()fromActorRegistry.list()andActorRegistry.list_actors()@tdd_expected_failremoved per Bug Fix Workflowensure_built_in_actors()explicitlyRoot Cause
ActorRegistry.list_actors()andActorRegistry.list()both unconditionally calledself.ensure_built_in_actors()before delegating to the actor service.ensure_built_in_actors()iterates all configured providers and calls_actor_service.upsert_actor()for each — a database WRITE operation. It may also call_actor_service.set_default_actor()if no default exists — another WRITE. This means every read-onlyagents actor listcommand triggered database writes and could prompt for pending migrations on fresh checkouts.Changes
Bug Fix
src/cleveragents/actor/registry.py— Removedself.ensure_built_in_actors()fromlist()andlist_actors(). Both methods now delegate directly to the service layer without triggering writes. All write-heavy methods (add,upsert_actor,get,get_actor,remove,remove_actor,set_default_actor,get_default_actor) still callensure_built_in_actors().TDD Tests (from #841,
@tdd_expected_failremoved)features/tdd_actor_list_no_db_update.feature— 2 Behave scenarios verifyingupsert_actorandset_default_actorare not called duringactor listfeatures/steps/tdd_actor_list_no_db_update_steps.py— Step definitionsrobot/tdd_actor_list_no_db_update.robot— 2 Robot Framework integration testsrobot/helper_tdd_actor_list_no_db_update.py— Robot helper scriptTest Adjustments
Three existing test suites relied on the old (buggy) behavior where
list_actors()calledensure_built_in_actors():features/consolidated_actor.feature— Scenario updated to explicitly callensure_built_in_actors()beforelist_actors()features/steps/tdd_actor_list_validation_steps.py+robot/helper_tdd_actor_list_validation.py(bug #592) — Updated to callensure_built_in_actors()explicitly before CLI invocationfeatures/steps/actor_list_empty_steps.py(bug #592) — Updated with explicitensure_built_in_actors()call and capturing upsert patternQuality Gates
nox -e lintnox -e typechecknox -e unit_testsnox -e integration_testsnox -e coverage_reportThe 6 integration test failures are pre-existing infrastructure issues (SIGTERM/SIGKILL timeouts) unrelated to this change: Container Resolve Crash (3), M3 E2E Verification (2), Resource CLI (1).
Closes #797
Review: fix(cli): prevent actor list from triggering database updates
Approved with comments. The TDD test code is well-implemented.
Issues to Address
1. Misleading PR title (Medium)
The PR title says
fix(cli):but the PR contains only TDD tests — no actual fix. The commit correctly usestest(cli):. The title should be updated totest(cli): TDD failing tests for actor list database update (bug #797).2. Missing PR description (Medium)
Per CONTRIBUTING.md, PRs submitted without a description will not be reviewed. The commit message is thorough, but a PR description would help reviewers scanning PR lists.
What's Good
from __future__ import annotations.@tdd_expected_fail @tdd_bug @tdd_bug_797tags.for tdd-actor-list-no-db-updateto avoid BehaveAmbiguousStepcollisions.NoReturntype hint on_fail().upsert_actorandset_default_actorwrite operations.Minor Nit
_DEFAULT_PROVIDERSis a module-level mutablelist. Since it's never mutated,tuplewould be more defensively correct.fix(cli): prevent actor list from triggering database updatesto tdd(cli): prevent actor list from triggering database updates1571e2d50a40af026237New commits pushed, approval review dismissed automatically according to repository settings
a20c34f40a6b7652919ffreemo referenced this pull request2026-03-29 03:17:29 +00:00