Repository navigation
Labels
Description
Summary
infer reset lists the paths it will delete, and infer reset confirm lists the paths it deleted — but neither says how much disk was involved. After a wipe that spans every project on the machine, the one number a user actually wants is the one docker system prune ends with:
Total reclaimed space: 1.653GB
Proposal: report reclaimed space in both directions.
infer resetends the preview withTotal reclaimable space: <size>— part of deciding whether the wipe is worth running.infer reset confirmends the result withTotal reclaimed space: <size>, summed over the targets it actually removed, so a partially-blocked wipe reports what it really freed rather than what it hoped to.
Implementation notes:
- The sizes must be measured before
os.RemoveAll, so the walk belongs next to the removal loop incmd/reset/wipe.go(wiper.wipe), with the preview total computed fromwiper.resolve(). - Targets are whole directory trees plus the SQLite file and its
-wal/-shm/-journalsidecars; all of them should count. - There is no byte-size formatter in the repo today (
internal/platform/formattinghas none), so this adds one. Matchdocker system pruneoutput: decimal units and 4 significant digits (1.653GB,4.096kB), not 1024-based. - Walking is best-effort: an unreadable entry should be skipped, never fail the reset. The number is a report, not an audit.
- A per-target size next to each listed path was considered and is probably noise — the reset already prints 40+ lines on a busy machine. One total at the end is the useful signal. Open to per-path sizes behind a flag if that proves wrong.
Acceptance Criteria
-
infer resetprintsTotal reclaimable space: <size>at the end of the preview. -
infer reset confirmprintsTotal reclaimed space: <size>at the end of the result. - The confirm total counts only targets that were actually removed; a target that failed to delete is excluded, and the existing per-target error reporting is unchanged.
- Sizes cover directory trees, the SQLite database and its WAL sidecars.
- Byte sizes are formatted like
docker system prune(decimal units, 4 significant digits). - An unreadable file or directory during the size walk is skipped and never fails the reset.
- Covered by a test that seeds files of known size and asserts the reported total.
Context
- Follow-up to feat(cli): add infer reset and infer insights commands #1241, which added
infer reset/infer reset confirm. - Relevant code:
cmd/reset/wipe.go(wiper.resolve,wiper.wipe,preview,listing).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Sep 18, 2026
@infer Can you work on this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Sep 18, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1247
✅ Infer Result: Success
Done. Resolves #1243 via PR #1247 (branch
fix/issue-1243, commit04306cc), CI fully green, PR marked ready for review.What changed
infer resetpreview now ends withTotal reclaimable space: <size>, computed fromwiper.resolve()so it reflects only targets actually on disk.infer reset confirmnow ends withTotal reclaimed space: <size>: every target is measured with afilepath.WalkDirpass beforeos.RemoveAll, and only bytes of targets that were actually removed count, so a partially-blocked wipe reports what it really freed. Per-target error reporting is untouched.-wal/-shm/-journalsidecars - the sidecar path list is now onesqlitePaths()helper shared by preview and wipe.formatting.FormatBytesmatchesdocker system prune- decimal units, 4 significant digits (0B,4.096kB,1.653GB), no space.Tests
TestWipeReportsSpaceTotals- seeds a dir tree (1500 B) + db (4096 B) + wal (100 B) and asserts both totals print5.696kB.TestWipeReclaimedSpaceExcludesFailures- a chmod-blocked target is excluded from the total (skips on filesystems that allow removal, mirroring the existing failure test).TestFormatBytes- table test pinning the docker-style formatter.Verification
go test -tags purego ./cmd/reset ./internal/platform/formatting- passtask precommit:run(tidy, fmt, imports, golangci-lint, markdownlint) - 0 issuesFollow-ups
[DOCS] Document the disk space totals reported by infer reset) - the CLI repo's own docs don't coverinfer reset, and the docs website should reflect the new output lines.Skipped: no new dependency, no per-target flag, no size cache - add only if the totals prove slow or noisy.
Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 17m 8sTokens: 2,171,275 in · 25,557 out · 2,196,832 total (35 requests)
Tool calls: 44 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Sep 18, 2026
🎉 This issue has been resolved in version 0.204.0 🎉
The release is available on:
Your semantic-release bot 📦🚀