fix: report accepted forms when an exec request is rejected - #1143
Conversation
An exec request that is not one of the accepted forms — a command with no `min ` prefix, or `min <unknown-subcommand>` — was refused with a bare SSH `channel_failure`. That reaches the client only as "exec request failed on channel N", naming neither the rejected command nor what the daemon accepts, so the user has to read the source to find out. Accept the channel and report the rejection on the stderr stream with a non-zero exit instead, mirroring the accept-then-report path already used for a bad `min check` flag. The command is still refused and nothing is spawned; only the diagnostic reaches the client. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmg9rg
Running a command through
min session attach -cthat the session daemon does not service — any command with nominprefix, orminfollowed by an unrecognised subcommand — was refused with a bare SSHchannel_failure. The client saw onlyexec request failed on channel 0 (exit 255), naming neither the rejected command nor the forms the daemon accepts, so the user had to read the daemon source to find out.The daemon now accepts the channel and writes a diagnostic to the SSH stderr stream — naming the rejected command and listing
min run <task>,min package build [args...], andmin check [args...]— then exits non-zero. This mirrors the accept-then-report path already used for a badmin checkflag (informed by #383). The command is still refused and nothing is spawned, so the daemon's no-arbitrary-exec guarantee is unchanged.Verification
cargo fmt --all --check — clean, no drift
cargo clippy --workspace --locked -- -D warnings — 0 warnings
cargo build --workspace --locked — ok
cargo test --workspace --locked — ok (minimald lib: 212 passed, 0 failed)
Note
Report accepted forms on stderr when an SSH exec request is rejected
reject_unsupported_execin exec.rs to handle the accepted-channel path: writes the message, flushes, sends EOF, sets exit status, and closes.Macroscope summarized c2df1e7.