chore(cli): complete renderer migration for remaining command modules #1059
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.
Blocks
#813 chore(cli): complete renderer migration for remaining command modules
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core!1059
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/m6-renderer-migration"
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
Migrates 8 CLI command modules from module-level
Console()objects to the shared_get_console()fromrenderers.py. This eliminates redundant Console instances and ensures consistent output handling across all CLI commands.Modules Migrated
auto_debug.pyConsole()→_get_console()context.pyConsole()→_get_console()automation_profile.pyConsole()→_get_console()tool.pyConsole()→_get_console()project.pyconfig.pyConsole()→_get_console()resource.pyConsole()→_get_console()skill.pyConsole()→_get_console()Approach
Each module-level
console = Console()was replaced withconsole = _get_console(), keeping the module attribute nameconsoleintact for backward compatibility with existing test patches. Thefrom rich.console import Consoleimport was removed from each module.Modules NOT migrated in this PR (documented for follow-up):
plan.py— uses streaming/Live display, too large for this scopesession.py,repl.py,lsp.py,server.py— specialized usage patternsQuality Gates
nox -s lintnox -s typecheckPartial implementation of #813 (step 2 of 4: Console consolidation). Steps 1, 3, 4 remain open on issue #813.
Code Review — PR #1059
chore(cli): complete renderer migration for remaining command modulesClean mechanical refactor. The pattern is consistent across all 8 modules — replace
from rich.console import Console/Console()withfrom cleveragents.cli.renderers import _get_console/_get_console(). The module attribute nameconsoleis preserved for backward compatibility with existing test patches. Good.Approved with a note on scope:
Partial completion of issue #813 — This PR addresses step 2 (Console consolidation) of the 4 steps outlined in issue #813. The render utility functions (
render_error,render_success,render_warning,render_empty) are defined in the newrenderers.pybut are not yet called by any of the migrated modules. Steps 1 (replaceconsole.print(Panel/Table)with renderer functions), 3 (error paths userender_error()), and 4 (Behave scenarios for new renderer paths) remain open.This is fine as an incremental step — just ensure issue #813 is not closed by this PR's merge since there is remaining work. The issue body should be updated to reflect what's done and what remains.
renderers.pyis 215 lines of new code — The lazy singleton pattern with module-level_console: Console | None = Noneis clean. The_get_console()/_get_err_console()design is sound.4795406d12be71481873New commits pushed, approval review dismissed automatically according to repository settings
be71481873ef096e976fef096e976f9a699ce6fd