Skip to content

fix: skip non-VCS-root upload in headless activate - #1117

Merged
norrietaylor merged 2 commits into
mainfrom
inbox-patch/inbox-441-headless-nonvcs-skip-309ed624dceae0c5
Jul 31, 2026
Merged

fix: skip non-VCS-root upload in headless activate#1117
norrietaylor merged 2 commits into
mainfrom
inbox-patch/inbox-441-headless-nonvcs-skip-309ed624dceae0c5

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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 small file_upload::upload_gate helper so the three lanes are unit-tested.

Verification

  • cargo fmt --all --check --manifest-path target/Cargo.toml — clean, no drift
  • cargo 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 0
  • cargo test --workspace --locked --manifest-path target/Cargo.toml — exit 0; new upload_gate_covers_three_lanes unit test passes

Generated by inbox-patch ·

Note

Skip file upload in headless activate when workspace is not a VCS root

  • Adds an UploadGate enum with three variants (Upload, SkipHeadless, Prompt) and an upload_gate(is_vcs_root, sync_explicit, headless) helper in file_upload.rs to centralize the upload decision.
  • In cmd_activate, replaces ad-hoc OR-chain logic with a match on upload_gate: explicit --sync tarball always uploads; headless + non-VCS root skips with a warning; interactive + non-VCS root prompts the user (defaulting to no).
  • Behavioral Change: headless sessions on non-VCS-root directories previously uploaded without confirmation; they now skip upload and print a warning instead.

Macroscope summarized 61b2347.

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>
@coderabbitai

coderabbitai Bot commented Jul 31, 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: 2 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: 1cdf1939-b9b6-408a-a7c5-d4e01c3f8fa9

📥 Commits

Reviewing files that changed from the base of the PR and between 019d7c4 and 61b2347.

📒 Files selected for processing (2)
  • crates/minimal/src/file_upload.rs
  • crates/minimal/src/lib.rs

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

@norrietaylor

Copy link
Copy Markdown
Member

The upload-gate change matches the issue spec exactly (three-lane UploadGate, verbatim warning copy, escape hatch honored, interactive path untouched). But three hunks revert parts of #1114 (merged earlier today) and are out of scope:

  1. -pub mod theme; in lib.rs — removes the brand-theme module refactor(min): unify interactive prompts on inquire with a brand theme #1114 added.
  2. can_prompt_interactively() swapped from std::io::stdin().is_terminal() && stderr… back to dialoguer::console::user_attended…refactor(min): unify interactive prompts on inquire with a brand theme #1114 moved this off dialoguer deliberately.
  3. The doc-comment rewrites on the TTY predicate and arm_activation_interrupt that reintroduce the dialoguer/console narrative.

Please drop those three hunks (rebase on current main and keep only file_upload.rs + the upload-gate rewiring in cmd_activate). Do not merge as-is — it silently unwinds the prompt unification.

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
@norrietaylor

Copy link
Copy Markdown
Member

Restored the #1114 content the stale base clobbered (theme module, TTY predicate, doc comments); upload-gate change untouched. CI re-running.

@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 04:56
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 04:56
@norrietaylor
norrietaylor merged commit e7b51a7 into main Jul 31, 2026
29 of 30 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/inbox-441-headless-nonvcs-skip-309ed624dceae0c5 branch July 31, 2026 04:56
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