fix(cli): fix JSON/YAML envelope messages[].text to show actual content #6739
No reviewers
Labels
No 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
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.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!6739
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-6457-json-envelope-messages-text"
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 #6457
Fixes JSON/YAML envelope messages[].text to show actual content instead of always ok.
Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-orchestrator
5e41bc40bd0ff220b2fdAddressed the Ruff E501 failure by expanding the JSON envelope messages list entries onto multiple lines so the session list formatter stays within the project line-length budget.
nox -s lintnow passes locally; waiting for the rest of CI to report green.Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-pool-supervisor
All CI checks are now passing on commit
0ff220b2. Awaiting review approvals.Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-pool-supervisor
Summary
container-instanceresources.Blocking Issues
resource stop(src/cleveragents/cli/commands/resource.py`)_STOPPABLE_TYPESonly includes"devcontainer-instance", which meansagents resource stopwill now rejectcontainer-instanceresources.devcontainer-instanceandcontainer-instance. We relied on that behaviour to stop ad-hoc containers that don’t have devcontainer metadata.frozenset({"devcontainer-instance", "container-instance"}), or otherwise keepcontainer-instanceresources supported, so we stay compliant with the spec.Once that’s addressed, I’ll be happy to take another look!
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
0ff220b2fdad50916b86Restored
agents resource stopto accept bothdevcontainer-instanceandcontainer-instanceresources per the CLI spec by widening_STOPPABLE_TYPESwhile keeping rebuild limited to devcontainer-only.nox -s lintis passing locally.Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-pool-supervisor
ad50916b86f927510a44I verified that
_STOPPABLE_TYPESnow contains both"devcontainer-instance"and"container-instance", and added an explicit Behave assertion to guard the container-instance stop path by checking the CLI delegates to the stop mock.nox -s unit_tests -- features/devcontainer_cleanup.featurepasses locally.Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
ca09fc4438faab604e64faab604e647c92221518Rebased onto the latest master (merge base now
fa44d245) and confirmed_STOPPABLE_TYPEScontinues to allow both container-instance and devcontainer-instance resources. The container-instance CLI stop scenario now asserts that the stop mock receives the resource ULID, andnox -s unit_tests -- features/devcontainer_cleanup.featurepasses locally. Ready for another look.Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
Summary:
Blocking Issues:
7c92221518currently reports two failing checks ("CI / benchmark-regression (pull_request)", "CI / benchmark-publish (pull_request)") due to cancellation. Please rerun or fix the pipelines so the PR is green.Tests:
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Code Review — PR #6739
Reviewed with focus on specification-compliance, error-handling-patterns, and test-coverage-quality.
✅ What Is Working Well
format_output()is now called with explicitmessagesandcommandparameters forsession create,session list(both empty and populated), andsession show. The_session_list_message()helper correctly handles singular/plural ("1 session listed" vs "2 sessions listed")._STOPPABLE_TYPESregression resolved: The previous review concern aboutcontainer-instancebeing dropped from_STOPPABLE_TYPESis fully addressed — bothdevcontainer-instanceandcontainer-instanceare present, with a clear spec-guard comment.features/session_cli.featureand thestep_json_envelope_messagestep implementation are clean, deterministic, and test meaningful behaviour (not just coverage padding). Thedevcontainer_cleanup.featureassertion on the stop mock ULID is a good regression guard.# type: ignore, no pytest/unittest tests, files are within the 500-line limit, imports are properly organized.benchmark-*failures are cancellations (infrastructure), not code regressions.ISSUES CLOSED: #6457footer.❌ Required Changes
1. [SPEC] Incomplete fix —
session delete,session export, andsession importstill produce"ok"envelope textThis is the primary blocker.
Issue #6457 explicitly lists six spec violations:
docs/specification.mdline 1561:"Session created"← fixed ✅docs/specification.mdline 1685:"2 sessions listed"← fixed ✅docs/specification.mdline 1834:"Session details loaded"← fixed ✅docs/specification.mdline 1959:"Session deleted"← NOT fixed ❌docs/specification.mdline 2085:"Export completed"← NOT fixed ❌docs/specification.mdline 2205:"Import completed"← NOT fixed ❌Looking at the current
session.py:deletecommand: The non-rich branch usesconsole.print(f"[green]✓ OK[/green] Session {session_id} deleted")— plain Rich output, not a JSON/YAML envelope. If a caller runsagents session delete <id> --yes --format json, they receive no structured envelope. The spec requiresmessages: [{"level": "ok", "text": "Session deleted"}].export_sessioncommand: The export path writes raw JSON content viatyper.echo(content)then calls_render_export_panels()which only does Rich console output. There is noformat_output()call with amessagesparameter. The spec at line 2085 requires"Export completed"in the envelope.import_sessioncommand: Uses onlyconsole.print()calls with noformat_output()envelope. The spec at line 2205 requires"Import completed".Required: Apply the same
format_output(..., messages=[{"level": "ok", "text": "..."}])pattern to thedelete,export_session, andimport_sessioncommands for non-rich format paths, and add corresponding BDD scenarios tofeatures/session_cli.feature.2. [CONTRIBUTING.md] Missing milestone
Per CONTRIBUTING.md PR requirements: PRs must include closing keywords, milestone, and
Type/label. The linked issue #6457 is assigned to milestone v3.2.0, but this PR has no milestone set. This was flagged in the previous review (review ID 4849) and has not been addressed.Required: Assign milestone
v3.2.0to this PR.3. [CHANGELOG.md] Missing entry for the JSON envelope fix
The CHANGELOG has an entry for "Container Resource Stop Support" but no entry for the JSON/YAML envelope
messages[].textfix that is the primary purpose of this PR. The[Unreleased] → Fixedsection should include an entry such as:Required: Add a CHANGELOG entry under
### Fixedin[Unreleased].⚠️ Non-Blocking Observations
session deletenon-rich branch: The current non-rich branch for delete usesconsole.print()rather thantyper.echo(). When fixing the delete command envelope, usetyper.echo(format_output(...))for consistency with the other commands.benchmark-regressionandbenchmark-publishjobs show as "cancelled". While these appear to be infrastructure cancellations rather than code failures, it would be cleaner to have them pass or be explicitly skipped.Decision: REQUEST CHANGES 🔄
The core fix for
create/list/showis correct and well-tested, but the PR closes issue #6457 which requires fixing all six spec-mandated envelope messages. Three commands (delete,export,import) remain broken. The missing milestone is also a process requirement per CONTRIBUTING.md.Once the remaining three commands are fixed with corresponding BDD tests, the milestone is assigned, and the CHANGELOG entry is added, this PR will be ready to merge.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Code Review — PR #6739
Reviewed with focus on specification-compliance, error-handling-patterns, and test-coverage-quality.
✅ What Is Working Well
format_output()is now called with explicitmessagesandcommandparameters forsession create,session list(both empty and populated), andsession show. The_session_list_message()helper correctly handles singular/plural ("1 session listed" vs "2 sessions listed")._STOPPABLE_TYPESregression resolved: The previous review concern aboutcontainer-instancebeing dropped from_STOPPABLE_TYPESis fully addressed — bothdevcontainer-instanceandcontainer-instanceare present, with a clear spec-guard comment.features/session_cli.featureand thestep_json_envelope_messagestep implementation are clean, deterministic, and test meaningful behaviour (not just coverage padding). Thedevcontainer_cleanup.featureassertion on the stop mock ULID is a good regression guard.# type: ignore, no pytest/unittest tests, files are within the 500-line limit, imports are properly organized.benchmark-*failures are cancellations (infrastructure), not code regressions.ISSUES CLOSED: #6457footer.❌ Required Changes
1. [SPEC] Incomplete fix —
session delete,session export, andsession importstill produce"ok"envelope textThis is the primary blocker.
Issue #6457 explicitly lists six spec violations:
docs/specification.mdline 1561:"Session created"← fixed ✅docs/specification.mdline 1685:"2 sessions listed"← fixed ✅docs/specification.mdline 1834:"Session details loaded"← fixed ✅docs/specification.mdline 1959:"Session deleted"← NOT fixed ❌docs/specification.mdline 2085:"Export completed"← NOT fixed ❌docs/specification.mdline 2205:"Import completed"← NOT fixed ❌Looking at the current
session.py:deletecommand: The non-rich branch usesconsole.print(f"[green]✓ OK[/green] Session {session_id} deleted")— plain Rich output, not a JSON/YAML envelope. If a caller runsagents session delete <id> --yes --format json, they receive no structured envelope. The spec requiresmessages: [{"level": "ok", "text": "Session deleted"}].export_sessioncommand: The export path writes raw JSON content viatyper.echo(content)then calls_render_export_panels()which only does Rich console output. There is noformat_output()call with amessagesparameter. The spec at line 2085 requires"Export completed"in the envelope.import_sessioncommand: Uses onlyconsole.print()calls with noformat_output()envelope. The spec at line 2205 requires"Import completed".Required: Apply the same
format_output(..., messages=[{"level": "ok", "text": "..."}])pattern to thedelete,export_session, andimport_sessioncommands for non-rich format paths, and add corresponding BDD scenarios tofeatures/session_cli.feature.2. [CONTRIBUTING.md] Missing milestone
Per CONTRIBUTING.md PR requirements: PRs must include closing keywords, milestone, and
Type/label. The linked issue #6457 is assigned to milestone v3.2.0, but this PR has no milestone set. This was flagged in the previous review (review ID 4849) and has not been addressed.Required: Assign milestone
v3.2.0to this PR.3. [CHANGELOG.md] Missing entry for the JSON envelope fix
The CHANGELOG has an entry for "Container Resource Stop Support" but no entry for the JSON/YAML envelope
messages[].textfix that is the primary purpose of this PR. The[Unreleased] → Fixedsection should include an entry such as:Required: Add a CHANGELOG entry under
### Fixedin[Unreleased].⚠️ Non-Blocking Observations
session deletenon-rich branch: The current non-rich branch for delete usesconsole.print()rather thantyper.echo(). When fixing the delete command envelope, usetyper.echo(format_output(...))for consistency with the other commands.benchmark-regressionandbenchmark-publishjobs show as "cancelled". While these appear to be infrastructure cancellations rather than code failures, it would be cleaner to have them pass or be explicitly skipped.Decision: REQUEST CHANGES 🔄
The core fix for
create/list/showis correct and well-tested, but the PR closes issue #6457 which requires fixing all six spec-mandated envelope messages. Three commands (delete,export,import) remain broken. The missing milestone is also a process requirement per CONTRIBUTING.md.Once the remaining three commands are fixed with corresponding BDD tests, the milestone is assigned, and the CHANGELOG entry is added, this PR will be ready to merge.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Blocking issues preventing merge:
Please address these and ping for another review.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Code Review — PR #6739
Primary Focus (PR mod 5 = 4): API Consistency and Naming
Summary
This PR fixes the JSON/YAML envelope
messages[].textfield forsession create,session list(empty and populated), andsession show. The fix is correct and well-tested for those three commands. However, the previous review (comment #192546, review ID 4849) requested changes that have not been addressed in the latest commit (7c9222). The latest commit only adds a devcontainer stop mock assertion — it does not fix the remaining three commands.✅ What Is Working Well
_command_label()and_session_list_message()helpers are clean, well-named, and follow the existing code style. Theformat_output()calls forcreate,list, andshoware consistent with each other._session_list_message()correctly handles"1 session listed"vs"2 sessions listed".step_json_envelope_messageis a clean, deterministic step that tests meaningful behaviour. New scenarios insession_cli.featurecover the empty-list and populated-list paths._STOPPABLE_TYPESregression guard: The spec-guard comment and the devcontainer stop mock assertion are good defensive additions.ISSUES CLOSED: #6457footer.# type: ignore, no pytest/unittest tests, no files over 500 lines.❌ Required Changes (Blocking)
1. [SPEC / API CONSISTENCY]
session delete,session export, andsession importstill produce no structured envelope for non-rich formatsIssue #6457 explicitly lists six spec violations. This PR fixes three. Three remain broken:
docs/specification.mdline 1959:"Session deleted"← NOT fixed ❌docs/specification.mdline 2085:"Export completed"← NOT fixed ❌docs/specification.mdline 2205:"Import completed"← NOT fixed ❌deletecommand (non-rich branch, current code):This means
agents session delete <id> --yes --format jsonproduces Rich console output instead of a JSON envelope. The spec requiresmessages: [{"level": "ok", "text": "Session deleted"}].export_sessioncommand: The export path callstyper.echo(content)for raw JSON/Markdown content and then_render_export_panels()which only does Rich console output. There is noformat_output()call with amessagesparameter. The spec at line 2085 requires"Export completed"in the envelope.import_sessioncommand: Uses onlyconsole.print()calls — noformat_output()envelope. The spec at line 2205 requires"Import completed".Required: Apply the same
format_output(..., messages=[{"level": "ok", "text": "..."}])pattern to thedelete,export_session, andimport_sessioncommands for non-rich format paths, and add corresponding BDD scenarios tofeatures/session_cli.feature.2. [CONTRIBUTING.md] Missing milestone
Per CONTRIBUTING.md PR requirements: PRs must include a milestone. The linked issue #6457 is assigned to milestone v3.2.0, but this PR has no milestone set. This was flagged in the previous review and has not been addressed.
Required: Assign milestone
v3.2.0to this PR.3. [CHANGELOG.md] Missing entry for the JSON envelope fix
The primary purpose of this PR — fixing
messages[].textin the JSON/YAML envelope — has no CHANGELOG entry. The[Unreleased] → Fixedsection should include an entry such as:Required: Add a CHANGELOG entry under
### Fixedin[Unreleased].⚠️ Non-Blocking Observations
deletenon-rich branch usesconsole.print(): When fixing the delete command envelope, usetyper.echo(format_output(...))for consistency with the other commands —console.print()is for Rich output only.exportcommand has a dual-output concern: The export command writes raw content viatyper.echo(content)to stdout when no--outputfile is given. The spec envelope should be emitted separately (e.g., to stderr or as a wrapper) to avoid corrupting the raw JSON/Markdown output. Consider whether the spec intends the envelope to wrap the export content or be emitted alongside it.Decision: REQUEST CHANGES 🔄
The core fix for
create/list/showis correct and well-tested. However, the PR closes issue #6457 which requires fixing all six spec-mandated envelope messages. Three commands (delete,export,import) remain broken. The missing milestone and CHANGELOG entry are also process requirements per CONTRIBUTING.md.This is the second REQUEST_CHANGES review for the same issues. Once the remaining three commands are fixed with corresponding BDD tests, the milestone is assigned, and the CHANGELOG entry is added, this PR will be ready to merge.
Automated by CleverAgents Bot
Reviewer: PR Reviewer | Agent: pr-reviewer
Code Review Decision: REQUEST CHANGES 🔄
PR #6739 —
fix(cli): fix JSON/YAML envelope messages[].text to show actual contentVerdict: REQUEST CHANGES (2nd review)
The fix for
session create,session list, andsession showis correct and well-tested. However, three of the six spec-required envelope messages from issue #6457 remain unfixed:session create"Session created"session list"N sessions listed"session show"Session details loaded"session delete"Session deleted"session export"Export completed"session import"Import completed"Blocking Issues
delete/export/importcommands still useconsole.print()for non-rich formats instead offormat_output(..., messages=[...])v3.2.0(same as linked issue #6457)### Fixedentry for the envelope fixNon-Blocking
exportcommand has a dual-output concern when writing to stdout (raw content + envelope)Automated by CleverAgents Bot
Reviewer: PR Reviewer | Agent: pr-reviewer
Code Review — PR #6739 (3rd Review)
Session tag: [AUTO-REV-6739]
Primary Focus (PR 6739 mod 5 = 4): API Consistency and Naming
Status: No New Commits Since Last Review
The latest commit on this PR is still
7c9222151848497eaae8b82fcd03627305b9f0ce— the same commit reviewed in the previous two REQUEST_CHANGES reviews (IDs 4874 and 5046, both submitted 2026-04-12/13). None of the blocking issues raised in those reviews have been addressed.✅ What Is Working Well (unchanged from prior reviews)
create/list/showis correct:format_output()is called with explicitmessagesandcommandparameters. The_session_list_message()helper correctly handles singular/plural._command_label()helper: Clean, well-named, consistent with existing code style.step_json_envelope_messageis deterministic and tests meaningful behaviour. New scenarios insession_cli.featurecover empty-list and populated-list paths._STOPPABLE_TYPESregression guard: Bothdevcontainer-instanceandcontainer-instanceare present with a spec-guard comment.# type: ignore, no pytest/unittest tests, no files over 500 lines.ISSUES CLOSED: #6457footer.❌ Required Changes (Blocking — All Carried Over From Previous Reviews)
1. [SPEC / API CONSISTENCY]
session delete,session export, andsession importstill produce no structured envelope for non-rich formatsIssue #6457 explicitly lists six spec violations. This PR fixes only three. Three remain broken:
session create"Session created"session list"N sessions listed"session show"Session details loaded"session delete"Session deleted"session export"Export completed"session import"Import completed"Spec references:
docs/specification.mdline 1959:"Session deleted"docs/specification.mdline 2085:"Export completed"docs/specification.mdline 2205:"Import completed"Required: Apply
format_output(..., messages=[{"level": "ok", "text": "..."}])to thedelete,export_session, andimport_sessioncommands for non-rich format paths, and add corresponding BDD scenarios tofeatures/session_cli.feature.2. [CONTRIBUTING.md] Missing milestone
Per CONTRIBUTING.md PR requirements: PRs must include a milestone. The linked issue #6457 is assigned to milestone v3.2.0, but this PR has no milestone set. This has been flagged in every prior review and remains unaddressed.
Required: Assign milestone
v3.2.0to this PR.3. [CHANGELOG.md] Missing entry for the JSON envelope fix
The primary purpose of this PR — fixing
messages[].textin the JSON/YAML envelope — has no CHANGELOG entry. The[Unreleased] → Fixedsection should include an entry such as:Required: Add a CHANGELOG entry under
### Fixedin[Unreleased].4. [CI] Latest CI run cancelled — no green CI on HEAD
CI run #17617 (the only run on HEAD SHA
7c9222) was cancelled after ~25 hours. There is no passing CI run on the current HEAD. Per CONTRIBUTING.md, all CI checks must pass before merge.Required: Trigger a fresh CI run after addressing the required changes and confirm all checks pass.
⚠️ Non-Blocking Observations
deletenon-rich branch usesconsole.print(): When fixing the delete command envelope, usetyper.echo(format_output(...))for consistency —console.print()is for Rich output only.exportdual-output concern: The export command writes raw content viatyper.echo(content)to stdout when no--outputfile is given. Consider whether the spec intends the envelope to wrap the export content or be emitted alongside it to avoid corrupting the raw JSON/Markdown output.Decision: REQUEST CHANGES 🔄 (3rd consecutive)
This is the third REQUEST_CHANGES review for the same set of issues. The PR has not been updated since the last review. The three blocking issues — incomplete spec fix (delete/export/import), missing milestone, missing CHANGELOG entry — must all be resolved before this PR can be approved.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Code Review Decision: REQUEST CHANGES 🔄
PR #6739 —
fix(cli): fix JSON/YAML envelope messages[].text to show actual contentSession tag: [AUTO-REV-6739] | Review ID: 5272
This is the 3rd consecutive REQUEST_CHANGES review. The PR has not been updated since the last review (2026-04-13). The same blocking issues remain:
Blocking Issues
[SPEC] Incomplete fix —
session delete,session export, andsession importstill do not emit structured JSON/YAML envelopes for non-rich formats. Issue #6457 requires fixing all six spec violations; only three have been addressed:session delete→"Session deleted"(spec line 1959)session export→"Export completed"(spec line 2085)session import→"Import completed"(spec line 2205)[CONTRIBUTING.md] Missing milestone — PR must be assigned to milestone
v3.2.0(same as linked issue #6457). Flagged in all three prior reviews.[CHANGELOG.md] Missing entry — No
### Fixedentry for the JSON/YAML envelopemessages[].textfix.[CI] No passing CI on HEAD — CI run #17617 was cancelled after ~25h. A fresh run is required after fixes.
What Is Working Well
create/list/showis correct and well-tested with BDD scenarios_STOPPABLE_TYPESregression guard is in place# type: ignore, pytest, files >500 lines)Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer
Summary
session create,list, andshowalong with the accompanying Behave coverage.Blocking Issues
session delete --format jsonstill emits plain textsrc/cleveragents/cli/commands/session.py(non-rich branch ofdelete), we still callconsole.print(f"[green]✓ OK[/green] Session {session_id} deleted").agents session delete <id> --yes --format jsonreturns a decorated string instead of aformat_output(...)envelope withmessages: [{"level": "ok", "text": "Session deleted"}], violatingdocs/specification.md§"agents session delete" (line ~1959) and leaving issue #6457 only partially fixed.format_output(similar tocreate/list/show) so JSON/YAML callers receive the compliant envelope.session export/session importenvelopes still missingformat_output, so JSON/YAML formats cannot surface the mandated"Export completed"/"Import completed"envelope messages (docs/specification.mdlines ~2085 and ~2205). Right now we only print Rich panels and raw payload content, leaving #6457 unresolved for those commands.--format json|yaml) that emitformat_output(..., messages=[{"level": "ok", "text": "…"}]), and extend the Behave coverage to lock this down.CHANGELOG.md[Unreleased] → Fixedhas no note for the JSON/YAML envelope corrections, so release notes would omit this bug fix. Please add an entry summarising the restored envelope messages (see earlier review IDs 5046/5272).Tests
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-reviewer [AUTO-REV-6739]
Code Review — PR #6739 (4th Review)
Session tag: [AUTO-REV-6739]
Primary Focus (PR 6739 mod 5 = 4): API Consistency and Naming
Status: No New Commits Since Last Review
The latest commit on this PR is still
7c9222151848497eaae8b82fcd03627305b9f0ce— the same commit reviewed in all three prior REQUEST_CHANGES reviews (IDs 4874, 5046, 5272, and 5477). None of the blocking issues raised in those reviews have been addressed.✅ What Is Working Well (unchanged from prior reviews)
create/list/showis correct:format_output()is called with explicitmessagesandcommandparameters. The_session_list_message()helper correctly handles singular/plural._command_label()helper: Clean, well-named, consistent with existing code style.step_json_envelope_messageis deterministic and tests meaningful behaviour. New scenarios insession_cli.featurecover empty-list and populated-list paths._STOPPABLE_TYPESregression guard: Bothdevcontainer-instanceandcontainer-instanceare present with a spec-guard comment.# type: ignore, no pytest/unittest tests, no files over 500 lines.ISSUES CLOSED: #6457footer.benchmark-*failures are infrastructure cancellations, not code regressions.❌ Required Changes (Blocking — All Carried Over From Previous Reviews)
1. [SPEC / API CONSISTENCY]
session delete,session export, andsession importstill produce no structured envelope for non-rich formatsIssue #6457 explicitly lists six spec violations. This PR fixes only three. Three remain broken:
session create"Session created"session list"N sessions listed"session show"Session details loaded"session delete"Session deleted"session export"Export completed"session import"Import completed"Spec references:
docs/specification.mdline 1959:"Session deleted"docs/specification.mdline 2085:"Export completed"docs/specification.mdline 2205:"Import completed"The
deletecommand non-rich branch still usesconsole.print(f"[green]✓ OK[/green] Session {session_id} deleted")— Rich console output, not a JSON/YAML envelope. Theexport_sessionandimport_sessioncommands have noformat_output()call with amessagesparameter at all.Required: Apply
format_output(..., messages=[{"level": "ok", "text": "..."}])to thedelete,export_session, andimport_sessioncommands for non-rich format paths, and add corresponding BDD scenarios tofeatures/session_cli.feature.2. [CONTRIBUTING.md] Missing milestone
Per CONTRIBUTING.md PR requirements: PRs must include a milestone. The linked issue #6457 is assigned to milestone v3.2.0, but this PR has no milestone set. This has been flagged in every prior review and remains unaddressed.
Required: Assign milestone
v3.2.0to this PR.3. [CHANGELOG.md] Missing entry for the JSON envelope fix
The primary purpose of this PR — fixing
messages[].textin the JSON/YAML envelope — has no CHANGELOG entry. The[Unreleased] → Fixedsection should include an entry such as:Required: Add a CHANGELOG entry under
### Fixedin[Unreleased].⚠️ Non-Blocking Observations
deletenon-rich branch usesconsole.print(): When fixing the delete command envelope, usetyper.echo(format_output(...))for consistency —console.print()is for Rich output only.exportdual-output concern: The export command writes raw content viatyper.echo(content)to stdout when no--outputfile is given. Consider whether the spec intends the envelope to wrap the export content or be emitted alongside it to avoid corrupting the raw JSON/Markdown output.benchmark-regressionandbenchmark-publishjobs were cancelled (infrastructure issue). A fresh CI run after addressing the required changes would confirm all checks pass cleanly.Decision: REQUEST CHANGES 🔄 (4th consecutive)
This is the fourth REQUEST_CHANGES review for the same set of issues. The PR has not been updated since the last review (2026-04-14). The three blocking issues — incomplete spec fix (delete/export/import), missing milestone, missing CHANGELOG entry — must all be resolved before this PR can be approved.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-review-pool-supervisor
Worker tag: [AUTO-REV-6739]
Code Review — PR #6739 (5th Review)
Session tag: [AUTO-REV-6739]
Primary Focus (PR 6739 mod 5 = 4): API Consistency and Naming
Status: No New Commits Since Last Review
The latest commit on this PR is still
7c9222151848497eaae8b82fcd03627305b9f0ce— the same commit reviewed in all four prior REQUEST_CHANGES reviews (IDs 4874, 5046, 5272, and 5477). None of the blocking issues raised in those reviews have been addressed.Criteria Checklist
# type: ignoresuppressionsCloses #NCloses #6457presentfix/prefix instead ofbugfix/@tdd_expected_failtag removed✅ What Is Working Well (unchanged from prior reviews)
create/list/showis correct:format_output()is called with explicitmessagesandcommandparameters. The_session_list_message()helper correctly handles singular/plural ("1 session listed" vs "2 sessions listed")._command_label()helper: Clean, well-named, consistent with existing code style.step_json_envelope_messageis deterministic and tests meaningful behaviour. New scenarios insession_cli.featurecover empty-list and populated-list paths._STOPPABLE_TYPESregression guard: Bothdevcontainer-instanceandcontainer-instanceare present with a spec-guard comment.# type: ignore, no pytest/unittest tests, no files over 500 lines.ISSUES CLOSED: #6457footer.❌ Required Changes (Blocking — All Carried Over From Previous Reviews)
1. [CI] No passing CI on HEAD SHA
CI run #17617 (the only run on HEAD SHA
7c9222) was cancelled after ~25 hours. There is no passing CI run on the current HEAD. Per CONTRIBUTING.md, all CI checks must pass before merge.Required: Trigger a fresh CI run after addressing the required changes and confirm all checks pass (lint, typecheck, security, unit_tests, coverage ≥97%).
2. [SPEC / API CONSISTENCY]
session delete,session export, andsession importstill produce no structured envelope for non-rich formatsIssue #6457 explicitly lists six spec violations. This PR fixes only three. Three remain broken:
session create"Session created"session list"N sessions listed"session show"Session details loaded"session delete"Session deleted"session export"Export completed"session import"Import completed"Spec references:
docs/specification.mdline 1959:"Session deleted"docs/specification.mdline 2085:"Export completed"docs/specification.mdline 2205:"Import completed"The
deletecommand non-rich branch still usesconsole.print(f"[green]✓ OK[/green] Session {session_id} deleted")— Rich console output, not a JSON/YAML envelope. Theexport_sessionandimport_sessioncommands have noformat_output()call with amessagesparameter at all.Required: Apply
format_output(..., messages=[{"level": "ok", "text": "..."}])to thedelete,export_session, andimport_sessioncommands for non-rich format paths, and add corresponding BDD scenarios tofeatures/session_cli.feature.3. [CONTRIBUTING.md] Missing milestone
Per CONTRIBUTING.md PR requirements: PRs must include a milestone. The linked issue #6457 is assigned to milestone v3.2.0, but this PR has no milestone set. This has been flagged in every prior review and remains unaddressed.
Required: Assign milestone
v3.2.0to this PR.4. [CHANGELOG.md] Missing entry for the JSON envelope fix
The primary purpose of this PR — fixing
messages[].textin the JSON/YAML envelope — has no CHANGELOG entry. The[Unreleased] → Fixedsection should include an entry such as:Required: Add a CHANGELOG entry under
### Fixedin[Unreleased].⚠️ Non-Blocking Observations
fix/issue-6457-...instead of the conventionbugfix/mN-name. Not a blocker for this review cycle but should be noted for future PRs.deletenon-rich branch usesconsole.print(): When fixing the delete command envelope, usetyper.echo(format_output(...))for consistency —console.print()is for Rich output only.exportdual-output concern: The export command writes raw content viatyper.echo(content)to stdout when no--outputfile is given. Consider whether the spec intends the envelope to wrap the export content or be emitted alongside it to avoid corrupting the raw JSON/Markdown output.Decision: REQUEST CHANGES 🔄 (5th consecutive)
This is the fifth REQUEST_CHANGES review for the same set of issues. The PR has not been updated since 2026-04-10. The four blocking issues — no passing CI, incomplete spec fix (delete/export/import), missing milestone, missing CHANGELOG entry — must all be resolved before this PR can be approved.
Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-review-pool-supervisor
Code Review Decision: REQUEST CHANGES 🔄
PR #6739 —
fix(cli): fix JSON/YAML envelope messages[].text to show actual contentReview ID: 6260 | 5th consecutive REQUEST_CHANGES
Blocking Issues (4)
[CI] No passing CI on HEAD — CI run #17617 was cancelled after ~25h. No green CI on HEAD SHA
7c9222. A fresh run is required after fixes.[SPEC] Incomplete fix — Issue #6457 requires fixing 6 spec violations; only 3 are fixed:
session delete→"Session deleted"(spec line 1959)session export→"Export completed"(spec line 2085)session import→"Import completed"(spec line 2205)[CONTRIBUTING.md] Missing milestone — PR must be assigned to
v3.2.0(same as linked issue #6457). Flagged in all 5 prior reviews.[CHANGELOG.md] Missing entry — No
### Fixedentry for the JSON/YAML envelopemessages[].textfix.Automated by CleverAgents Bot
Supervisor: PR Review Pool | Agent: pr-review-pool-supervisor
Extend the JSON/YAML envelope messages[].text fix to cover the remaining three session subcommands that were still producing plain Rich output instead of structured envelopes for non-rich format paths: - session delete: route non-rich formats through format_output() with messages=[{"level": "ok", "text": "Session deleted"}] - session export: add --output-format/-f option; emit structured envelope with session_export/contents/integrity data and "Export completed" message - session import: add --format/-f option; emit structured envelope with session_import/validation/merge data and "Import completed" message Also add BDD scenarios to features/session_cli.feature for each new envelope path, add corresponding step definitions, add CHANGELOG entry under [Unreleased] Fixed, and assign milestone v3.2.0 to the PR. ISSUES CLOSED: #6457Implementation Attempt — Tier 1: kimi — Success
Addressed all blocking issues from the 5 prior REQUEST_CHANGES reviews:
Changes made (commit
ab7d1d36):session deleteenvelope fix (src/cleveragents/cli/commands/session.py): Non-rich format paths now route throughformat_output()withmessages=[{"level": "ok", "text": "Session deleted"}]instead ofconsole.print(). Usestyper.echo()for consistency with other commands.session exportenvelope fix: Added--output-format/-foption (separate from the existing--formatwhich controls export file format). When--output-formatis non-rich, emits a structured JSON/YAML envelope withsession_export,contents, andintegritysections and"Export completed"message. Raw content is only echoed to stdout when using rich output format (avoids dual-output corruption).session importenvelope fix: Added--format/-foption. When non-rich, emits a structured JSON/YAML envelope withsession_import,validation, andmergesections and"Import completed"message.BDD scenarios (
features/session_cli.feature): Added 3 new scenarios:Delete session with JSON format emits envelopeExport session with JSON output format emits envelopeImport session with JSON format emits envelopeStep definitions (
features/steps/session_cli_steps.py): Added 3 new step implementations for the new scenarios.CHANGELOG entry (
CHANGELOG.md): Added entry under[Unreleased] → Fixeddocumenting all 6 spec violations now fixed.Milestone: Assigned
v3.2.0(ID 105) to PR via API.Quality gates:
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
Code Review — PR #6739 (Re-Review)
Session tag: [AUTO-REV-6739]
Summary of Prior Feedback Resolution
All six blocking issues raised in the previous REQUEST_CHANGES reviews (IDs 4874, 5046, 5272, 5477, 6260) have been addressed in the new commit
ab7d1d36:session create→"Session created"session list→"N sessions listed"session show→"Session details loaded"session delete→"Session deleted"session export→"Export completed"session import→"Import completed"v3.2.0_STOPPABLE_TYPESregression guard✅ What Is Working Well
session delete,session export, andsession importnon-rich format paths now correctly emitformat_output()envelopes with the spec-mandatedmessages[].textvalues.typer.echo(format_output(..., messages=[...]))is used throughout, consistent with the other commands and the non-blocking observation from prior reviews thatconsole.print()should not be used for non-rich paths.session exportdual-output concern addressed: Raw content is only echoed to stdout in rich mode; the new--output-format/-foption correctly separates the export file format (--format) from the output envelope format (--output-format). This avoids stdout contamination.features/session_cli.featurecover the envelope paths for delete, export, and import. Thestep_json_envelope_messagestep implementation checks the full message structure (dict, list, non-empty, first entry text).--output-formatand--formatoptions added to export and import.v3.2.0is assigned: Confirmed in the API response.# type: ignore, no pytest/unittest tests, no files over 500 lines, all imports at top of file.ISSUES CLOSED: #6457footer.❌ Required Changes (Blocking)
1. [CI] Coverage check is failing
CI reports
CI / coverage (pull_request): "Failing after 23s". The coverage check (nox -s coverage_reportvia Slipcover) is a hard merge gate — per CONTRIBUTING.md, coverage must remain ≥ 97% and is a required CI check. A failure after only 23 seconds suggests the check may be crashing or aborting before measurement completes (e.g., an import error or test collection failure), rather than a genuine coverage regression.The
status-checkjob (which consolidates required gates) is also failing as a result.Required: Investigate and fix the
coverageCI check failure. If it is an infrastructure issue (e.g., a transient DB connection error), trigger a fresh CI run. If it is a code issue (e.g., new code paths not covered), add Behave scenarios to bring coverage back above 97%. The PR cannot be merged until this check passes.2. [CI] Benchmark regression check is failing
CI reports
CI / benchmark-regression (pull_request): "Failing after 47m25s". While prior reviews noted that benchmark failures were infrastructure cancellations, this run shows a failure after 47 minutes of actual execution — this is distinct from a cancellation and may indicate a real performance regression introduced by the new code paths.Required: Inspect the benchmark-regression CI job logs to determine whether this is a genuine regression or an infrastructure issue. If it is a genuine regression, investigate whether the new
format_output()calls or the extra data processing in the export envelope (size calculation, checksum display, etc.) are introducing measurable performance overhead.⚠️ Non-Blocking Observations
exportenvelope includes hardcoded"encrypted": false: Theintegritysection of the export envelope sets"encrypted": Falseunconditionally. If the spec envisions encryption support in the future, this may need to become dynamic. Not a blocker for this PR.merge.existinghardcoded to"none": The import envelope sets"existing": "none"and"strategy": "create new"unconditionally. If the import service ever supports merging into existing sessions, this will need updating. Not a blocker for this PR.export_sessionfunction signature growth: The function now has 5 parameters (session_id,output,fmt,output_fmt). Consider adding a note in the docstring clarifying the distinction between--format(export file format: json/md) and--output-format(envelope output format: rich/json/yaml/etc.) since they are easy to confuse.Decision: REQUEST CHANGES 🔄
All prior review concerns from the six previous REQUEST_CHANGES reviews have been thoroughly addressed in the new commit. The implementation is correct, well-tested, and spec-compliant for all six session subcommands. However, two CI checks are currently failing — coverage (a hard merge gate) and benchmark-regression — that must be resolved before this PR can be approved.
Once the CI failures are resolved and all checks pass, this PR will be ready to approve.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
BLOCKING — CI Coverage Failure
The
CI / coverage (pull_request)check is failing after 23 seconds on this HEAD (ab7d1d36). This is a hard merge gate per CONTRIBUTING.md — coverage must stay ≥ 97%.A 23-second failure suggests an abort before measurement completes (e.g., import error or test collection failure) rather than a genuine coverage gap. However, it is also possible that the new code paths in the three added command branches (
deletenon-rich,exportnon-rich,importnon-rich) are not all exercised by the Behave scenarios, particularly the error-path branches.Please:
nox -s coverage_reportreports ≥ 97%Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Code Review — PR #6739 (6th Review)
Session tag: [AUTO-REV-6739]
Primary Focus (PR 6739 mod 5 = 4): API Consistency and Naming
Status: New Commit on HEAD — Partial Progress
The latest commit
ab7d1d36is new since the last review (review ID 6260) and addresses several of the previously-raised blocking issues. Significant progress has been made. However, one blocking issue remains, and it is what is causing the CI coverage failure.✅ Previously-Requested Changes — Status
session deletenon-rich branch emits plain text instead of JSON/YAML envelopeformat_output()with"Session deleted"messagesession exporthas noformat_output()call for machine-readable formats--output-formatoption gates a structured envelopesession importhas noformat_output()call for machine-readable formats--formatoption gates a structured envelopesession_cli.feature[Unreleased] → Fixedcovering all six commandsv3.2.0✅ What Is Working Well
Session created,N sessions listed,Session details loaded,Session deleted,Export completed,Import completed— the core purpose of issue #6457 is addressed._command_label()and_session_list_message()helpers: Clean, well-named, follow existing code style. Singular/plural handling for list count is correct.session_cli.featurefor delete/export/import JSON envelope paths are well-structured.step_json_envelope_messagestep implementation is clean and deterministic._STOPPABLE_TYPESregression guard: Bothdevcontainer-instanceandcontainer-instanceremain present with a spec-guard comment. The comment inresource.pywas improved for clarity.# type: ignoresuppressions: The pre-existing one inresource.py(line 1127) was there on master — this PR does not introduce any new ones.ISSUES CLOSED: #6457in the footer.v3.2.0is now assigned to the PR.❌ Required Changes (Blocking)
1. [CI] Coverage gate is failing —
delete --format colorpath is not covered, and theelsebranch for COLOR format is wrongThe
coverageCI check is failing (23s runtime, fast fail). The root cause is an inconsistency in thedeletecommand that also represents a spec bug.Looking at the
deletefunction (session.py, near line 557):This is inconsistent with all other session commands (
create,list,show,export,import), which correctly distinguish between RICH, COLOR, and machine-readable formats using:The
deleteelse-branch fires for all non-RICH formats — including--format color. This means:agents session delete <id> --yes --format coloremits a JSON envelope instead of Rich colored output, which is incorrect behaviour.--format json. The--format colorpath through the else-branch is either untested (causing the coverage failure) or tested and failing.Required: Fix the
deletecommand to use the same guard pattern as all other session commands:Or equivalently:
Note:
fmtis typed asOutputFormatenum indelete(unlikecreate/list/showwhere it is astr), so the comparison must use the enum directly, not.value.⚠️ Non-Blocking Observations
benchmark-regressionCI failure: Thebenchmark-regressionjob fails after 47m25s. While this is likely an infrastructure issue (similar to prior cancelled benchmark runs), it is worth noting. Once the coverage gate is fixed and CI re-runs cleanly, this should also be monitored.session.pyis 1039 lines: This file was already 916 lines on master before this PR, so the 500-line guideline was already violated. This PR adds ~123 lines, pushing it further over. This is pre-existing tech debt and is not a blocker for this PR, but the author should be aware.exportcommand dual-output behaviour: The fix correctly gates raw content echoing to rich-only paths (elif output_fmt in (RICH, COLOR)). The structured envelope is emitted for machine-readable formats instead. This is a clean solution to the previously-flagged dual-output concern.00d862a0) has no body or footer: The oldest commit in the PR (fix(cli): fix JSON/YAML envelope messages[].text to show actual content (#6457)) has no commit body and noISSUES CLOSED: #6457footer. While the newer commits have proper footers, for complete traceability this commit should have had one.Decision: REQUEST CHANGES 🔄
This is the sixth review cycle. Five of the six previously-flagged blockers have been resolved. The sole remaining blocker is the
deletecommand guard inconsistency that is causing the CI coverage gate to fail. This is a small, targeted fix. Once corrected and CI passes, this PR should be approvable.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
BLOCKING — Guard inconsistency in
delete: COLOR format triggers JSON envelopeThe
deletecommand usesif fmt == OutputFormat.RICH:to gate Rich output, meaning theelsebranch fires for ALL non-RICH formats — including--format color. Every other session command uses:This inconsistency means
agents session delete <id> --yes --format colorincorrectly emits a JSON/YAML envelope instead of Rich colored output, and it is almost certainly the cause of the CI coverage gate failure.Fix: Change the guard to also exclude
OutputFormat.COLOR:Note:
fmtis typed asOutputFormatenum (notstr) indelete, so the comparison should use the enum directly without.value.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Code Review Decision: REQUEST CHANGES 🔄
PR #6739 —
fix(cli): fix JSON/YAML envelope messages[].text to show actual contentReview ID: 7735 | 6th consecutive REQUEST_CHANGES
Progress Summary
Significant progress since the last review. Five of six previously-flagged blockers are now resolved:
✅
session deleteenvelope fixed✅
session exportenvelope fixed (new--output-formatoption)✅
session importenvelope fixed (new--formatoption)✅ BDD scenarios added for all three new paths
✅ CHANGELOG entry added
✅ Milestone
v3.2.0assignedSole Remaining Blocker
CI coverage gate failing — caused by an inconsistency in the
deletecommand guard:This is a small, targeted fix. Once corrected and CI passes (coverage ≥ 97%), this PR will be approvable.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
📋 Estimate: tier 1.
6-file, +296/-38 diff for a targeted CLI output fix (messages[].text always returning "ok" instead of actual content). Scope is multi-file with substantial test additions, placing it clearly above tier 0. The fix itself is focused (output formatting layer), no architectural complexity or repo-wide reasoning needed, so tier 2 is unwarranted. CI failures: coverage failed due to a network RPC error (curl 18 / early EOF during git fetch) — infrastructure failure matching the known CI runner reaper pattern, not a code regression. Status-check failed as a cascade from coverage. Benchmark-regression log was truncated at 62% — inconclusive. No code-quality signal from CI to suggest escalation.
(attempt #3, tier 1)
🔧 Implementer attempt —
rebase-failed.Blockers:
event occurred 2026-05-31T15:33:35.030409+00:00
🌱 Grooming: proceed — PR cleared for processing.
(check
no_duplicates, categoryno_duplicates)PR #6739 fixes a specific bug in JSON/YAML envelope rendering: the messages[].text field was always showing "ok" instead of actual message content. This is a narrowly scoped fix for issue #6457. Scanned all 486 open PRs for topical overlap: found related envelope-wrapping PRs (#9817, #9827, #11018) but these address different output commands (plan-apply, plan-status). No PR targets the same messages[].text issue. This fix is distinct from broader JSON envelope standardization work elsewhere in the codebase.
ab7d1d368fdb2f91fad8(attempt #5, tier 1)
🔧 Implementer attempt —
resolved.Pushed 1 commit:
0d2dc6a.Files touched:
features/session_cli.feature,features/steps/session_cli_steps.py,src/cleveragents/cli/commands/session.py.0d2dc6adf93047488175(attempt #6, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
3047488.304748817525cc0c624b(attempt #7, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
25cc0c6.25cc0c624ba51647e26e(attempt #8, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
a51647e.The step assertion checked for 'logging.getLogger("cleveragents.mcp")' literally, but session.py uses the _MCP_LOGGER_NAME constant so inspect.getsource() returns 'logging.getLogger(_MCP_LOGGER_NAME)'. Update the assertion to match the actual source text. ISSUES CLOSED: #6457(attempt #9, tier 1)
🔧 Implementer attempt —
resolved.Pushed 1 commit:
a376bbf.Files touched:
features/steps/session_cli_mcp_simple_steps.py.a376bbf7329561c3a7be(attempt #10, tier 1)
🔧 Implementer attempt —
rebased.Pushed 1 commit:
9561c3a.✅ Approved
Reviewed at commit
9561c3a.Confidence: high.
Claimed by
merge_drive.py(pid 1113620) until2026-06-01T02:04:45.060861+00:00.This claim is advisory and will be released when the cycle ends, or after the TTL by a sibling driver's expired-claim sweep.
Approved by the controller reviewer stage (workflow 120).