Skip to content

Port bin to argh so we get help text#1

Merged
Pajn merged 3 commits intomainfrom
cmd-help
Mar 21, 2026
Merged

Port bin to argh so we get help text#1
Pajn merged 3 commits intomainfrom
cmd-help

Conversation

@Pajn
Copy link
Copy Markdown
Owner

@Pajn Pajn commented Mar 18, 2026

Summary by CodeRabbit

  • New Features

    • Redesigned command-line interface with structured subcommands, UI mode, and clearer top-level and nested help output.
  • Bug Fixes

    • Stronger CLI validation: rejects conflicting flags and enforces valid values for statusline install/uninstall.
    • Improved handling of unknown or malformed commands with proper early exits.
  • Tests

    • Expanded coverage for help output, nested subcommands, unknown-command rejection, top-level behavior, and statusline flag validation.
  • Chores

    • Added CLI parsing dependency; updated Rust toolchain config and CI to stable (includes tmux install).

Stack

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Replaces manual argv parsing with an argh-based CLI in the main binary, adds typed CLI/command structs and validation/dispatch helpers for statusline subcommands, updates smoke tests for new help/exit behavior, adds argh dependency, and adjusts CI/toolchain (tmux install, toolchain changes).

Changes

Cohort / File(s) Summary
CLI Dependency
crates/wisp-bin/Cargo.toml
Added argh = "0.1" to [dependencies].
Main CLI Implementation
crates/wisp-bin/src/main.rs
Replaced ad-hoc argv parsing with argh-driven Cli/Command types and UiMode; added parse_cli/parse_cli_args, execute_cli, load_runtime_config, validation helper validate_statusline_flags, run_statusline_group, and aliased Command import to ProcessCommand for subprocess usage.
Tests — smoke
crates/wisp-bin/tests/smoke.rs
Updated/added smoke tests: no-args top-level help, --help coverage, nested statusline/status-line help, unknown-command rejection, restored doctor runtime assertions, and adjusted failure diagnostics.
CI & Toolchain
.github/workflows/ci.yml, Cargo.toml, rust-toolchain.toml
CI now uses dtolnay/rust-toolchain@stable, installs tmux and starts a detached session; workspace rust-version bumped from 1.851.90; added rust-toolchain.toml with channel = "stable".

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Parser as "argh Parser"
    participant Dispatcher as "execute_cli()"
    participant Handler as "Command Handler"
    participant Runtime as "Config/Runtime"

    User->>Parser: invoke binary with argv
    Parser->>Dispatcher: return Cli/Command
    Dispatcher->>Runtime: load_runtime_config()
    Dispatcher->>Handler: dispatch to specific handler
    Handler->>Runtime: request config / status data
    Runtime-->>Handler: config / data
    Handler-->>User: output / render / error
Loading

Estimated Code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐇 I nibbled args beneath the log,

