Repository navigation
Add settings backup, import review, and recovery points - #26826
Draft
namjun719-glitch wants to merge 19 commits into
Draft
namjun719-glitch wants to merge 19 commits into
namjun719-glitch wants to merge 19 commits into
Conversation
Adds Settings > Backup & Restore so users can move Orca preferences to another computer (stablyai#26799, stablyai#4382): - Export chosen setting groups to a versioned .orca-settings.json file with a SHA-256 integrity digest. Credentials, accounts, consent/grants and machine identity are never exported, and free-form values that look like tokens are dropped. - Import validates the file (size, JSON shape, prototype keys, format version, integrity), shows a per-setting diff, and applies only the rows the user keeps checked. Device settings from another OS start unchecked; protected or unknown keys can never be applied. - A recovery point of the touched keys is saved before every import or restore (last 10 kept); a failed apply rolls back automatically. - Every GlobalSettings key is classified in one exhaustive catalog, so a new setting fails typecheck until its backup policy is decided. - The settings:set write path moves to settings-write.ts so imports reuse the same normalization and side effects as manual edits. - User guide in docs/settings-backup-and-restore{,.ko}.md with storage locations, manual-copy cautions and cross-OS notes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…settings-backup-restore # Conflicts: # src/renderer/src/i18n/locales/en.json
7 of 9 tasks
…settings-backup-restore Keeps both new en.json groups (BackupRestorePane, SettingsHostScopePicker) and classifies the new claudeCopiedSystemDefaultNoticeDismissed setting as internal so the dismissed notice never travels in a backup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…settings-backup-restore settings:set now lives in settings-write.ts, so carry stablyai#27199 there: the write path returns store.getSettings() after side effects instead of the pre-side-effect result. Adds a test covering that. Takes the renamed default-host error message from stablyai#27286 as-is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both sides of the en/ko locale conflicts (settings backup dialog strings and the new agent environment strings). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both sides of the ko locale conflict (settings backup pane strings and the new ZCode setup / host scope picker strings). Classify the new nativeChatPermissionMode setting as protected so a backup file can never widen what agent chats may do without asking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port the tray menu rebuild on language change from the settings:set handler into applySettingsWrite. Keep the settings backup locale keys and take upstream's move of the agent environment strings. Classify the new experimentalWslHosts (experimental) and deprecated newWorkspaceSetupOnly (internal) settings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both sides of the ko locale conflict (settings backup pane strings and the new host move-anyway strings). Classify the new jiraIssueKeyCasing setting under the git section. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port the flush-on-write for alwaysForceDeletePreservedBranches from the settings:set handler into applySettingsWrite, and classify the new setting under general next to alwaysForceDeleteWorktrees. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Follow the move of runtime-environment-preference into runtime-environments/. Drop the removed setupScriptLaunchMode from the backup catalog and classify the new settings: nativeChatProviders and claudeAccountSwitchRunningSessions (agents), and the one-shot sshRemoteCliControlExistingHostsMigrated guard (internal). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Route applySettingsWrite through the new sanitizeNetworkSettings so the Node download mirror is normalized like the proxy fields. Classify nodeDistMirrorUrl and agentNativeChatPermissionModes as protected: a backup file must not redirect where Orca downloads executables from or widen what agent chats may do without asking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both sides of the en/ko locale conflicts (Backup & Restore nav strings and the new remote servers description). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Take upstream's SettingsContentScrollElementProvider wrapper around the settings sections and keep the Backup & Restore section after Privacy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port the agent dashboard telemetry and the shortened comments from the settings:set handler into applySettingsWrite, and keep the backup bridge methods in SettingsApi. Classify the new settings: browser link and profile scope (browser), agent permission default/overrides and connectors (protected), and the Portuguese migration guard (internal). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port the Claude agent view reconcile from the settings:set handler into applySettingsWrite. Drop the removed agentNativeChatPermissionModes from the backup catalog and classify the new claudeSubagentNavigationEnabled (agents) and orchestrationChatErrorEscalationEnabled (protected, so a backup cannot silence worker failure escalation). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port the electron-updater proxy apply from the settings:set handler into applySettingsWrite. Classify the new orchestration heartbeat settings as protected, matching upstream keeping them renderer-only so a backup cannot change worker oversight policy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rebuild applySettingsWrite from upstream's settings:set body so it picks up the module moves (persistence store, power, window, updater lifecycle, worktree creation, Claude agent view) and the new pluginExternalHostGrants renderer guard. Keep SettingsApi's backup methods beside the new terminal config import previews, and keep both sides of the en/ko settings search strings. Follow upstream's GlobalSettings split into feature modules in the backup catalog: drop removed keys (experimentalNativeChat, worker error escalation, heartbeats) and classify the 35 new ones. Plugin trust (external host grants, replacements, update policy) and cross-account Codex history sharing are protected; dismissals, kill switches and host-keyed profile ids are internal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pass getIntlLocale() to the recovery-point and import-review timestamps so they follow Orca's UI language instead of the OS locale, as the new renderer-intl-ui-locale rule requires. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
You can now save your Orca settings to a file and load that file on another computer. Before anything changes, Orca shows you what would change and lets you pick. Orca also saves the old values first, so you can undo an import. Passwords, API keys, tokens, and signed-in accounts never go into the file.
What Changed
Before: there was no way to move settings between machines. Users re-entered every preference on each PC, or copied the data folder by hand. That copy also carries machine IDs, local paths, and secrets that can't be decrypted on the other machine.
After: a new desktop-only pane, Settings → Backup & Restore, with three parts:
*.orca-settings.jsonfile.How it works:
src/shared/settings-backup/settings-backup-catalog.tsclassifies everyGlobalSettingskey as a section,protected(credentials, accounts, consent and capability grants), orinternal(migration guards, kill switches, local IDs). It usessatisfies Record<keyof GlobalSettings, …>, so adding a setting fails typecheck until someone decides whether it may leave the machine.ghp_…,sk-…, private keys,user:pass@URLs, and similar) and reports how many were left out. Machine-bound nested fields (the custom notification sound path, muted sources) stay local.src/main/settings-backup/) checks, in order: size cap (5 MB), JSON parse with__proto__/constructor/prototypestripped, format and version, plain-JSON shape, and a SHA-256 digest over the canonical body. Damaged or hand-edited files are refused without touching settings. Unknown, protected, malformed, or secret-like keys are listed as "Not imported" and can never be applied. This device rows from another OS start unchecked.settings:sethandler moved unchanged intosrc/main/ipc/settings-write.ts(applySettingsWrite). Imports and restores therefore go through the same sanitization, normalization, and side effects (proxy, hooks, menu, language, and so on) as a manual change.docs/settings-backup-and-restore.md(and.ko.md).Why
The linked issues ask for export/import first and cloud sync second. A local file covers the main case (new PC, reinstall, work and home PCs) with no account, server, or ongoing cost. It is also the foundation any later sync would need anyway: a format, a key policy, validation, and rollback.
Alternatives considered:
orca-data.json/ the profile folder: this carries OS-encrypted secrets, machine IDs, and absolute paths, and the profile SQLite database is unsafe to copy while Orca runs.GlobalSettingswholesale: this would leak cookies and proxy credentials, and would let a file grant permissions such as artifact publishing or plugin consent.Out of scope here: account or cloud sync, encrypted backups that include secrets, device management, and
~/.orca/keybindings.json(the guide explains how to copy it by hand).Linked Issue
Fixes #26799
Also addresses the export/import part of #4382.
Visual Proof
Not attached yet. I could not build the Electron app on the machine used for this change (native modules not built). Screenshots of the export, review, and recovery-point states will follow. Behavior is covered by the component test below.
Testing
Verified on Windows 11 (no app launch):
pnpm tcpasses.src/main/ipc/settings.test.ts(exercises the moved write path), settings navigation metadata, and the settings sidebar.pnpm run check:code-quality:changed, oxlint on changed files,check:max-lines-ratchet,check:reliability-gates, andverify:localization-catalogs/-extraction/-coveragepass.AI Disclosure
Implemented with Claude Code (Claude Opus 5.5), reviewed and submitted by me.
Review
Self-reviewed for secret handling: protected keys can't be exported or applied, recovery points never snapshot protected keys, and error messages carry no local paths.
Agent skill upstream boundary
Notes
showDesktopOnlySettings; no RPC or wire changes. Per-host overrides and runtime-environment IDs are classifiedinternaland never move.formatVersion, and files from a newer format are refused with a clear message.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code