fix: skip non-VCS-root upload in headless activate - #1117
Conversation
A headless `min session activate` (--no-prompt, --no-input, or a non-TTY) from a directory that is not a VCS root uploaded the whole directory with no confirmation, because the non-VCS-root gate treated the impossibility of a prompt as consent. Split the gate's TTY-free decision into `file_upload::upload_gate` and invert the headless arm: a headless caller with an implicit --sync now skips the upload and warns on stderr with the `--sync tarball` escape hatch, starting the session with an empty workspace. A VCS root or an explicit --sync tarball still uploads; the interactive confirm (default No) is unchanged. 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: 2 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 (2)
Comment |
|
The upload-gate change matches the issue spec exactly (three-lane
Please drop those three hunks (rebase on current main and keep only |
The upload-gate change was authored against a pre-#1114 file state and reverted the theme module, the TTY predicate, and two doc comments. Restore main's versions; the gate logic is untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KyZLpkRf9G4A2hUDgDvn5f
|
Restored the #1114 content the stale base clobbered (theme module, TTY predicate, doc comments); upload-gate change untouched. CI re-running. |
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABK4RWeg
A headless
min session activate(--no-prompt,--no-input, or a non-TTY stderr) run from a directory that is not a version control repository root silently uploaded the entire directory: the non-VCS-root confirmation gate treated the impossibility of prompting as consent and uploaded anyway — a default-yes answered by nobody.This inverts the headless arm of that gate. With no explicit
--sync, a headless caller now skips the upload, warns on stderr (... is not a version control repository root; skipping file upload (pass --sync tarball to upload anyway)), and starts the session with an empty workspace; the UUID stays the only stdout line and exit is 0. A real VCS root, or a deliberate--sync tarball, still uploads, and the interactive confirmation (default No) is byte-for-byte unchanged. The TTY-free decision is factored into a smallfile_upload::upload_gatehelper so the three lanes are unit-tested.Verification
cargo fmt --all --check --manifest-path target/Cargo.toml— clean, no driftcargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warnings— 0 warnings (finished in 8m07s)cargo build --workspace --locked --manifest-path target/Cargo.toml— exit 0cargo test --workspace --locked --manifest-path target/Cargo.toml— exit 0; newupload_gate_covers_three_lanesunit test passesNote
Skip file upload in headless
activatewhen workspace is not a VCS rootUploadGateenum with three variants (Upload,SkipHeadless,Prompt) and anupload_gate(is_vcs_root, sync_explicit, headless)helper in file_upload.rs to centralize the upload decision.cmd_activate, replaces ad-hoc OR-chain logic with amatchonupload_gate: explicit--sync tarballalways uploads; headless + non-VCS root skips with a warning; interactive + non-VCS root prompts the user (defaulting to no).Macroscope summarized 61b2347.