Repository navigation
refactor(desktop): identify as ai.codev.desktop, not ai.opencode.desktop - #224
Merged
Merged
Conversation
The appId is the whole desktop identity. app.setPath("userData",
join(appData, appId)) makes it the data directory name, and it also drives
the macOS bundle id, the Windows AppUserModelId and NSIS keys, the Linux
.desktop filename, executableName and StartupWMClass, and the AppStream
metainfo id. The fork's app was announcing itself to the OS as upstream.
Rename it to ai.codev.desktop{,.beta,.dev}, the deep-link scheme to codev://,
and the Linux packages to codev/codev-beta/codev-dev. The scheme lives in
three places that have to agree — protocols.schemes, setAsDefaultProtocolClient
and the renderer's parseUrl — plus the argv filter the second-instance handler
uses, which is easy to miss.
A clean cut: no data migration and no back-compat shim, since there is no
installed base. Profiles under appData/ai.opencode.desktop* are orphaned
rather than moved, and an installed build will not update across the rename.
The hidden opencode-desktop.desktop launcher goes too — it existed to rescue
pins from a superseded packaging id and its Exec no longer matched any
install layout.
migrate.ts keeps the old ids on purpose: they name the Tauri app's
directories, not ours.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The appId is the whole desktop identity, not just a string in the installer config.
app.setPath("userData", join(app.getPath("appData"), appId))makes it the data directory name, and it also drives the macOS bundle id, the Windows AppUserModelId and NSIS registry keys, the Linux.desktopfilename,executableName,StartupWMClass, and the AppStream metainfo id. The fork's app was announcing itself to the OS as upstream.What changed
ai.opencode.desktop{,.beta,.dev}ai.codev.desktop{,.beta,.dev}opencode://codev://opencode,opencode-beta,opencode-devcodev,codev-beta,codev-devThe appId is duplicated in
src/main/index.tsandelectron-builder.config.ts(plus an unpackaged fallback) — all three moved. The scheme lives in three places that must agree:protocols.schemes,app.setAsDefaultProtocolClient, and the renderer'sparseUrl. There is a fourth, easy to miss: theargv.filter(arg => arg.startsWith(...))in the second-instance handler, which is how deep links arrive on Windows and Linux when the app is already running.The hidden
opencode-desktop.desktoplauncher and its deb/rpm fpm wiring are deleted. It existed to rescue GNOME/KDE pins from a superseded packaging id, and itsExec=/opt/OpenCode/...no longer matched any install layout this repo produces.A clean break, deliberately
Confirmed before starting: no installed base, no migration wanted.
So profiles under
appData/ai.opencode.desktop*are orphaned, not moved — settings, session history, server list, sandboxes and the downloaded guest image. On the dev machine used to verify this that is 4.2 GB sitting under~/.config/ai.opencode.desktop.dev, left untouched for manual deletion. Any existingopencode://link stops working, and a packaged build will not update across the rename: it installs beside the old app rather than replacing it.If that stops being acceptable later, the migration is a
rename()of one directory — nothing inside stores absolute paths (sandbox dirs derive fromuserDataat runtime, socket dirs are hashed per start,image.jsonholds URLs).The trap worth knowing about
src/main/migrate.tshas its ownTAURI_APP_IDSwith the same three strings. Those name the Tauri app's directories, not ours, so they keep the old values and now carry a comment saying why. A find-and-replace across the repo would silently point Tauri migration at a directory that never existed.Verification
electron-builder.config.test.tsnow asserts, per channel, the appId, desktop name, executable name,StartupWMClass,rpm.packageName, and thatprotocols.schemesis["codev"]. The removed legacy-launcher test is replaced by that scheme coverage.Clean across every affected package: desktop 78 tests + typecheck, app 657 unit / 57 browser + typecheck, codev-sandbox 98, codev-brand 7.
Follow-up, not in this PR
packages/codev-brandstill passesopencode://through unchanged when rebranding upstream doc text. That was a deliberate preserve rule; with the scheme renamed it now produces stale docs rather than protected identifiers. Left alone because doc sync is a separate workflow with its own repo — flagged in the test with a comment.Persisted store filenames (
opencode.settings,opencode.global.dat) are also untouched — they are independent of the appId and renaming them is a separate, file-level migration.🤖 Generated with Claude Code