Skip to content

fix(cli): route all session subcommands through one Typer group#449

Open
Prateeks16 wants to merge 1 commit into
sreerevanth:mainfrom
Prateeks16:fix/session-command-routing
Open

fix(cli): route all session subcommands through one Typer group#449
Prateeks16 wants to merge 1 commit into
sreerevanth:mainfrom
Prateeks16:fix/session-command-routing

Conversation

@Prateeks16

Copy link
Copy Markdown
Contributor

Problem

agentwatch session export and session list fail on main with No such command 'export', breaking 10 tests in test_cli_api_key.py and test_cli_export.py.

Root cause: cli/main.py defines session_app three times and adds each to app under the name "session":

  1. an empty group near the app definition,
  2. the real group carrying watch/replay/list/export/score,
  3. a third reassignment near the rollback/prune commands.

The group resolves to the last (partial) one, so the export/list subcommands aren't found.

Fix

  • Remove the empty duplicate and the trailing reassignment, so rollback/prune attach to the same single session_app as everything else.
  • test_export_invalid_format read result.stderr (not separately captured by this Click version) → use result.output.

Verification

pytest tests/                # 509 passed, 0 failed
ruff check / format --check  # clean

This is the shared main breakage currently failing CI on every open PR cut from main (#411, #443, #445). Merging this unblocks all of them — they go green on rebase with no further changes.

`session_app` was defined three times in cli/main.py: an empty group near the
app definition, the real group carrying watch/replay/list/export/score, and a
third reassignment near the rollback/prune commands. Each was added to `app`
under the name "session", so the command group resolved to the last (partial)
one and `agentwatch session export` / `session list` failed with
"No such command 'export'".

Remove the empty duplicate and the trailing reassignment so rollback/prune
attach to the same single `session_app` as the rest. Also fix
test_export_invalid_format, which read result.stderr (not separately captured
by this Click version) — use result.output.

Fixes the 10 failing tests in test_cli_api_key.py and test_cli_export.py.
Copilot AI review requested due to automatic review settings June 20, 2026 18:45

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Prateeks16, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 35 minutes and 38 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f0d0e22-fbb2-450f-acab-d6a7b0e05a23

📥 Commits

Reviewing files that changed from the base of the PR and between 7f01274 and 4ff98fc.

📒 Files selected for processing (2)
  • agentwatch/cli/main.py
  • tests/test_cli_export.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions

Copy link
Copy Markdown

🧪 PR Test Results

Check Result
Tests (pytest tests/) ✅ success
Lint (ruff check .) ❌ failure
Coverage (agentwatch) 73.50%

Python 3.12 · commit 4ff98fc

@Prateeks16

Copy link
Copy Markdown
Contributor Author

@sreerevanth could we prioritize merging this one? It fixes a bug already on main (three session_app Typer groups → session export/list resolve to the wrong group → No such command 'export'), which is currently failing the same 10 test_cli_api_key / test_cli_export checks on every open PR branched from main — #411, #443, #445, #450.

None of those PRs touch that code; they just inherit the breakage. Merging this turns their CI green on rebase with no further changes. This PR is self-contained (2 files) and green on its own.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants