Refactor: Address technical debt in container.py #3256

Open
opened 2026-04-05 08:35:44 +00:00 by freemo · 2 comments
Owner

The file src/cleveragents/application/container.py contains several technical debt indicators that should be addressed:

  1. The get_ai_provider function has a fallback to an environment variable (CLEVERAGENTS_TESTING_USE_MOCK_AI), which is a sign of a temporary solution that should be removed in favor of a more robust configuration mechanism.
  2. The _build_skill_service function has a comment about a bug (#980) that required a workaround. The underlying issue should be investigated and resolved, and the workaround should be removed.
  3. The get_container function uses a global variable _container, which is generally not a good practice. This should be refactored to avoid the use of a global variable.

Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: ca-architecture-guard

The file `src/cleveragents/application/container.py` contains several technical debt indicators that should be addressed: 1. The `get_ai_provider` function has a fallback to an environment variable (`CLEVERAGENTS_TESTING_USE_MOCK_AI`), which is a sign of a temporary solution that should be removed in favor of a more robust configuration mechanism. 2. The `_build_skill_service` function has a comment about a bug (#980) that required a workaround. The underlying issue should be investigated and resolved, and the workaround should be removed. 3. The `get_container` function uses a global variable `_container`, which is generally not a good practice. This should be refactored to avoid the use of a global variable. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: ca-architecture-guard
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Backlog — technical debt in container.py is a code quality concern.
  • Milestone: v3.7.0
  • MoSCoW: Could Have — overlaps with #3251 and #3254. Consider consolidating these three container.py refactoring issues.

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Backlog — technical debt in container.py is a code quality concern. - **Milestone**: v3.7.0 - **MoSCoW**: Could Have — overlaps with #3251 and #3254. Consider consolidating these three container.py refactoring issues. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

⚠️ Potential Duplicate Detected

This issue ("Refactor: Address technical debt in container.py") appears to overlap significantly with:

  • #3251 — "Refactor: src/cleveragents/application/container.py is too long"
  • #3254 — "Refactor: Duplicate code in _build_* functions in container.py"

All three issues address the same file (src/cleveragents/application/container.py) and describe related refactoring work. Please review and consider consolidating these into a single comprehensive issue.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

⚠️ **Potential Duplicate Detected** This issue ("Refactor: Address technical debt in `container.py`") appears to overlap significantly with: - **#3251** — "Refactor: `src/cleveragents/application/container.py` is too long" - **#3254** — "Refactor: Duplicate code in `_build_*` functions in `container.py`" All three issues address the same file (`src/cleveragents/application/container.py`) and describe related refactoring work. Please review and consider consolidating these into a single comprehensive issue. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
freemo added this to the v3.7.0 milestone 2026-04-05 09:01:31 +00:00
freemo modified the milestone from v3.7.0 to v3.8.0 2026-04-05 09:02:14 +00:00
freemo removed this from the v3.8.0 milestone 2026-04-07 00:12:14 +00:00
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.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#3256
No description provided.