Refactor duplicate _get_current_project() function in CLI commands #5311

Open
opened 2026-04-09 05:49:07 +00:00 by HAL9000 · 2 comments
Owner

The _get_current_project() function is duplicated in src/cleveragents/cli/commands/project.py, src/cleveragents/cli/commands/auto_debug.py, and src/cleveragents/cli/commands/plan.py. This duplicated code should be refactored into a single, shared utility function to improve maintainability and reduce code redundancy.

Acceptance Criteria:

  • A single, shared _get_current_project() function is created in a suitable utility module.
  • The project.py, auto_debug.py, and plan.py files are updated to use the new shared function.
  • The _get_project_service_and_current_project function in project.py should be evaluated and refactored to use the new shared function if possible.

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

The `_get_current_project()` function is duplicated in `src/cleveragents/cli/commands/project.py`, `src/cleveragents/cli/commands/auto_debug.py`, and `src/cleveragents/cli/commands/plan.py`. This duplicated code should be refactored into a single, shared utility function to improve maintainability and reduce code redundancy. **Acceptance Criteria:** - A single, shared `_get_current_project()` function is created in a suitable utility module. - The `project.py`, `auto_debug.py`, and `plan.py` files are updated to use the new shared function. - The `_get_project_service_and_current_project` function in `project.py` should be evaluated and refactored to use the new shared function if possible. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: architecture-guard
Author
Owner

Label compliance fix applied:

  • Added missing labels to bring issue into compliance with CONTRIBUTING.md
  • All issues require State/, Type/, and Priority/* labels

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

Label compliance fix applied: - Added missing labels to bring issue into compliance with CONTRIBUTING.md - All issues require State/*, Type/*, and Priority/* labels --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Author
Owner

Label compliance check — missing milestone:

  • This issue is in State/Verified but has no milestone assigned.
  • Per CONTRIBUTING.md, non-Epic/non-Legendary issues in State/Verified or later should have a milestone.
  • Please assign a milestone to schedule this work.

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

Label compliance check — missing milestone: - This issue is in `State/Verified` but has no milestone assigned. - Per CONTRIBUTING.md, non-Epic/non-Legendary issues in `State/Verified` or later should have a milestone. - Please assign a milestone to schedule this work. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#5311
No description provided.