[PR #15907] cmd/launch: improve integration backup UX #77648

Open
opened 2026-05-05 10:19:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15907
Author: @hoyyeva
Created: 4/30/2026
Status: 🔄 Open

Base: mainHead: hoyyeva/launch-backup-ux


📝 Commits (7)

📊 Changes

18 files changed (+324 additions, -100 deletions)

View changed files

📝 cmd/internal/fileutil/files.go (+84 -11)
📝 cmd/internal/fileutil/files_test.go (+108 -3)
📝 cmd/launch/cline.go (+1 -1)
📝 cmd/launch/command_test.go (+7 -10)
📝 cmd/launch/droid.go (+1 -1)
📝 cmd/launch/droid_test.go (+2 -2)
📝 cmd/launch/hermes.go (+1 -1)
📝 cmd/launch/integrations_test.go (+1 -1)
📝 cmd/launch/launch.go (+3 -3)
📝 cmd/launch/launch_test.go (+0 -26)
📝 cmd/launch/models.go (+3 -33)
📝 cmd/launch/openclaw.go (+1 -1)
📝 cmd/launch/openclaw_test.go (+3 -2)
📝 cmd/launch/opencode.go (+1 -1)
📝 cmd/launch/pi.go (+2 -2)
📝 cmd/launch/pi_test.go (+57 -0)
📝 cmd/launch/vscode.go (+2 -2)
📝 cmd/launch/vscode_test.go (+47 -0)

📄 Description

Summary

Simplify ollama launch backup handling for integration-managed config writes.

This change:

  • stores launcher-created backups under ~/.ollama/backup
  • groups backups by integration directory instead of prefixing filenames
  • removes the backup/config warning prompt before integration config edits
  • keeps only the 5 most recent backups per file
  • treats unchanged config writes as a true no-op

Examples:

  • ~/.ollama/backup/droid/settings.json.<timestamp>
  • ~/.ollama/backup/openclaw/openclaw.json.<timestamp>
  • ~/.ollama/backup/pi/models.json.<timestamp>
  • ~/.ollama/backup/pi/settings.json.<timestamp>
  • ~/.ollama/backup/vscode/chatLanguageModels.json.<timestamp>

What changed

  • Updated the backup root from the temp dir to ~/.ollama/backup
  • Stored integration-managed backups under per-integration subdirectories
  • Kept backup filenames based on the original config filename
  • Removed the config-edit backup/config prompt from ollama launch
  • Capped backups at 5 per file
  • Skipped writes and backups entirely when the config content is unchanged

Testing

Ran:

  • go test ./cmd/internal/fileutil
  • go test ./cmd/launch -run 'TestDroidEdit_BackupCreated|TestOpenclawEdit_BackupCreated|TestVSCodeEdit_CreatesDistinctBackupsForManagedFiles'
  • go test ./cmd/launch -run '^TestDoesNotExist$'
  • go test -count=1 -benchtime=1x ./cmd/launch/...

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15907 **Author:** [@hoyyeva](https://github.com/hoyyeva) **Created:** 4/30/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `hoyyeva/launch-backup-ux` --- ### 📝 Commits (7) - [`9a915b9`](https://github.com/ollama/ollama/commit/9a915b9dd22e19994242464c765a3c2d37ce0693) cmd/launch: improve integration backup UX - [`5b8c199`](https://github.com/ollama/ollama/commit/5b8c199aab27360297e6100f7e73696ddc654bcc) clean up and simplify - [`9522187`](https://github.com/ollama/ollama/commit/9522187cd26d13dc47212e8e112eb7c9fda3d250) clean up - [`ca8a07f`](https://github.com/ollama/ollama/commit/ca8a07f076ceb602df5251d820a78b0447748ae0) clean up - [`6758207`](https://github.com/ollama/ollama/commit/67582071cdd1fb6541ef68b376db8ca837139902) clean up - [`b50e4e7`](https://github.com/ollama/ollama/commit/b50e4e7ba726225cd4ed75cb8aa2dedb38a62424) fix test - [`94c5cbd`](https://github.com/ollama/ollama/commit/94c5cbd47b6835660c069e1979d2915324451ba5) add max backup files and also address comments ### 📊 Changes **18 files changed** (+324 additions, -100 deletions) <details> <summary>View changed files</summary> 📝 `cmd/internal/fileutil/files.go` (+84 -11) 📝 `cmd/internal/fileutil/files_test.go` (+108 -3) 📝 `cmd/launch/cline.go` (+1 -1) 📝 `cmd/launch/command_test.go` (+7 -10) 📝 `cmd/launch/droid.go` (+1 -1) 📝 `cmd/launch/droid_test.go` (+2 -2) 📝 `cmd/launch/hermes.go` (+1 -1) 📝 `cmd/launch/integrations_test.go` (+1 -1) 📝 `cmd/launch/launch.go` (+3 -3) 📝 `cmd/launch/launch_test.go` (+0 -26) 📝 `cmd/launch/models.go` (+3 -33) 📝 `cmd/launch/openclaw.go` (+1 -1) 📝 `cmd/launch/openclaw_test.go` (+3 -2) 📝 `cmd/launch/opencode.go` (+1 -1) 📝 `cmd/launch/pi.go` (+2 -2) 📝 `cmd/launch/pi_test.go` (+57 -0) 📝 `cmd/launch/vscode.go` (+2 -2) 📝 `cmd/launch/vscode_test.go` (+47 -0) </details> ### 📄 Description ## Summary Simplify `ollama launch` backup handling for integration-managed config writes. This change: - stores launcher-created backups under `~/.ollama/backup` - groups backups by integration directory instead of prefixing filenames - removes the backup/config warning prompt before integration config edits - keeps only the 5 most recent backups per file - treats unchanged config writes as a true no-op Examples: - `~/.ollama/backup/droid/settings.json.<timestamp>` - `~/.ollama/backup/openclaw/openclaw.json.<timestamp>` - `~/.ollama/backup/pi/models.json.<timestamp>` - `~/.ollama/backup/pi/settings.json.<timestamp>` - `~/.ollama/backup/vscode/chatLanguageModels.json.<timestamp>` ## What changed - Updated the backup root from the temp dir to `~/.ollama/backup` - Stored integration-managed backups under per-integration subdirectories - Kept backup filenames based on the original config filename - Removed the config-edit backup/config prompt from `ollama launch` - Capped backups at 5 per file - Skipped writes and backups entirely when the config content is unchanged ## Testing Ran: - `go test ./cmd/internal/fileutil` - `go test ./cmd/launch -run 'TestDroidEdit_BackupCreated|TestOpenclawEdit_BackupCreated|TestVSCodeEdit_CreatesDistinctBackupsForManagedFiles'` - `go test ./cmd/launch -run '^TestDoesNotExist$'` - `go test -count=1 -benchtime=1x ./cmd/launch/...` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-05 10:19:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#77648