fix(skill): resolve skill add persistence regression after PR #640 #1120
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/m3-skill-add-regression"
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
Fixes the cross-process skill persistence regression reported in #980. Skills registered via
agents skill add --config <file>in one CLI process are now correctly persisted to the database and visible in subsequent CLI invocations.Root Cause
Two issues in the skill persistence layer:
Missing table creation:
_build_skill_service()incontainer.pycreated aSkillRepositorypointing at the database but did not ensure theskillsandskill_itemstables existed. When the tables were missing, all repository operations failed silently (caught bySkillService._load_from_dband_persist_skillexception handlers), causing the service to operate in in-memory-only mode.Session mismatch:
SkillRepositorylackedauto_commitsupport. Each call tosession_factory()returned a new session, so theflush()increate()/update()/delete()operated on a different session than thecommit()inSkillService._commit(), meaning data was never actually persisted.Fix
_build_skill_service(following the pattern in_build_session_service) — checks for missingskillsandskill_itemstables and creates them viaBase.metadata.create_all.auto_commitparameter toSkillRepository(following the pattern inSessionRepository) so each mutating method commits and closes its own session.auto_commit=Truefrom the container builder.@tdd_expected_failfrom TDD test (leaving@tdd_bugand@tdd_bug_980as permanent regression guards).Quality Gates
nox -e lint— passednox -e typecheck— 0 errorsnox -e unit_tests— 462 features, 12232 scenarios passednox -e integration_tests— 1674 tests, 1674 passed, 0 failednox -e coverage_report— 98% coverage (threshold: 97%)Note: This PR depends on PR #1110 (TDD test for #981) being merged first.
Closes #980
Day 43 Review — PR #1120
fix(skill): resolve skill add persistence regressionVerdict: Review complete — meets all standards. Awaiting 2 peer approvals.
Review Findings
fix(skill):prefixsqlalchemy.inspect, backward-compatibleauto_commitparameter@tdd_expected_failremoval@tdd_bug+@tdd_bug_980remain as regression guardsCloses #980in body,ISSUES CLOSED: #980in footer@hamza.khyari @brent.edwards — please review and approve if findings are satisfactory.
agents skilldoes not register when skills are added. #620159cb7f730a652d6fb78a652d6fb7865d38e475965d38e4759312aa3d4f8312aa3d4f875161acf4b75161acf4bfe8881b1c4Review: Looks Good (with Minor Notes)
Clean, well-documented bug fix that directly addresses both root causes of the cross-process skill persistence regression. The implementation follows established codebase patterns (
SessionRepositoryauto_commit,_build_session_servicetable creation), maintains backward compatibility (auto_commitdefaults toFalse), and includes thorough test coverage at BDD and Robot levels.Minor Notes
DRY opportunity. The
if self._auto_commit: session.commit(); session.close()block is duplicated increate(),update(), anddelete(). Consider extracting to a_finalize_session(session)helper or context manager. Not blocking — consistent with existingSessionRepositorypattern.Session not closed on commit failure. If
session.commit()raises (e.g., lateIntegrityError),session.close()is skipped. Theexceptblock doessession.rollback()but never closes. Minor resource hygiene issue — consider addingsession.close()to afinallyblock whenauto_commit=True.PR dependency. PR body states this depends on PR #1110 (TDD test). Ensure #1110 is merged first to avoid conflicts.
Overall this is solid work — the two-pronged fix (table creation + auto_commit) is the right approach.
Note: Cannot formally approve as PR author matches the authenticated API user.
fe8881b1c493da31e80f