Skip to content

fix(cli): accept reordered agent report arguments - #2928

Open
akbash-bot wants to merge 1 commit into
masterfrom
akbash/2926-report-agent-args
Open

fix(cli): accept reordered agent report arguments#2928
akbash-bot wants to merge 1 commit into
masterfrom
akbash/2926-report-agent-args

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Issue

An integration that follows pane report-agent or pane report-agent-session help and places the pane ID after the options gets rejected, so the report never reaches the pane. The equivalent pane-first command works.

Problem

CLI help and completions describe normal order-independent options, but these two commands separately assumed the first argument was always the pane ID. An options-first call therefore treated --source as the pane and rejected its value as an unknown option; the same parsers also did not understand --option=value.

How did we fix it?

Both agent-report commands now extend the existing flexible pane-argument mechanism: they accept one pane ID anywhere among their options and normalize valued --option=value arguments before sending the existing request. This is limited to command-line parsing; pane state ownership, report authority, server behavior, and the existing empty success output are unchanged.

Verification

Before the change, both help-ordered commands exited 2 with unknown option: test:akbash and left the disposable session's agent list empty. After the change, the same commands exited 0, and the state report changed the target pane to working; an equals-form report with an embedded = value also exited 0 and changed it to blocked.

just test-one pane_agent_reports_accept_options_before_pane passes. Formatting, native and Windows Clippy, 98 maintenance tests, integration assets, marketplace tests, and 3,470 other Rust tests pass. The unrelated pre-existing live_server_holds_one_pty_master_fd_per_pane test could not find its replacement process in this VPS environment and failed again in isolation.

refs #2926

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pane reporting commands now accept pane IDs after options, support --option=value syntax, reject extra positional arguments, and show usage when the pane ID is missing. End-to-end coverage verifies agent and session reporting.

Changes

Pane report argument parsing

Layer / File(s) Summary
Update pane report parsers
src/cli/pane.rs
pane report-agent and pane report-agent-session accept reordered pane IDs, expand equals-style options, reject extra positional arguments, and show usage when the pane ID is missing.
Validate and document parsing
tests/cli/panes.rs, docs/next/CHANGELOG.md
The end-to-end test covers options before pane IDs and verifies stored agent state. The changelog documents the accepted argument forms.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to 9d309

The commands now accept pane IDs after options, but their usage text still shows the older pane-first form, which could confuse users and integrations. The PR is mergeable with owner awareness or a follow-up to align the help text and changelog.

Possibly related issues

Possibly related PRs

  • herdrdev/herdr#2183 — Modifies the same CLI implementation for related pane argument parsing behavior.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: accepting reordered arguments for agent report commands.
Description check ✅ Passed The description directly explains the argument parsing issue, the implemented fix, and its verification.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akbash/2926-report-agent-args

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ec399cc-948c-4018-a316-1219932c29d3

📥 Commits

Reviewing files that changed from the base of the PR and between 2d24950 and 9d30965.

📒 Files selected for processing (3)
  • docs/next/CHANGELOG.md
  • src/cli/pane.rs
  • tests/cli/panes.rs

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.

Comment thread src/cli/pane.rs
@ogulcancelik

Copy link
Copy Markdown
Collaborator

@akbash-bot the implementation review is clean. please rebase onto current master, resolve the changelog conflict, and rerun checks and both review bots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants