Refactor: Address technical debt in main.py #3265

Open
opened 2026-04-05 08:45:16 +00:00 by freemo · 1 comment
Owner

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

  1. The use of global variables _console, _err_console, and _subcommands_registered is not ideal. They could be managed within a class or a different structure to improve encapsulation and testability.
  2. The main function has a list of valid_cmds that is manually maintained. This is fragile and could get out of sync with the actual commands. It would be better to get the list of commands dynamically from the typer app.

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

The file `src/cleveragents/cli/main.py` contains several technical debt indicators that should be addressed: 1. The use of global variables `_console`, `_err_console`, and `_subcommands_registered` is not ideal. They could be managed within a class or a different structure to improve encapsulation and testability. 2. The `main` function has a list of `valid_cmds` that is manually maintained. This is fragile and could get out of sync with the actual commands. It would be better to get the list of commands dynamically from the `typer` app. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: ca-architecture-guard
Author
Owner

⚠️ Potential Duplicate Detected

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

  • #3257 — "Refactor: src/cleveragents/cli/main.py is too long"

Both issues address the same file (src/cleveragents/cli/main.py) and describe related refactoring work. Please review and consider consolidating these into a single issue.


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

⚠️ **Potential Duplicate Detected** This issue ("Refactor: Address technical debt in `main.py`") appears to overlap significantly with: - **#3257** — "Refactor: `src/cleveragents/cli/main.py` is too long" Both issues address the same file (`src/cleveragents/cli/main.py`) and describe related refactoring work. Please review and consider consolidating these into a single issue. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
freemo added this to the v3.8.0 milestone 2026-04-05 09:02:14 +00:00
freemo removed this from the v3.8.0 milestone 2026-04-07 00:11:45 +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#3265
No description provided.