Argh hopped in and cleared the fog,
Subcommands pranced in tidy rows,
Flags were checked and errors froze,
A little rabbit cheers — the CLI grows!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.04% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: porting the binary CLI from manual argument parsing to the argh library to enable automatic help text generation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/wisp-bin/src/main.rs`:
- Around line 391-415: Reject a parsed --line value of 0 before calling tmux by
validating the Option<usize> in run_statusline_group: in the
StatuslineSubcommand::Install(args) and ::Uninstall(args) branches check if
args.line == Some(0) and return an Err with a clear message (e.g. "statusline
line must be >= 1") instead of proceeding; this prevents invalid 0 rows from
being dispatched to install_statusline or uninstall_statusline.
- Around line 346-349: The Statusline branch currently loads config before
checking mutually-exclusive CLI flags, so move or duplicate the flag validation
to run before load_runtime_config in the Command::Statusline(statusline) arm:
perform the same mutual-exclusion check that run_statusline_group() enforces
(e.g. extract or call a helper like validate_statusline_flags(statusline) or
check_conflicting_statusline_flags(statusline)) and return an appropriate CLI
error if flags conflict, then call load_runtime_config() and
run_statusline_group(&config, statusline) only after validation succeeds.

In `@crates/wisp-bin/tests/smoke.rs`:
- Around line 48-61: The new smoke test only exercises the "statusline" command
but not the backwards-compatibility rewrite in parse_cli() for the "status-line"
alias, so add a parallel test that runs the binary with args ["status-line",
"--help"] (similar to the existing statusline_help_lists_nested_subcommands
test) and asserts the process succeeds and its stdout contains the same key
substrings ("Usage:", "install", "render", "uninstall"); locate the test
function statusline_help_lists_nested_subcommands and duplicate its logic in a
new test (e.g., status_line_help_lists_nested_subcommands) to ensure
parse_cli()'s rewrite branch is covered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 28a9d9dc-be8e-4550-af20-85c785d65fc6

📥 Commits

Reviewing files that changed from the base of the PR and between 62fb4d1 and 78e3d2f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • crates/wisp-bin/Cargo.toml
  • crates/wisp-bin/src/main.rs
  • crates/wisp-bin/tests/smoke.rs

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/wisp-bin/src/main.rs`:
- Around line 346-349: The CLI currently validates only render flags and still
calls load_runtime_config() for Command::Statusline before rejecting invalid
--line values, which lets a broken config mask CLI errors; update the
Command::Statusline handling so validate_statusline_flags(&statusline) (or a
more specific pre-config validation for install/uninstall subcommands) runs and
returns an error for invalid --line values before any call to
load_runtime_config(), and apply the same change to the other statusline
handling branch (the run_statusline_group(...) calls around the other block) so
install/uninstall validation is performed and exits early on invalid line
numbers.
- Around line 263-299: parse_cli() currently reads env::args() directly which
prevents unit testing the hidden "ui" branch and the status-line rewrite;
extract the logic into a new function (e.g., parse_cli_args(args: &[&str]) ->
Result<ParsedCli, argh::EarlyExit>) that performs the same behavior (handle the
"ui" help/error path with ui_help_early_exit and UiMode::from_arg_value, rewrite
"status-line" to "statusline", default to "help", and call Cli::from_args to
produce ParsedCli::Public), then make parse_cli() a thin wrapper that collects
env::args() and calls parse_cli_args; update callers/tests to call
parse_cli_args directly to unit-test the ui branch, ui parse errors, and the
status-line rewrite without spawning the binary.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1860ff4f-d466-4de6-b4e4-7fce3bd90850

📥 Commits

Reviewing files that changed from the base of the PR and between 78e3d2f and 4bd0b39.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • crates/wisp-bin/Cargo.toml
  • crates/wisp-bin/src/main.rs
  • crates/wisp-bin/tests/smoke.rs

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/wisp-bin/tests/smoke.rs (1)

103-112: ⚠️ Potential issue | 🟠 Major

Pipeline failure: statusline render requires a tmux session.

The CI pipeline reports this test is failing with assertion failed: output.status.success(). The statusline render command internally calls load_domain_state() which requires an active tmux session, causing it to fail in CI environments where tmux is not running.

