feat: improve wipe command UX with interactive prompts#759
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🧰 Additional context used📓 Path-based instructions (1)cli/**/*.go📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (7)📚 Learning: 2026-03-19T07:12:14.508ZApplied to files:
📚 Learning: 2026-03-19T07:12:14.508ZApplied to files:
📚 Learning: 2026-03-15T21:32:02.880ZApplied to files:
📚 Learning: 2026-03-19T11:19:40.044ZApplied to files:
📚 Learning: 2026-03-15T18:17:43.675ZApplied to files:
📚 Learning: 2026-03-19T11:19:40.044ZApplied to files:
📚 Learning: 2026-03-15T21:32:02.880ZApplied to files:
🧬 Code graph analysis (1)cli/cmd/wipe.go (2)
🪛 GitHub Check: CodeQLcli/cmd/wipe.go[failure] 470-470: Uncontrolled data used in path expression 🔇 Additional comments (17)
WalkthroughThis pull request updates the Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the user experience of the wipe command by introducing interactive prompts for backup and container management. The refactoring to create helper functions like runForm and break down ensureRunning is a great step towards better code clarity and maintainability. I've identified a couple of issues in the new logic flow that could lead to confusing user experiences or incorrect behavior. My comments provide suggestions to address these points.
| if err != nil { | ||
| wc.errOut.Warn(fmt.Sprintf("Could not check container status: %v", err)) | ||
| } |
There was a problem hiding this comment.
The error from wc.containersRunning() is logged as a warning, but then execution continues as if there was no error and running is false. This is incorrect. If there's an error checking container status (e.g., the Docker daemon is not running), we cannot know if containers are running or not. The function should propagate this error to the caller to halt the process, rather than making an incorrect assumption and potentially trying to start containers that are already running.
| if err != nil { | |
| wc.errOut.Warn(fmt.Sprintf("Could not check container status: %v", err)) | |
| } | |
| if err != nil { | |
| return fmt.Errorf("could not check container status: %w", err) | |
| } |
| if !startOK { | ||
| return wc.askContinueWithoutBackup() | ||
| } |
There was a problem hiding this comment.
When a user selects "No, skip backup" in the promptStartForBackup prompt, startOK becomes false. The current implementation then calls wc.askContinueWithoutBackup(), which incorrectly tells the user "Backup failed...". This is a confusing user experience, as the backup didn't fail but was intentionally skipped.
To fix this, I suggest introducing a new sentinel error, for example errBackupSkippedByUser, which should be returned here. The caller, offerBackup, should then be updated to check for this specific error and gracefully exit the backup flow, allowing the wipe to proceed.
Here's how you could implement it:
-
Define the new sentinel error at the top of the file:
var errBackupSkippedByUser = errors.New("backup skipped by user")
-
Update this function to return the new error (as in the suggestion below).
-
Update
offerBackupto handle this new error at line 232:if err := wc.ensureRunningForBackup(); err != nil { if errors.Is(err, errBackupSkippedByUser) { return nil // User skipped backup, so continue with wipe. } return err }
| if !startOK { | |
| return wc.askContinueWithoutBackup() | |
| } | |
| if !startOK { | |
| return errBackupSkippedByUser | |
| } |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cli/cmd/wipe.go`:
- Around line 138-143: The post-wipe path currently calls pullStartAndWait(...)
which skips the image verification/pinning done by wc.startContainers(); change
the branch so that when startAfter is true you invoke wc.startContainers()
(which runs verifyAndPinImages()) instead of calling pullStartAndWait(), or
alternatively call wc.verifyAndPinImages() before pullStartAndWait() to ensure
images are pinned—update the call in the startAfter branch surrounding
pullStartAndWait to use wc.startContainers()/verifyAndPinImages() so the
verified startup path is preserved.
- Around line 244-266: The current ensureRunningForBackup implementation returns
immediately when wc.startContainers() fails, which prevents falling back to the
existing “continue without backup?” flow; change it so failures from
startContainers are handled the same as a user-declined start: capture the error
from wc.startContainers(), warn the user (using wc.errOut.Warn/Printf with the
error), then call and return wc.askContinueWithoutBackup() (or a parameterized
continue-without-backup helper) instead of returning the error; update
ensureRunningForBackup to call promptStartForBackup(), and on start failure
invoke askContinueWithoutBackup() so both the !startOK and startContainers error
paths use the same confirmation flow (referencing ensureRunningForBackup,
promptStartForBackup, startContainers, and askContinueWithoutBackup).
- Around line 45-57: Update the one-line command summary in the wipeCmd
cobra.Command by changing the Short field to match the new flow described in
Long; replace the current "Factory-reset: wipe all data and re-open the setup
wizard" with a concise summary that reflects the optional post-wipe behavior
(for example: "Factory-reset: wipe all data; optionally re-open the setup
wizard" or similar) so the short help and the detailed Long description stay
consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 96c975c6-268a-403b-b0a5-411faa8fe62d
📒 Files selected for processing (5)
README.mdcli/cmd/wipe.godocs/design/operations.mddocs/design/organization.mddocs/user_guide.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: CLI Test (windows-latest)
- GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (1)
cli/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Go CLI: use Cobra commands. Never use
cd cliin Bash commands -- usego -C cliinstead.
Files:
cli/cmd/wipe.go
🧠 Learnings (7)
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to src/synthorg/**/*.py : Package structure: src/synthorg/ organized as: api/ (REST+WebSocket, Litestar), auth/ (auth subpackage), backup/ (scheduled/manual backups), budget/ (cost tracking, CFO), cli/ (superseded by Go CLI), communication/ (message bus, meetings), config/ (YAML loading), core/ (domain models, resilience config), engine/ (orchestration, task state, coordination, approval gates, stagnation detection, context budget, compaction), hr/ (hiring, performance, promotion), memory/ (pluggable backend, Mem0, retrieval, consolidation), persistence/ (operational data, SQLite, settings), observability/ (logging, correlation, sinks), providers/ (LLM abstraction, LiteLLM, auth types, presets, runtime CRUD), settings/ (runtime-editable, typed definitions, encryption, config bridge), security/ (SecOps, rule engine, output scanning, progressive trust, autonomy levels), templates/ (company templates, personalities), tools/ (registry, built-in tools, git, sandbox, code_runner, MCP...
Applied to files:
docs/user_guide.mdREADME.mddocs/design/organization.md
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to docker/Dockerfile.sandbox : Docker sandbox: `synthorg-sandbox` — Python 3.14 + Node.js + git, non-root (UID 10001), agent code execution sandbox
Applied to files:
README.md
📚 Learning: 2026-03-15T21:32:02.880Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-15T21:32:02.880Z
Learning: Applies to cli/**/*.go : Go CLI (Go 1.26+) uses Cobra for commands, charmbracelet/huh for interactive CLI, charmbracelet/lipgloss for styled output. Cross-platform builds (linux/darwin/windows × amd64/arm64). GoReleaser for releases with cosign keyless signing of checksums.txt. SLSA L3 provenance attestations via actions/attest-build-provenance.
Applied to files:
docs/design/operations.md
📚 Learning: 2026-03-19T11:19:40.044Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T11:19:40.044Z
Learning: Applies to go.mod : Maintain Go 1.26+ requirement. Dependencies: Cobra (CLI framework), charmbracelet/huh and charmbracelet/lipgloss (UI), sigstore-go (code signing), go-containerregistry (container image verification), go-tuf (TUF client for Sigstore).
Applied to files:
docs/design/operations.md
📚 Learning: 2026-03-15T18:17:43.675Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-15T18:17:43.675Z
Learning: Applies to cli/** : CLI: Go 1.26+, dependencies in cli/go.mod (Cobra, charmbracelet/huh).
Applied to files:
docs/design/operations.md
📚 Learning: 2026-03-15T21:32:02.880Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-15T21:32:02.880Z
Learning: Applies to cli/go.mod : Go CLI dependencies: Go 1.26+, Cobra (commands), charmbracelet/huh (interactive CLI), charmbracelet/lipgloss (styled output).
Applied to files:
docs/design/operations.md
📚 Learning: 2026-03-19T11:19:40.044Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T11:19:40.044Z
Learning: CLI workflow (`.github/workflows/cli.yml`) runs Go lint (golangci-lint + go vet) + test (race, coverage) + build (cross-compile matrix) + vulnerability check (govulncheck) + fuzz testing. Cross-compiles for linux/darwin/windows × amd64/arm64. GoReleaser release on v* tags with cosign keyless signing and SLSA L3 attestations.
Applied to files:
docs/design/operations.md
🧬 Code graph analysis (1)
cli/cmd/wipe.go (2)
cli/internal/docker/client.go (2)
ComposeExecOutput(106-113)Info(22-29)cli/internal/health/check.go (1)
WaitForHealthy(22-52)
Backup now defaults to yes, containers only start when the user agrees, and post-wipe restart is optional instead of automatic. Pre-reviewed by 3 agents, 7 findings addressed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… Gemini - Use wc.startContainers() for post-wipe startup (was skipping image verification) - Parameterize askContinueWithoutBackup with context-specific prompt titles - Fall through to "continue without backup?" on Docker error and startContainers failure - Update Short/Long descriptions and doc comments for optional restart flow - Chain runForm builder calls for future-proof huh library compatibility - Clean up corrupt archive file if f.Close() fails on success path - Use if-scoped err declaration in promptSavePath Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b0fec01 to
34ab58a
Compare
🤖 I have created a release *beep* *boop* --- ## [0.4.9](v0.4.8...v0.4.9) (2026-03-23) ### Features * add consultancy and data team template archetypes ([#764](#764)) ([81dc75f](81dc75f)) * add personality presets for new template archetypes ([#758](#758)) ([de4e661](de4e661)) * improve wipe command UX with interactive prompts ([#759](#759)) ([bbd4d2d](bbd4d2d)) ### Bug Fixes * stable channel detects update for dev builds ([#753](#753)) ([f53da9f](f53da9f)) ### Documentation * add version banner to docs header ([#761](#761)) ([8f8c1f8](8f8c1f8)) ### Maintenance * adopt new features from web dependency upgrades ([#763](#763)) ([1bb6336](1bb6336)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
containersRunningnow returns errors instead of silently discarding Docker communication failurescreateTarGzrefactored -- extractedwriteTarEntryhelper to stay under 50-line function limitrunFormhelper -- eliminates repeated I/O stream wiring across all 6 prompt methodsTest plan
go -C cli vet ./...-- cleango -C cli test ./...-- all passgo -C cli build ./...-- compilesgo -C cli tool golangci-lint run-- 0 issuessynthorg wipewith containers stopped -- verify backup prompt (default Yes), then container start promptsynthorg wipewith containers running -- verify backup prompt skips container start promptPre-reviewed by 3 agents (docs-consistency, go-reviewer, go-conventions), 7 findings addressed.
🤖 Generated with Claude Code