Skip to content

fix: reject minvmd run --timeout without --detach - #857

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/reject-run-timeout-without-detach-4d20d266d9b1b1e2
Jul 20, 2026
Merged

fix: reject minvmd run --timeout without --detach#857
norrietaylor merged 1 commit into
mainfrom
inbox-patch/reject-run-timeout-without-detach-4d20d266d9b1b1e2

Conversation

@gominimal-aw-bot

Copy link
Copy Markdown
Contributor

Fixes #829
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABJPktmA

Defect

minvmd run --timeout N without --detach parsed successfully and was silently ignored. run() forwards timeout_secs to run_detach() only inside the if detach branch (crates/minvmd/src/cmd/run.rs); run_foreground() never receives it, so the flag is a no-op in foreground mode. The help text already scopes --timeout to --detach (crates/minvmd/src/main.rs), so accepting-and-ignoring it is a footgun.

Change

Reject the combination rather than implement a new foreground-timeout semantic (which would require deciding what a deadline means for the whole supervisor lifecycle — out of scope for a small fix, and the help text already documents the flag as detach-only).

  • main.rs: the CLI --timeout argument becomes Option<u64> (dropping default_value_t) so an explicit --timeout is distinguishable from an omitted one.
  • run.rs: run() now takes Option<u64> and bails early with `--timeout` only applies with `--detach` when a timeout is given without --detach; otherwise it resolves the default (DEFAULT_DETACH_TIMEOUT_SECS) and the detach path is unchanged.
  • Two unit tests (they run on the stub build used by CI) pin the new rejection and the unchanged libkrun-required path.

All existing run --detach --timeout N integration call sites are unaffected — the guard only fires when --detach is absent. History for this subcommand lives entirely in this repo (informed by PR #351 / issue #330).

Verification

  • cargo fmt --all --check --manifest-path target/Cargo.toml — clean (after applying cargo fmt).
  • cargo clippy --workspace --manifest-path target/Cargo.toml -- -D warnings — finished, no warnings.
  • cargo build --workspace --manifest-path target/Cargo.toml — finished.
  • cargo test --workspace --manifest-path target/Cargo.toml — exit 0, no failures; new run_rejects_timeout_without_detach and existing run_bails_without_libkrun both pass (2 passed; 0 failed).

Generated by inbox-patch ·

`minvmd run --timeout N` without `--detach` parsed successfully and was
silently ignored: run() only forwards timeout_secs to run_detach()
inside the detach branch, so run_foreground() never received it. The
help text already scopes the flag to --detach, so accepting it in
foreground mode is a footgun.

Make the CLI argument an Option<u64> so an explicit --timeout is
distinguishable from the default, and bail early in run() with an
actionable error when it is given without --detach. Unit tests pin the
rejection and the unchanged libkrun-required path.

Refs: #829
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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 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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 31d3289a-025e-457d-884b-421fb6e50770

📥 Commits

Reviewing files that changed from the base of the PR and between ebadd19 and 4e6c604.

📒 Files selected for processing (2)
  • crates/minvmd/src/cmd/run.rs
  • crates/minvmd/src/main.rs

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

@norrietaylor
norrietaylor marked this pull request as ready for review July 20, 2026 22:50
@norrietaylor
norrietaylor merged commit f71507f into main Jul 20, 2026
28 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/reject-run-timeout-without-detach-4d20d266d9b1b1e2 branch July 20, 2026 22:50
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.

minvmd run --timeout is silently ignored without --detach

1 participant