Consider either:

  1. Skipping this test in CI (e.g., #[ignore] with a note to run manually in tmux)
  2. Mocking the tmux dependency for this smoke test
  3. Checking for tmux availability and asserting on a graceful error message instead
💡 Suggested fix: Mark as ignored with documentation
 #[test]
+#[ignore = "requires active tmux session"]
 fn statusline_render_command_prints_status_output() {
     let output = Command::new(bin())
         .args(["statusline", "render"])
         .output()
         .expect("run statusline render");

     assert!(output.status.success());
     let stdout = String::from_utf8_lossy(&output.stdout);
     assert!(stdout.contains("󰖔"));
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/wisp-bin/tests/smoke.rs` around lines 103 - 112, The test
statusline_render_command_prints_status_output calls the CLI "statusline render"
which invokes load_domain_state and requires an active tmux session; mark this
test as #[ignore] and add a short comment that it must be run manually inside
tmux (or CI with tmux), e.g., place #[ignore] above
statusline_render_command_prints_status_output and document the manual run
requirement; alternatively add a separate small test that checks for tmux
absence by running Command::new(bin()).args(["statusline","render"]).output()
and asserting a graceful error message/exit when load_domain_state fails so CI
can validate expected failure.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Line 25: Replace the moving reference "uses: dtolnay/rust-toolchain@stable"
with a pinned commit SHA to ensure reproducible CI; update the workflow to
"uses: dtolnay/rust-toolchain@<commit-sha>" by finding the desired commit SHA in
the dtolnay/rust-toolchain repository and substituting it in place of "@stable"
(ensure you pick a specific commit SHA and not a tag or branch).
- Line 27: CI currently pins only toolchain: stable (the token "toolchain:
stable") so MSRV regressions against rust 1.85 are not validated; add a
matrix-based job (e.g., "msrv-check" or extend the existing build job) that runs
on a strategy.matrix.rust = [ "1.85.0", "stable" ] and uses the selected
toolchain for each matrix entry to run cargo check/build/test; ensure the job
sets the toolchain (via actions-rs/toolchain or rustup) to +${{ matrix.rust }}
before running cargo so both 1.85.0 and stable are exercised.

In `@crates/wisp-bin/src/main.rs`:
- Around line 286-290: The code redundantly checks
cli_args.first().is_some_and(...) before calling cli_args.first_mut(); replace
the two-step check with a single get_mut(0) match to both inspect and mutate the
first element: use cli_args.get_mut(0) to obtain a mutable reference, compare it
to "status-line" and if equal assign "statusline" to that mutable reference
(referring to cli_args, first_mut/first, and the local variable command in the
original snippet).
- Around line 420-424: The call to validate_statusline_flags() is duplicated:
it’s already invoked before run_statusline_group() is called, so remove the
redundant validate_statusline_flags(&command)?; at the top of
run_statusline_group to avoid double validation; keep the rest of
run_statusline_group unchanged and ensure any error handling relies on the
single prior validation performed before the function is invoked.

---

Outside diff comments:
In `@crates/wisp-bin/tests/smoke.rs`:
- Around line 103-112: The test statusline_render_command_prints_status_output
calls the CLI "statusline render" which invokes load_domain_state and requires
an active tmux session; mark this test as #[ignore] and add a short comment that
it must be run manually inside tmux (or CI with tmux), e.g., place #[ignore]
above statusline_render_command_prints_status_output and document the manual run
requirement; alternatively add a separate small test that checks for tmux
absence by running Command::new(bin()).args(["statusline","render"]).output()
and asserting a graceful error message/exit when load_domain_state fails so CI
can validate expected failure.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 11315a78-a9b7-4c25-bcca-f62a521382d6

📥 Commits

Reviewing files that changed from the base of the PR and between 4bd0b39 and 43b7f00.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • crates/wisp-bin/Cargo.toml
  • crates/wisp-bin/src/main.rs
  • crates/wisp-bin/tests/smoke.rs


- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@stable
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all GitHub actions are pinned (no moving refs like `@main/`@master/@stable)
rg -n '^\s*uses:\s*[^@]+@(main|master|stable|v[0-9]+)$' .github/workflows

Repository: Pajn/wisp

Length of output: 251


Pin GitHub Action to a commit SHA instead of using @stable.

Line 25 uses dtolnay/rust-toolchain@stable, a moving reference that can change between runs and weakens CI reproducibility and supply-chain integrity. Pin to a specific commit SHA instead.

Suggested change
-        uses: dtolnay/rust-toolchain@stable
+        uses: dtolnay/rust-toolchain@<commit-sha>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 25, Replace the moving reference "uses:
dtolnay/rust-toolchain@stable" with a pinned commit SHA to ensure reproducible
CI; update the workflow to "uses: dtolnay/rust-toolchain@<commit-sha>" by
finding the desired commit SHA in the dtolnay/rust-toolchain repository and
substituting it in place of "@stable" (ensure you pick a specific commit SHA and
not a tag or branch).

uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.85.0
toolchain: stable
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify declared rust-version and current workflow toolchain settings
echo "Cargo.toml rust-version:"
rg -n '^\s*rust-version\s*=' Cargo.toml

echo
echo "Workflow toolchain config:"
rg -n '^\s*toolchain\s*:' .github/workflows/ci.yml

Repository: Pajn/wisp

Length of output: 161


CI does not validate MSRV (rust-version = 1.85) — only stable is tested.

With only toolchain: stable on line 27, CI can pass on newer compilers while regressions against 1.85 go undetected. Add an MSRV check job using a matrix strategy with both 1.85.0 and stable:

Suggested matrix update
 jobs:
   rust:
     name: Rust Checks
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        toolchain: ["1.85.0", "stable"]

     steps:
@@
       - name: Install Rust toolchain
         uses: dtolnay/rust-toolchain@stable
         with:
-          toolchain: stable
+          toolchain: ${{ matrix.toolchain }}
           components: clippy, rustfmt
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 27, CI currently pins only toolchain:
stable (the token "toolchain: stable") so MSRV regressions against rust 1.85 are
not validated; add a matrix-based job (e.g., "msrv-check" or extend the existing
build job) that runs on a strategy.matrix.rust = [ "1.85.0", "stable" ] and uses
the selected toolchain for each matrix entry to run cargo check/build/test;
ensure the job sets the toolchain (via actions-rs/toolchain or rustup) to +${{
matrix.rust }} before running cargo so both 1.85.0 and stable are exercised.

Comment on lines +286 to +290
if cli_args.first().is_some_and(|arg| arg == "status-line")
&& let Some(command) = cli_args.first_mut()
{
*command = "statusline".to_string();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Minor: Redundant existence check can be simplified.

The first().is_some_and(...) followed by first_mut() is slightly redundant. Consider using get_mut(0) directly with a match.

♻️ Suggested simplification
-    if cli_args.first().is_some_and(|arg| arg == "status-line")
-        && let Some(command) = cli_args.first_mut()
-    {
-        *command = "statusline".to_string();
+    if let Some(command) = cli_args.get_mut(0) {
+        if command == "status-line" {
+            *command = "statusline".to_string();
+        }
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if cli_args.first().is_some_and(|arg| arg == "status-line")
&& let Some(command) = cli_args.first_mut()
{
*command = "statusline".to_string();
}
if let Some(command) = cli_args.get_mut(0) {
if command == "status-line" {
*command = "statusline".to_string();
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/wisp-bin/src/main.rs` around lines 286 - 290, The code redundantly
checks cli_args.first().is_some_and(...) before calling cli_args.first_mut();
replace the two-step check with a single get_mut(0) match to both inspect and
mutate the first element: use cli_args.get_mut(0) to obtain a mutable reference,
compare it to "status-line" and if equal assign "statusline" to that mutable
reference (referring to cli_args, first_mut/first, and the local variable
command in the original snippet).

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
.github/workflows/ci.yml (2)

27-27: ⚠️ Potential issue | 🟠 Major

Add an MSRV lane instead of testing only stable.

Line 27 sets only toolchain: stable, but Cargo.toml declares rust-version = "1.85" (Cargo.toml:15-18). CI should validate both MSRV and stable.

Suggested change
 jobs:
   rust:
     name: Rust Checks
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        toolchain: ["1.85.0", "stable"]

@@
       - name: Install Rust toolchain
         uses: dtolnay/rust-toolchain@stable
         with:
-          toolchain: stable
+          toolchain: ${{ matrix.toolchain }}
           components: clippy, rustfmt
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 27, CI currently tests only "toolchain:
stable"; update the workflow matrix to also test the crate's minimum supported
Rust version by adding an MSRV entry that matches Cargo.toml's rust-version
(rust-version = "1.85") alongside the existing stable entry—modify the matrix
definition that contains "toolchain: stable" to include a second job with
"toolchain: 1.85" (or the exact patch like 1.85.0) so both MSRV and stable
toolchains run.

25-25: ⚠️ Potential issue | 🟠 Major

Pin dtolnay/rust-toolchain to an immutable commit SHA.

Line 25 still uses @stable, which is a moving ref and weakens CI reproducibility/supply-chain guarantees.

Suggested change
-        uses: dtolnay/rust-toolchain@stable
+        uses: dtolnay/rust-toolchain@<commit-sha>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 25, The workflow currently references the
moving tag "dtolnay/rust-toolchain@stable"; change this to an immutable commit
SHA to ensure reproducible CI by replacing the "@stable" ref for the "uses:
dtolnay/rust-toolchain" step with a specific commit SHA from that action's
repository (find the latest tested commit in dtolnay/rust-toolchain and use that
full 40-char SHA), commit the change, and update any workflow documentation if
needed so future updates require an intentional SHA bump.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/ci.yml:
- Line 27: CI currently tests only "toolchain: stable"; update the workflow
matrix to also test the crate's minimum supported Rust version by adding an MSRV
entry that matches Cargo.toml's rust-version (rust-version = "1.85") alongside
the existing stable entry—modify the matrix definition that contains "toolchain:
stable" to include a second job with "toolchain: 1.85" (or the exact patch like
1.85.0) so both MSRV and stable toolchains run.
- Line 25: The workflow currently references the moving tag
"dtolnay/rust-toolchain@stable"; change this to an immutable commit SHA to
ensure reproducible CI by replacing the "@stable" ref for the "uses:
dtolnay/rust-toolchain" step with a specific commit SHA from that action's
repository (find the latest tested commit in dtolnay/rust-toolchain and use that
full 40-char SHA), commit the change, and update any workflow documentation if
needed so future updates require an intentional SHA bump.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 55022898-c4c9-4b26-ae1b-fd45c6b44aec

📥 Commits

Reviewing files that changed from the base of the PR and between 43b7f00 and 83aee66.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@Pajn Pajn force-pushed the cmd-help branch 2 times, most recently from d7a25b3 to 21f54f1 Compare March 19, 2026 18:32
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (1)
crates/wisp-bin/src/main.rs (1)

286-290: 🧹 Nitpick | 🔵 Trivial

Minor: Redundant existence check can be simplified.

The first().is_some_and(...) followed by first_mut() performs two lookups. This was noted in a previous review.

♻️ Suggested simplification
-    if cli_args.first().is_some_and(|arg| arg == "status-line")
-        && let Some(command) = cli_args.first_mut()
-    {
-        *command = "statusline".to_string();
+    if let Some(command) = cli_args.first_mut() {
+        if command == "status-line" {
+            *command = "statusline".to_string();
+        }
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/wisp-bin/src/main.rs` around lines 286 - 290, The code does two
lookups into cli_args (first().is_some_and(...) and first_mut()); simplify by
calling first_mut() once and checking the value there. Replace the current
conditional with a single if-let that obtains a mutable reference to the first
element (using cli_args.first_mut()) and then compare it to "status-line" (e.g.,
if let Some(command) = cli_args.first_mut() && command == "status-line" {
*command = "statusline".to_string(); } or a nested if to achieve the same),
updating the mutable command in-place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 30-33: Remove the unnecessary tmux session creation by deleting
the `tmux new-session -d` command from the CI step that installs tmux so only
the installation lines remain; keep the `sudo apt-get update && sudo apt-get
install -y tmux` line intact and do not create any default tmux sessions in the
workflow.

In `@crates/wisp-bin/src/main.rs`:
- Around line 2037-2055: The test
statusline_render_rejects_conflicting_force_flags currently calls
run_statusline_group(&config, command) after validate_statusline_flags returns
an error, which can panic because run_statusline_group requires a real
tmux/domain state; remove the call to run_statusline_group or replace it with a
proper mock/stub of run_statusline_group (or its dependencies) if you actually
need to assert that no re-validation happens—i.e., keep only the
validate_statusline_flags expect_err assertion, or inject a test double for
run_statusline_group so the test does not touch real tmux state.

In `@rust-toolchain.toml`:
- Around line 1-2: The rust-toolchain.toml currently sets channel = "stable"
which can drift from the crate's declared MSRV (rust-version = "1.90"); update
rust-toolchain.toml to pin the channel to "1.90" so local toolchains match
Cargo.toml (or delete rust-toolchain.toml if you prefer to rely solely on CI's
explicit toolchain: 1.90), ensuring consistency between the file that reads
channel = "stable" and the declared rust-version = "1.90".

---

Duplicate comments:
In `@crates/wisp-bin/src/main.rs`:
- Around line 286-290: The code does two lookups into cli_args
(first().is_some_and(...) and first_mut()); simplify by calling first_mut() once
and checking the value there. Replace the current conditional with a single
if-let that obtains a mutable reference to the first element (using
cli_args.first_mut()) and then compare it to "status-line" (e.g., if let
Some(command) = cli_args.first_mut() && command == "status-line" { *command =
"statusline".to_string(); } or a nested if to achieve the same), updating the
mutable command in-place.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 63185c4c-2d62-4397-88cf-9f2457a0e232

📥 Commits

Reviewing files that changed from the base of the PR and between 83aee66 and 21f54f1.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • Cargo.toml
  • crates/wisp-bin/Cargo.toml
  • crates/wisp-bin/src/main.rs
  • crates/wisp-bin/tests/smoke.rs
  • rust-toolchain.toml

Comment on lines +1 to +2
[toolchain]
channel = "stable"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider pinning the toolchain channel to match the declared MSRV.

Using channel = "stable" allows the toolchain to drift ahead of the declared rust-version = "1.90" in Cargo.toml. This could lead to developers using features not available in 1.90 without CI catching the regression (since CI also uses a specific version). Consider either:

  1. Pinning the channel to "1.90" here for consistency, or
  2. Relying solely on CI's explicit toolchain: 1.90 and removing this file if it doesn't add value.
💡 Option to pin to MSRV
 [toolchain]
-channel = "stable"
+channel = "1.90"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[toolchain]
channel = "stable"
[toolchain]
channel = "1.90"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rust-toolchain.toml` around lines 1 - 2, The rust-toolchain.toml currently
sets channel = "stable" which can drift from the crate's declared MSRV
(rust-version = "1.90"); update rust-toolchain.toml to pin the channel to "1.90"
so local toolchains match Cargo.toml (or delete rust-toolchain.toml if you
prefer to rely solely on CI's explicit toolchain: 1.90), ensuring consistency
between the file that reads channel = "stable" and the declared rust-version =
"1.90".

@Pajn Pajn mentioned this pull request Mar 21, 2026
@Pajn Pajn merged commit 73bf897 into main Mar 21, 2026
1 of 2 checks passed
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.

1 participant