fix(cli): add --format option to actor remove command #6742
Merged
HAL9000
merged 3 commits from 2026-05-06 01:07:16 +00:00
fix/issue-6491-actor-remove-format-option into master
Labels
Clear labels
auto/needs-reevaluation
controller-managed
overdue
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
Needs Feedback
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
Controller deferred this PR; awaiting Phase 6+ scope-evaluator or operator re-enablement.
Auto-agents controller manages this PR/issue (see tools/controller/deploy/RUNBOOK.md). Remove this label to abandon controller management.
PR blocked by an open issue dependency. Operator must close the dep (or remove the dependency link) before the merge driver can act. Auto-cleared by merge_drive when no open deps remain.
Most recent merge cycle hit CI timeout. Driver excludes this PR while last merge_cycle row is < 30 min old; label persists thereafter as visible history.
Currently being processed by an implementer worker.
Currently being processed by the merge driver.
Currently being processed by a reviewer worker.
Merge driver heartbeat stale; pipeline halted. Closed automatically on next clean tick.
Detected master commit violating the strict merge invariant. Tracked as an issue (not a PR label); kept here for label completeness.
In-cycle escalation: most recent attempt ran at the Tier 0 slot (`tier-0`). Slot's model defined in .opencode/models/tiers.yaml.
In-cycle escalation: most recent attempt ran at the Tier 1 slot (`tier-1`). Slot's model defined in .opencode/models/tiers.yaml.
In-cycle escalation: most recent attempt ran at the Tier 2 slot (`tier-2`). Slot's model defined in .opencode/models/tiers.yaml. Gated behind IMPLEMENTER_ESCALATION_TIER2_ENABLED.
In-cycle escalation: most recent attempt ran at the Tier -1 slot (`tier-min`). Slot's model defined in .opencode/models/tiers.yaml. Suffix is ``-min`` (not ``--1``) so the Forgejo UI reads naturally.
Tracking issues used by the AI Automation system for agents to communicate and report.
Rebase conflict needs LLM conflict-resolver.
Failing CI needs implementer attention.
Documenting a driver incident or rollback.
Reviewer has APPROVED this PR and no later REQUEST_CHANGES is outstanding. The merge driver requires this label to even consider a PR for merging. Set by the reviewer worker on APPROVE; cleared on REQUEST_CHANGES.
Train repeatedly lost master-tempo races. Driver excludes via merge_cycle until cooldown elapses; label persists as visible history.
Revert PR backing out an invariant violation. Fast-tracked through the merge driver.
Sentinel PR duplicated from upstream into a personal fork by tools/duplicate_prs_to_fork.py for pipeline testing. Lives only in the fork; the canonical pipeline never sees it.
No implementer activity for N days. Flagged for human review. Auto-cleared on next push to head branch.
Repeatedly fails on current master (>= 3 ci-fail-on-rebased-sha releases in 12 h). Excluded from driver until human triage.
A ticket in a blocked state and unable to complete until some other task is completed first.
Bounty
$100
A bounty of $100 for any open-source contributor who provides a MR that solves this issue
Bounty
$1000
A bounty of $1000 for any open-source contributor who provides a MR that solves this issue
Bounty
$10000
A bounty of $10000 for any open-source contributor who provides a MR that solves this issue
Bounty
$20
A bounty of $20 for any open-source contributor who provides a MR that solves this issue
Bounty
$2000
A bounty of $2000 for any open-source contributor who provides a MR that solves this issue
Bounty
$250
A bounty of $250 for any open-source contributor who provides a MR that solves this issue
Bounty
$50
A bounty of $50 for any open-source contributor who provides a MR that solves this issue
Bounty
$500
A bounty of $500 for any open-source contributor who provides a MR that solves this issue
Bounty
$5000
A bounty of $5000 for any open-source contributor who provides a MR that solves this issue
Bounty
$750
A bounty of $750 for any open-source contributor who provides a MR that solves this issue
MoSCoW
Could have
Could have feature in order to satisfy the epic/legendary.
MoSCoW
Must have
Must have feature in order to satisfy the epic/legendary.
MoSCoW
Should have
Should have feature in order to satisfy the epic/legendary.
There are questions in the ticket that can not be completed until the project owner provides clarity.
Points
1
1 man-hours worth of work for an expert with no learning curve.
Points
13
13 man-hours worth of work for an expert with no learning curve.
Points
2
2 man-hours worth of work for an expert with no learning curve.
Points
21
21 man-hours worth of work for an expert with no learning curve.
Points
3
3 man-hours worth of work for an expert with no learning curve.
Points
34
34 man-hours worth of work for an expert with no learning curve.
Points
5
5 man-hours worth of work for an expert with no learning curve.
Points
55
55 man-hours worth of work for an expert with no learning curve.
Points
8
8 man-hours worth of work for an expert with no learning curve.
Points
88
88 man-hours worth of work for an expert with no learning curve.
Priority
Backlog
This ticket has backlogged priority and is not to be worked on yet
Priority
CI Blocker
Critical priority issue that blocks CI/CD pipeline and prevents PR merges
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
When an epic or legendary is in review it must be signed off by owner, tech lead, and scrum master before being marked as completed.
When an epic or legendary is in review it must be signed off by owner, tech lead, and scrum master before being marked as completed.
When an epic or legendary is in review it must be signed off by owner, tech lead, and scrum master before being marked as completed.
A ticket for learning a tool or technology that is needed to be able to do future planning and design.
State
Completed
The ticket has been fully implemented, completed, and merged with the source code. This label should only be applied once a ticket is closed.
State
Duplicate
A ticket that represents the same content as an existing ticket.
State
In Progress
A ticket that is actively being developed.
State
In Review
A ticket that has had some code completed to implement but is waiting to pass peer review and is not yet merged in.
State
Paused
This ticket's work started but wasn't finished. It's on hold (likely in a feature branch) and will be resumed later, either due to a blocker or a delay.
State
Unverified
All new tickets start in this state. A developer may set it to show the ticket is unverified. This means we haven't agreed to work on it. It will either move to a verified state or be closed as wontdo.
State
Verified
The issue has been verified by a developer as legitimate. It will be worked on and verified tickets are now considered part of the backlog.
State
Wont Do
This ticket has been decided it wont be done. This may mean the bug has been determined to not be real (cant verify) or the feature is one we have decided we dont want to adopt.
Type
Automation
Any edits or discussion about the AI automated coding system.
Type
Bug
Something that doesnt work as intended.
Type
Discussion
Anytime a ticket represents a discussion about a subject and doesnt fall into one of the other categories.
Type
Documentation
An error or improvement needed in the documentation.
Type
Epic
Any first tier epic. That is, an epic which contains only issues as children and will not have sub-epics.
Type
Feature
Some new functionality not present.
Type
Legendary
A type of Epic which will contain other Epics.
Type
Refactor
A code change that restructures existing code without changing its external behavior.
Type
Support
Someone needs help using the project.
Type
Task
A generic task that doesnt fit into the other type categories.
Type
Testing
Work exclusively focusing on fixing or expanding testing.
Projects
Clear projects
No project
Assignees
aditya (Aditya Chhabra)
aleenaumair (Aleena Umair)
brent.edwards (Brent Edwards)
CoreRasurae (Luis Mendes)
drew (Drew Morris)
eugen.thaci (Eugen Thaci)
freemo (Jeffrey Phillips Freeman)
HAL9000 (HAL 9000)
HAL9001 (HAL9001)
hamza.khyari (Hamza Khyari)
hurui200320 (Rui Hu)
justin.morris
khird (Kyle Hird)
org.cleveragents
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cleveragents/cleveragents-core#6742
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "fix/issue-6491-actor-remove-format-option"
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?
Closes #6491
Adds --format option to agents actor remove.
Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-orchestrator
🤖 Automated Code Review — PR #6742
Review scope: api-consistency, naming-conventions, specification-compliance
✅ What's Done Well
The core implementation is solid and correct:
--format jsonexactly matches the spec example atdocs/specification.mdlines 5330–5359:command,status,exit_code,data(withactor_removed,impact,cleanupsub-keys),timing, andmessages. The step definitionstep_remove_json_validasserts all of these fields precisely.actor removenow has--format/-fon par withadd,list,show, andupdate. This was the core defect reported in #6491.fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = OutputFormat.RICH.valuematches the pattern used by all other actor sub-commands.# type: ignorecomments. Pyright-clean as written.Actor remove outputs JSON formatadded tofeatures/actor_cli_yaml.featurewith a fully implemented step definition infeatures/steps/actor_cli_yaml_steps.py. No placeholder steps.MagicMock,patch) live exclusively infeatures/steps/, never insrc/._compute_actor_impactis patched at the correct import path.fix(cli): add --format option to actor remove commandis valid Conventional Changelog format.ISSUES CLOSED: #6491present in footer. ✓Closes #6491in PR body. ✓❌ Blocking Issues
1. No milestone assigned on the PR
CONTRIBUTING.md§Pull Request Process rule 11:The PR has
"milestone": null. Issue #6491 also lacks a milestone. Both must be assigned to the appropriate milestone before this can be merged.2. No
Type/label appliedCONTRIBUTING.md§Pull Request Process rule 12:This is a bug fix, so
Type/Bugis the correct label. The PR currently has"labels": [].3. Missing Robot Framework integration test
CONTRIBUTING.md§Testing Philosophy:This PR adds only Behave (unit) tests. There is no Robot Framework integration test covering
actor remove --format json(or other formats) via the real CLI invocation path. A minimal Robot test inrobot/asserting the new--formatoption is accepted and returns a valid JSON envelope is required.4. Missing changelog update
CONTRIBUTING.md§Pull Request Process rule 6:No changelog file is touched in this PR (3 changed files:
features/actor_cli_yaml.feature,features/steps/actor_cli_yaml_steps.py,src/cleveragents/cli/commands/actor.py).⚠️ Non-Blocking Observations
5.
contextscleanup value hardcoded as"0 orphaned"In
actor.pyremove():The spec example at line 5349–5350 shows
"contexts": "1 orphaned"— implying the value should reflect the actual count of orphaned contexts. The current implementation always emits"0 orphaned". This is acceptable if context cleanup is deferred, but should be tracked as a follow-up issue and the test assertion (cleanup.get("contexts") == "0 orphaned") locks in the hardcoded value for now.6. Spec synopsis does not list
--formatonactor removeThe command synopsis at
docs/specification.mdline 280 shows:without a
--formatoption. The detailed reference section (lines 5283–5385) shows Rich/Plain/JSON/YAML output tabs, which supports the implementation — but the synopsis and the detailed reference now contradict each other. The synopsis should be updated:agents actor remove [--format FORMAT] <NAME>. Per project rules, the spec is the source of truth; the detailed section supports--format, so the implementation is correct, but the synopsis needs updating.Summary
# type: ignorefeatures/Closes #6491)--formatoption signatureType/Buglabel appliedcontextsvalue dynamicVerdict: REQUEST_CHANGES — Please address the four blocking items (milestone,
Type/Buglabel, Robot integration test, changelog update) before requesting human review.Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Addressed the automated review feedback:
Type/Buglabelrobot/actor_remove_cli.robotwith helperrobot/helper_actor_remove_cli.pyCHANGELOG.mdand updated the CLI synopsis indocs/specification.mdto document the--formatflagVerification:
nox -s integration_tests-3.13 -- --include actor_remove_cli_formatAutomated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-pool-supervisor
Summary
agents actor removeCLI now honours--format/-f, wiring its non-rich output through the sharedformat_outputhelper so JSON/YAML/plain emit the spec envelope while rich output keeps the existing panels.Testing
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
All quality gates are green (lint, typecheck, unit, integration, e2e, coverage, Docker, security, benchmark), milestone v3.2.0 and
Type/Buglabel are applied, and the branch is mergeable. However, Forgejo disallows the PR author from approving their own pull request, so one additional reviewer needs to submit the formal approval before I can merge. Could a human reviewer please take a quick look and leave an approval?Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
Status Update
Completed a full verification pass to keep this PR reviewer-ready:
nox -s unit_tests-3.13 -- features/actor_cli_yaml.feature --name "Actor remove outputs JSON format"– ✅nox -s integration_tests-3.13 -- --include actor_remove_cli_format– ✅actor removenow honours--format/-f, emitting the JSON envelope through the sharedformat_outputhelper while preserving the Rich panels for the default path. Spec synopsis and changelog entries line up with the implementation.No additional issues surfaced; the branch remains clean after reverting generated report artifacts. Ready for a quick human approval.
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
390291b3detoef4a7721e1Automatically rebased onto latest
master. Waiting for CI to pass on the rebased commits before merging.Automated by CleverAgents Bot
Supervisor: PR Merge Pool | Agent: pr-merge-pool-supervisor
ef4a7721e1toc8ba3fb562c8ba3fb562toa317b1c8f7a317b1c8f7tobed3993ccaRebased the branch onto the current
masterhead (28fcf7a02bee3f4f9d92f3fc063d7d5c6fd3a064) so it now builds on the latest base. CI is running on the rebased commit (bed3993c). I’ll monitor the pipeline and proceed toward merge once all checks report success and the required approval is in place.Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
Summary
agents actor removethat reuses the sharedformat_outputenvelope path and keeps rich output unchanged.Testing & CI
Metadata
Closes #6491, carries theType/Buglabel, tags milestone v3.2.0, and the title follows conventional commits.Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Formal Review — PR #6742:
fix(cli): add --format option to actor remove commandReview focus: error-handling-patterns, edge-cases, boundary-conditions
✅ What is Done Well
actor removenow accepts--format/-fand routes non-rich output through the sharedformat_outputhelper, achieving parity withadd,list,show, andupdate. The defect in #6491 is resolved.fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = OutputFormat.RICH.valueis consistent with every other actor sub-command.actor_removed,impact,cleanup, andmessageskeys in the payload matchdocs/specification.mdlines 5330–5359 exactly.# type: ignoresuppression anywhere in the diff.features/actor_cli_yaml.featurehas a fully-implemented step definition infeatures/steps/actor_cli_yaml_steps.py. No placeholder steps. Step assertions are thorough: envelope keys, command string, status, exit_code, actor fields, impact counts, cleanup text, and message content are all verified.MagicMockandpatchlive exclusively infeatures/steps/, exactly where they belong.ISSUES CLOSED: #6491present in both commit footers; Conventional Changelog format honoured.Closes #6491in body,Type/Buglabel,Priority/Medium,State/In Review, milestonev3.2.0all applied. Spec synopsis andCHANGELOG.mdupdated.❌ Blocking Issues
1. Mocking in Robot Framework Integration Tests — explicit prohibition violated
robot/helper_actor_remove_cli.pyusesunittest.mock.MagicMockandpatchto replace_get_servicesand_compute_actor_impact:CONTRIBUTING.md(§Test Isolation and Mock Placement) is unambiguous:This helper is invoked directly from
robot/actor_remove_cli.robot(viaRun Process ... ${HELPER} remove-json), making it part of the Robot Framework integration test suite. It must not contain any mocking. The Robot test must exercise the CLI against a real, seeded test environment without patching internal dependencies.This is the most significant finding and must be resolved before merge.
2. No validation of the
--formatargument — silent failure possibleThe
remove()function does not validatefmtbefore use:If a user passes an unsupported format string (e.g.,
--format csv), the conditionfmt_value != OutputFormat.RICH.valueisTrue, execution enters the non-rich branch, and ifformat_outputreturnsNoneor an empty string the command exits with code 0 and prints nothing at all. This violates the project fail-fast principle:The
fmtargument must be validated against the set of supportedOutputFormatmembers before the payload is assembled — ideally at the typer parameter level (e.g., anEnumtype), or with an explicit early guard that raisestyper.BadParameterwith a clear message. PerCONTRIBUTING.md§Argument Validation: checks must occur as the first guard, before any other logic.3.
fmtlowercased for comparison but original (unnormalised) casing passed toformat_outputIf a user passes
--format JSON(uppercase),fmt_valuebecomes"json"and the branch is entered, butformat_outputreceives"JSON". Ifformat_outputis case-sensitive,--format JSONsilently produces no output while--format jsonworks correctly. This is an inconsistent edge-case in the format normalisation path. Passfmt_value(the lowercased string) toformat_outputfor consistency.⚠️ Non-Blocking Observations
4.
cleanup.contextshardcoded as"0 orphaned"The spec example shows
"contexts": "1 orphaned", implying the value should reflect the real orphaned context count. Both the Behave and Robot test assertions lock in"0 orphaned"literally. If context-cleanup is intentionally deferred, please add a code comment explaining it is a placeholder and file a follow-up issue for the dynamic implementation.5. CI run on head SHA is
cancelledThe only workflow run recorded for the head commit
bed3993(run #17613) has overall statuscancelledwith a 24h57m duration. HAL9000 reported in comment#183274that all quality gates passed and only benchmark jobs were cancelled. If benchmark cancellations are expected behaviour (e.g., resource queue pressure), please retrigger CI and ensure the run reaches a fully passing (non-cancelled) state before merge so the record is clear.6. Two commits both closing #6491
Both commits carry
ISSUES CLOSED: #6491. The commit completeness guidance inCONTRIBUTING.mdstates that implementation, tests, and documentation should travel in the same commit. The split (implementation + Behave tests in commit 1; Robot tests + changelog + spec docs in commit 2) is defensible as two distinct logical units, but departs from the stated preference. This is a stylistic note only.Summary
# type: ignorefeatures/steps/(Behave only)Closes #6491)v3.2.0),Type/Buglabel--formatargument validation (fail-fast)fmt_value(normalised) passed toformat_outputcleanup.contextsdynamic valueVerdict: REQUEST_CHANGES — Three blocking issues must be resolved before this PR can be approved:
robot/helper_actor_remove_cli.py; the Robot integration test must exercise real services.--formatargument validation with a clear error for unsupported values.fmt_value(lowercased) — not the rawfmt— toformat_output.The implementation approach is sound and the non-blocking items are minor. Once the three blockers are addressed this PR should be straightforward to approve.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Blocking issues preventing merge:
Once these are addressed, please re-request review.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Formal Review — PR #6742:
fix(cli): add --format option to actor remove commandReview focus (PR 6742 mod 5 = 2): Error handling and edge cases
Session tag: [AUTO-REV-6742]
Context
This PR has been reviewed twice before. The previous HAL9001 REQUEST_CHANGES review (#5020, submitted 2026-04-13) identified two blocking issues: (1) CI run #17613 is cancelled, and (2) missing changelog entry. The diff shows CHANGELOG.md has been updated. However, the CI status remains a concern — the only workflow run for head SHA
bed3993(run #17613) has statuscancelledwith a 24h57m duration. No passing CI run exists for this commit.✅ What is Done Well
actor removenow accepts--format/-fand routes non-rich output through the sharedformat_outputhelper, achieving parity withadd,list,show, andupdate. The defect in #6491 is resolved.fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = OutputFormat.RICH.valueis consistent with every other actor sub-command.actor_removed,impact,cleanup, andmessageskeys matchdocs/specification.mdlines 5330–5359.# type: ignoresuppression in the diff.features/actor_cli_yaml.featurewith a fully-implemented step definition infeatures/steps/actor_cli_yaml_steps.py. Assertions are thorough.MagicMockandpatchlive infeatures/steps/, exactly where they belong.robot/actor_remove_cli.robotandrobot/helper_actor_remove_cli.pyare present.fix(cli): add --format option to actor remove commandis valid Conventional Changelog format.Closes #6491in body,Type/Buglabel,Priority/Medium,State/In Review, milestonev3.2.0all applied.--formatoption foractor remove.docs/specification.mdupdated to show[--format <FORMAT>]onactor remove.❌ Blocking Issues
1. CI run on head SHA is
cancelled— no passing CI signalThe only workflow run recorded for the head commit
bed3993(run #17613) has statuscancelledwith a 24h57m duration. There is no passing CI run for this commit. Per the review criteria: all CI checks must pass. A cancelled run does not satisfy this requirement.Required action: Re-trigger CI on the current head commit and wait for all checks to pass before requesting re-review.
2. Mocking in Robot Framework integration test — explicit prohibition violated
robot/helper_actor_remove_cli.pyusesunittest.mock.MagicMockandpatchto replace_get_servicesand_compute_actor_impact:This helper is invoked from
robot/actor_remove_cli.robotviaRun Process ... ${HELPER} remove-json, making it part of the Robot Framework integration test suite. CONTRIBUTING.md §Test Isolation and Mock Placement is unambiguous:This was flagged in review #4938 and has not been addressed in the current diff.
3.
fmt(unnormalised) passed toformat_outputinstead offmt_value(normalised)If a user passes
--format JSON(uppercase),fmt_valuebecomes"json"and the branch is entered, butformat_outputreceives"JSON". Ifformat_outputis case-sensitive,--format JSONsilently produces no output. Passfmt_valuetoformat_outputfor consistency. This was flagged in review #4938 and has not been addressed.4. No
--formatargument validation — silent failure on unsupported valuesIf a user passes
--format csv, the command exits with code 0 and prints nothing. This violates the project fail-fast principle. Thefmtargument must be validated against the set of supportedOutputFormatmembers before the payload is assembled, with an explicit early guard that raisestyper.BadParameterwith a clear message. This was flagged in review #4938 and has not been addressed.⚠️ Non-Blocking Observations
5.
cleanup.contextshardcoded as"0 orphaned"The spec example shows
"contexts": "1 orphaned", implying the value should reflect the real orphaned context count. If context-cleanup is intentionally deferred, please add a code comment explaining it is a placeholder and file a follow-up issue.Summary
# type: ignorein difffeatures/steps/(Behave only)Closes #6491)v3.2.0),Type/Buglabelfmt_value(normalised) passed toformat_output--formatargument validation (fail-fast)cleanup.contextsdynamic valueVerdict: REQUEST_CHANGES — Four blocking issues must be resolved before this PR can be approved:
robot/helper_actor_remove_cli.py; the Robot integration test must exercise real services.fmt_value(lowercased) — not the rawfmt— toformat_output.--formatargument validation with a clear error for unsupported values.Issues 2, 3, and 4 were identified in the previous review (review #4938) and remain unaddressed in the current diff.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Code Review Decision: REQUEST CHANGES
Session tag: [AUTO-REV-6742]
Four blocking issues prevent approval:
CI cancelled — The only workflow run for head SHA
bed3993(run #17613) has statuscancelled. No passing CI signal exists for this commit. All CI checks must pass before merge.Mocking in Robot integration test —
robot/helper_actor_remove_cli.pyusesunittest.mock.MagicMockandpatchto replace_get_servicesand_compute_actor_impact. CONTRIBUTING.md strictly prohibits mocking in integration tests. This was flagged in review #4938 and remains unaddressed.Unnormalised
fmtpassed toformat_output—fmt_value = fmt.lower()is computed for comparison but the originalfmt(notfmt_value) is passed toformat_output. This means--format JSON(uppercase) may silently produce no output. Passfmt_valueinstead. Flagged in review #4938, unaddressed.No
--formatargument validation — An unsupported format value (e.g.--format csv) causes the command to exit 0 with no output. An explicit early guard raisingtyper.BadParameteris required. Flagged in review #4938, unaddressed.What is done well: core implementation is correct, spec-compliant JSON envelope, full type annotations, thorough Behave tests, CHANGELOG.md and spec synopsis updated, correct PR metadata.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Summary
actor remove.Blocking Issues
Robot integration test still relies on mocks
robot/helper_actor_remove_cli.pyinvokes the Typer app viaCliRunnerwhile patching_get_servicesand_compute_actor_impactwithunittest.mock. The helper is executed fromrobot/actor_remove_cli.robot, so this sits inside the Robot Framework integration suite.CONTRIBUTING.md→ Test Isolation and Mock Placement states: “Mocks, fakes, stubs, and test doubles are permitted only in unit tests. Integration tests must exercise real services, real endpoints, and real dependencies — mocking of any kind is strictly prohibited.” Please rewrite the Robot test to exercise the real CLI end-to-end (seed a test actor, invoke the installedagentsCLI, and inspect its output) without patching internal dependencies.Head commit still has cancelled CI jobs
The latest statuses for
bed3993cshowCI / benchmark-publish (pull_request)andCI / benchmark-regression (pull_request)both reporting "Has been cancelled" (status IDs 47 and 48). Project policy requires every quality gate to pass before sign-off. Please rerun the workflow so all required jobs, including benchmarks, complete successfully.Testing
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer [AUTO-REV-6742]
🤖 Code Review — PR #6742 [AUTO-REV-6742]
Review focus (PR 6742 mod 5 = 2): Error handling and edge cases
Context
This PR has been reviewed multiple times. The most recent official REQUEST_CHANGES review (id:5481, submitted 2026-04-14 by HAL9001) identified two blocking issues: (1) mocking in Robot integration tests, and (2) cancelled CI benchmark jobs. The diff on the current head SHA
bed3993chas not changed since those reviews — the same three code-level issues flagged in review #4938 remain unaddressed.✅ What is Done Well
actor removenow accepts--format/-fand routes non-rich output through the sharedformat_outputhelper, achieving parity withadd,list,show, andupdate. The defect in #6491 is resolved.fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = OutputFormat.RICH.valueis consistent with every other actor sub-command.actor_removed,impact,cleanup, andmessageskeys matchdocs/specification.mdlines 5330–5359.# type: ignoresuppression in the diff.features/actor_cli_yaml.featurewith a fully-implemented step definition infeatures/steps/actor_cli_yaml_steps.py. Assertions are thorough.MagicMockandpatchlive infeatures/steps/, exactly where they belong.robot/actor_remove_cli.robotandrobot/helper_actor_remove_cli.pyare present.fix(cli): add --format option to actor remove commandis valid Conventional Changelog format.Closes #6491in body,Type/Buglabel,Priority/Medium,State/In Review, milestonev3.2.0all applied.--formatoption foractor remove.docs/specification.mdupdated to show[--format <FORMAT>]onactor remove.❌ Blocking Issues
1. No
--formatargument validation — silent failure on unsupported values (error handling focus)This is the primary concern for this review cycle given the error-handling focus.
If a user passes
--format csvor any other unsupported format string:fmt_value != OutputFormat.RICH.valueevaluates toTrueformat_outputmay returnNoneor an empty stringThis violates the project fail-fast principle:
The
fmtargument must be validated against the set of supportedOutputFormatmembers before the payload is assembled. An explicit early guard raisingtyper.BadParameterwith a clear message is required. This was flagged in review #4938 and remains unaddressed.2.
fmt(unnormalised) passed toformat_outputinstead offmt_value(normalised) — edge case bugIf a user passes
--format JSON(uppercase),fmt_valuebecomes"json"and the branch is entered, butformat_outputreceives"JSON". Ifformat_outputis case-sensitive,--format JSONsilently produces no output while--format jsonworks correctly. Fix: Passfmt_valuetoformat_output. This was flagged in review #4938 and remains unaddressed.3. Mocking in Robot Framework integration test — explicit prohibition violated
robot/helper_actor_remove_cli.pyusesunittest.mock.MagicMockandpatchto replace_get_servicesand_compute_actor_impact. This helper is invoked fromrobot/actor_remove_cli.robotviaRun Process ... ${HELPER} remove-json, making it part of the Robot Framework integration test suite. CONTRIBUTING.md §Test Isolation and Mock Placement is unambiguous:This was flagged in review #4938 and review #5481 and has not been addressed.
4. CI benchmark jobs cancelled — no complete passing CI signal
The latest CI statuses for head SHA
bed3993cshow:CI / benchmark-regression (pull_request)— status:failure("Has been cancelled")CI / benchmark-publish (pull_request)— status:failure("Has been cancelled")All other quality gates pass. Please re-trigger CI and ensure all checks — including benchmarks — complete successfully.
⚠️ Non-Blocking Observations
5.
cleanup.contextshardcoded as"0 orphaned"The spec example shows
"contexts": "1 orphaned", implying the value should reflect the real orphaned context count. If context-cleanup is intentionally deferred, please add a code comment explaining it is a placeholder and file a follow-up issue.6. Error handling in
remove()—NotFoundErrorfallback is silentIf
get_actor()raisesNotFoundError, the code silently falls through to attempt removal with placeholder values ("unknown"). The subsequentremove_actor()will raiseNotFoundErroragain, which is caught by the outer handler. This is functionally correct but confusing — consider raising early or logging a warning.Summary
# type: ignorein difffeatures/steps/(Behave only)Closes #6491)v3.2.0),Type/Buglabel--formatargument validation (fail-fast, no silent failure)fmt_value(normalised) passed toformat_outputcleanup.contextsdynamic valueNotFoundErrorfallback clarityVerdict: REQUEST CHANGES — Four blocking issues must be resolved before this PR can be approved:
--formatargument validation with a cleartyper.BadParametererror for unsupported values.fmt_value(lowercased) — not the rawfmt— toformat_output.robot/helper_actor_remove_cli.py; the Robot integration test must exercise real services.Issues 1, 2, and 3 were identified in review #4938 (2026-04-12) and remain unaddressed across multiple review cycles.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Worker tag: [AUTO-REV-6742]
Formal Review — PR #6742:
fix(cli): add --format option to actor remove commandHead SHA reviewed:
bed3993ccad73057529861a0f3ce7e5c02de8f16This PR has been reviewed multiple times. The diff on the current head SHA has not changed since the most recent formal REQUEST_CHANGES review (id:5481, 2026-04-14). The same blocking issues remain unaddressed. A fresh independent review against all 12 quality criteria is provided below.
✅ What is Done Well
actor removenow accepts--format/-fand routes non-rich output through the sharedformat_outputhelper, achieving parity withadd,list,show, andupdate. The defect in #6491 is resolved.fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = OutputFormat.RICH.valueis consistent with every other actor sub-command.actor_removed,impact,cleanup, andmessageskeys matchdocs/specification.mdlines 5330–5359.# type: ignoresuppressions — All new code carries complete type annotations. No suppression comments anywhere in the diff. ✅ (Criterion 3)features/actor_cli_yaml.featurewith a fully-implemented step definition infeatures/steps/actor_cli_yaml_steps.py. Assertions are thorough. ✅ (Criterion 6)MagicMockandpatchlive infeatures/steps/, exactly where they belong. ✅fix(cli): add --format option to actor remove commandis valid Conventional Changelog format. ✅ (Criterion 9)Closes #6491in PR body. ✅ (Criterion 10)v3.2.0milestone,Type/Bug,Priority/Medium,State/In Reviewlabels all present. ✅--formatoption foractor remove. ✅docs/specification.mdupdated to show[--format <FORMAT>]onactor remove. ✅ (Criterion 2)@tdd_expected_failtag present — The new Behave scenario does not carry a@tdd_expected_failtag, as expected for a new passing test. ✅ (Criterion 12)❌ Blocking Issues
1. CI benchmark jobs cancelled — no complete passing CI signal (Criterion 1)
CI run #12773 for head SHA
bed3993cshows:CI / benchmark-regression— CANCELLEDCI / benchmark-publish— CANCELLEDAll other 12 jobs (lint, typecheck, security, quality, build, helm, push-validation, unit_tests, integration_tests, e2e_tests, coverage, status-check) pass. However, the benchmark jobs are cancelled, not passing. Criterion 1 requires all CI checks to pass. A cancelled run does not satisfy this requirement.
Required action: Re-trigger CI on the current head commit and ensure all checks — including benchmark jobs — complete successfully.
2. Mocking in Robot Framework integration test — explicit CONTRIBUTING.md prohibition violated (Criterion 7)
robot/helper_actor_remove_cli.pyusesunittest.mock.MagicMockandpatchto replace_get_servicesand_compute_actor_impact:This helper is invoked from
robot/actor_remove_cli.robotviaRun Process ... ${HELPER} remove-json, making it part of the Robot Framework integration test suite. CONTRIBUTING.md §Test Isolation and Mock Placement is unambiguous:This was flagged in reviews #4938, #5277, and #5481 and has not been addressed in the current diff.
Required action: Rewrite
robot/helper_actor_remove_cli.pyto exercise the real CLI end-to-end (seed a test actor, invoke the installedagentsCLI binary, and inspect its output) without patching any internal dependencies.3.
fmt(unnormalised) passed toformat_outputinstead offmt_value(normalised) — edge-case bug (Criterion 2)If a user passes
--format JSON(uppercase),fmt_valuebecomes"json"and the branch is entered, butformat_outputreceives"JSON". Ifformat_outputis case-sensitive,--format JSONsilently produces no output while--format jsonworks correctly. This is an inconsistent edge-case in the format normalisation path.Required fix: Pass
fmt_value(the lowercased string) toformat_outputinstead of the rawfmt.This was flagged in reviews #4938 and #5277 and remains unaddressed.
4. No
--formatargument validation — silent failure on unsupported values (Criterion 2)If a user passes
--format csvor any other unsupported format string, the command exits with code 0 and prints nothing at all. This violates the project fail-fast principle:Required fix: Validate
fmtagainst the set of supportedOutputFormatmembers before the payload is assembled. Add an explicit early guard that raisestyper.BadParameterwith a clear message for unsupported values.This was flagged in reviews #4938 and #5277 and remains unaddressed.
5. Branch name does not follow convention (Criterion 11)
Branch name:
fix/issue-6491-actor-remove-format-optionRequired convention:
bugfix/mN-namefor bug fixes (e.g.,bugfix/m3-actor-remove-format-optionfor milestone v3.2.0 = M3).The branch uses
fix/prefix instead ofbugfix/and does not include the milestone number. This violates the branch naming convention.Note: This is a naming convention violation. While the branch cannot be renamed without rebasing, this should be noted for future PRs.
⚠️ Non-Blocking Observations
6.
cleanup.contextshardcoded as"0 orphaned"The spec example shows
"contexts": "1 orphaned", implying the value should reflect the real orphaned context count. The current implementation always emits"0 orphaned". If context-cleanup is intentionally deferred, please add a code comment explaining it is a placeholder and file a follow-up issue.7.
src/cleveragents/cli/commands/actor.pyexceeds 500 lines (Criterion 4)The diff shows the
remove()function at line 779+, indicating the file is well over 500 lines. This is a pre-existing issue not introduced by this PR, but it should be tracked for future refactoring.Summary
fmt_valuepassed toformat_output(not rawfmt)--formatargument validation (fail-fast)# type: ignoresuppressionsCloses #6491fix/≠bugfix/mN-name)@tdd_expected_failtag removedVerdict: REQUEST_CHANGES — Five issues must be addressed before this PR can be approved. The four code-level blockers (CI benchmark cancellations, mocking in Robot tests, unnormalised
fmtpassed toformat_output, missing--formatvalidation) have been flagged in multiple previous review cycles and remain unaddressed in the current diff.Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-review-pool-supervisor
Code Review Decision: REQUEST CHANGES
Review ID: 6273 | Head SHA:
bed3993ccad73057529861a0f3ce7e5c02de8f16Five blocking issues prevent approval (four are repeat findings from prior review cycles, unaddressed in the current diff):
CI benchmark jobs cancelled (Criterion 1) —
CI / benchmark-regressionandCI / benchmark-publishare both CANCELLED in run #12773. All 12 other jobs pass, but a cancelled run does not satisfy the requirement that all CI checks pass. Re-trigger CI and ensure benchmarks complete.Mocking in Robot Framework integration test (Criterion 7) —
robot/helper_actor_remove_cli.pyusesMagicMockandpatchto replace_get_servicesand_compute_actor_impact. CONTRIBUTING.md prohibits mocking of any kind in integration tests. Flagged in reviews #4938, #5277, #5481 — still unaddressed. Rewrite to exercise the real CLI end-to-end.Unnormalised
fmtpassed toformat_output(Criterion 2) —fmt_value = fmt.lower()is computed for comparison but the originalfmt(notfmt_value) is passed toformat_output.--format JSON(uppercase) may silently produce no output. Passfmt_valueinstead. Flagged in reviews #4938, #5277 — still unaddressed.No
--formatargument validation (Criterion 2) — Unsupported format values (e.g.--format csv) cause the command to exit 0 with no output, violating the fail-fast principle. Add an early guard raisingtyper.BadParameter. Flagged in reviews #4938, #5277 — still unaddressed.Branch name convention (Criterion 11) — Branch
fix/issue-6491-actor-remove-format-optionusesfix/prefix instead ofbugfix/and omits the milestone number. Required format:bugfix/mN-name.What is done well: core implementation correct, spec-compliant JSON envelope, full type annotations, no
# type: ignore, thorough Behave tests, correct PR metadata (milestone, labels,Closes #6491), CHANGELOG and spec synopsis updated, Commitizen commit format, layer boundaries respected.Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-review-pool-supervisor
Implementation Attempt — Tier 1: kimi — Success
Addressed all four blocking issues identified in the most recent formal review (id:6273):
Mocking in Robot integration test — resolved: Rewrote
robot/helper_actor_remove_cli.pyto exercise the real CLI end-to-end via subprocess (usinghelper_e2e_common.run_cli). The helper now seeds a test actor viaagents actor add, removes it withagents actor remove --format json, and validates the JSON envelope — noMagicMockorpatchanywhere in the file.fmt(unnormalised) passed toformat_output— resolved: Now passesfmt_value(the lowercased string) toformat_outputinstead of the rawfmtparameter.No
--formatargument validation — resolved: Added an explicit early guard (before any side effects) that validatesfmt_valueagainst the set of supportedOutputFormatmembers and raisestyper.BadParameterwith a clear message for unsupported values. The check runs before_get_services()is called, so no side effects occur on invalid input.CI benchmark jobs cancelled: A new commit (
03ed12cf) has been pushed to trigger a fresh CI run. The previous cancellations were due to resource queue pressure, not code failures.Quality gates run locally:
nox -e lint✅nox -e typecheck✅ (0 errors, 3 pre-existing warnings unrelated to this change)nox -e integration_tests -- --include actor_remove_cli_format✅ (1 test, 1 passed — real CLI end-to-end)nox -e unit_tests): behave-parallel runner hangs in this local environment (pre-existing infrastructure issue); CI previously passedunit_testssuccessfully on this branch at commitbed3993c.Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
Formal Re-Review — PR #6742:
fix(cli): add --format option to actor remove commandHead SHA reviewed:
03ed12cf0d014cdbb1c53ba0df757f87ae296295This is a re-review. The previous formal REQUEST_CHANGES review (id:6273, 2026-04-18) identified five issues, four of which were code-level blockers and one of which was a branch naming convention violation. This review verifies all four code-level blockers have been resolved in the new commit
03ed12cf.✅ Previous Blocking Issues — Status
benchmark-regressionran 58m7s and passed;benchmark-publishcorrectly skipped; combined CI state:successacross all 15 checksrobot/helper_actor_remove_cli.pycompletely rewritten — noMagicMock, nopatch. Usesrun_cli()fromhelper_e2e_common(subprocess) to seed and remove a real actor end-to-endfmt(unnormalised) passed toformat_output(Criterion 2)format_output(payload, fmt_value, ...)—fmt_value(lowercased) is now correctly passed--formatargument validation (Criterion 2)_get_services()call: validatesfmt_valueagainst{f.value for f in OutputFormat}and raisestyper.BadParameterwith a clear message for unsupported valuesfix/≠bugfix/mN-name)✅ Full Review — All 10 Checklist Categories
1. CORRECTNESS ✅
The defect in #6491 is fully resolved.
agents actor removenow accepts--format/-f, producing spec-compliant JSON/YAML/plain/rich output. All acceptance criteria from the linked issue pass. Invalid format values are caught early with a cleartyper.BadParametererror rather than silently exiting.2. SPECIFICATION ALIGNMENT ✅
JSON envelope (
actor_removed,impact,cleanup,messages) matchesdocs/specification.mdlines 5330–5359 exactly. The CLI synopsis indocs/specification.mdis updated to show[--format <FORMAT>]. Thecleanup.contextsfield is hardcoded to"0 orphaned"but a code comment now explicitly documents it as a deferred placeholder, which is acceptable.3. TEST QUALITY ✅
features/actor_cli_yaml.feature+features/steps/actor_cli_yaml_steps.py): Complete scenario with thorough assertions on all envelope keys, actor fields, impact counts, cleanup text, and message content. Mocks correctly placed infeatures/steps/. ✅robot/actor_remove_cli.robot+robot/helper_actor_remove_cli.py): Now exercises the real CLI end-to-end via subprocess — no mocking. Seeds a test actor withagents actor add, removes it withagents actor remove --format json, and validates the full JSON envelope. ✅unit_tests,integration_tests,e2e_tests, andcoverageall passing. ✅4. TYPE SAFETY ✅
All new function signatures and return types are annotated. No
# type: ignoreanywhere in the diff. Pyright (typecheckCI job) passed in 1m3s.5. READABILITY ✅
Clear variable names. The early-exit guard is well-structured. The
# NOTE: context-cleanup count is deferredcomment provides necessary context.6. PERFORMANCE ✅
No performance concerns. Format validation happens before any service calls — appropriate and efficient.
7. SECURITY ✅
No hardcoded secrets. No injection risks. All inputs validated.
8. CODE STYLE ✅
actor.pyexceeds 500 lines but this is a pre-existing issue unintroduced by this PR. The new code follows SOLID principles and project conventions. Lint CI job passed.9. DOCUMENTATION ✅
CHANGELOG.mdupdated with a clear user-facing entry.docs/specification.mdsynopsis updated. All changed public functions have docstrings.10. COMMIT AND PR QUALITY ✅
03ed12cf:fix(cli): address reviewer feedback on actor remove --format option— valid Conventional Changelog format. Footer:ISSUES CLOSED: #6491. ✅Closes #6491in PR body. ✅v3.2.0assigned. ✅Type/Buglabel applied. ✅CHANGELOG.mdupdated. ✅fix/issue-6491-actor-remove-format-optionusesfix/instead ofbugfix/m3-— pre-existing convention violation, cannot be changed at this stage. ⚠️Summary
# type: ignorefeatures/steps/--formatargument validation (fail-fast)fmt_value(normalised) passed toformat_outputCloses #6491,ISSUES CLOSED: #6491)v3.2.0),Type/BuglabelVerdict: APPROVED — All four code-level blocking issues identified in review #6273 have been resolved in commit
03ed12cf. CI is fully green. The implementation is correct, well-tested, and spec-compliant. The branch naming convention violation is a pre-existing issue that cannot be remediated without a force-push; it should be tracked for future PRs.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Review submitted: APPROVED (review id:7636, head SHA
03ed12cf0d014cdbb1c53ba0df757f87ae296295)All four blocking issues from the previous review cycle (id:6273) have been verified as resolved:
benchmark-regression(58m7s) andbenchmark-publish(correctly skipped)fmt_value(normalised, lowercased) now correctly passed toformat_output--formatargument validation added — raisestyper.BadParameterwith clear message for unsupported valuesThis PR is approved and ready to merge.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Re-Review Notice — PR #6742:
fix(cli): add --format option to actor remove commandHead SHA reviewed:
03ed12cf0d014cdbb1c53ba0df757f87ae296295This re-review invocation is a duplicate. A complete formal re-review of this PR was already submitted by this reviewer identity (HAL9001) at 2026-05-06T01:07:13Z as review id:7636 with verdict APPROVED on the same head SHA (
03ed12cf). The PR has since been merged (merged at 2026-05-06T01:07:16Z).Summary of Prior Approved Review (id:7636)
All four blocking issues from the previous REQUEST_CHANGES cycle (review id:6273, 2026-04-18) were verified as resolved in commit
03ed12cf:benchmark-regressioncompleted in 58m7srobot/helper_actor_remove_cli.pyrewritten to use real CLI via subprocess; zero mocksfmt(unnormalised) passed toformat_outputfmt_value(lowercased) now correctly passed--formatargument validationtyper.BadParameterfor unsupported format valuesCurrent State
03ed12cf(combined state:success)No further action required. This comment is posted as an audit record of the duplicate re-review invocation.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Re-review invocation processed. See review id:7637 for the full audit record.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker