Skip to content

Deletion progress spinner + agent-var classification fix (§4) - #2

Merged
UnbreakableMJ merged 1 commit into
mainfrom
clean-progress-and-agent-detection
Jun 22, 2026
Merged

Deletion progress spinner + agent-var classification fix (§4)#2
UnbreakableMJ merged 1 commit into
mainfrom
clean-progress-and-agent-detection

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Two related UX/conformance improvements to vacuum clean, surfaced while testing the freshly-installed CLI.

1. Deletion progress spinner

Previously, after confirming a real deletion (y, or --apply --yes), run_clean deleted in a loop and printed nothing until the whole loop finished — a multi-GB target/ made the terminal look frozen.

Now vacuum clean --apply shows a live spinner:

⠹ [1/3] Removing /home/you/project/target
  • Steady-tick spinner (animates on a background thread) — each candidate is one blocking removal call, so a spinner is the honest signal, not a percent bar that would jump straight to 100%.
  • stderr only, so stdout stays data-only (SFRS §7); human/TTY mode only, skipped for --quiet, dry-runs, and JSON/JSONL/agent output; uncolored template satisfies NO_COLOR.
  • Implemented with indicatif, contained to vacuum-cli (execute_candidates in app.rs); vacuum-core stays UI-free.

2. Agent-var classification fix (agentic-cli §4)

Testing showed the spinner never appeared under Claude Code because CLAUDECODE was treated as a JSON-forcing agent var. Per agentic-cli §4, CLAUDECODE / CURSOR_AGENT / GEMINI_CLI are informational only.

  • Split env vars: forcing = AI_AGENT, AGENT, CI (change output mode / suppress TUI); informational = CLAUDECODE, CURSOR_AGENT, GEMINI_CLI (no behavioral effect).
  • Informational agents now surface in metadata.invoking_agent (telemetry only, omitted when absent) — which is what the manual already documented.
  • Extracted the pure first_set classifier and added unit tests.

Verification

  • Spinner renders under a real-terminal PTY, then clears to the normal summary; piped human-mode keeps stdout free of control chars; invoking_agent:"CLAUDECODE" appears in the envelope while AI_AGENT still correctly forces JSON.
  • Gate green: cargo fmt · clippy -D warnings · cargo test --workspace (16 tests) · reuse lint. Commit signed/verified (§6.3).

🤖 Generated with Claude Code

Progress feedback:
- `vacuum clean --apply` now shows a live steady-tick spinner with `[i/N]` and
  the current path during deletion, so a long removal (e.g. a multi-GB
  `target/`) no longer looks frozen after the user confirms. Each candidate is
  a single blocking removal, so a spinner — not a percent bar — is the honest
  signal. Implemented with `indicatif`, contained to `vacuum-cli`
  (`execute_candidates` in app.rs); `vacuum-core` stays UI-free.
- Renders only in human/TTY mode, never for `--quiet`, dry-runs, or
  JSON/JSONL/agent output; drawn to stderr so stdout stays data-only (SFRS §7).
  Uncolored template satisfies NO_COLOR.

Agent detection (agentic-cli §4 conformance):
- Split agent env vars into forcing (AI_AGENT, AGENT, CI) vs informational
  (CLAUDECODE, CURSOR_AGENT, GEMINI_CLI). Only forcing vars change output mode /
  suppress the TUI; the informational ones previously (incorrectly) forced JSON.
- Informational agents now surface in `metadata.invoking_agent` (telemetry only,
  omitted when absent). This matches what the manual already documented.
- Extracted the pure `first_set` classifier and added unit tests for it.

Gate: cargo fmt / clippy -D warnings / test --workspace (16 tests) / reuse lint
all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@UnbreakableMJ
UnbreakableMJ merged commit c7cab18 into main Jun 22, 2026
2 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the clean-progress-and-agent-detection branch June 22, 2026 13:51
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