Skip to content

feat(desktop): keep app.db in the CodeWork home under desktop/<channel> - #158

Merged
sanchitrk merged 1 commit into
canaryfrom
claude/desktop-app-db-home
Nov 13, 2026
Merged

sanchitrk merged 1 commit into
canaryfrom
claude/desktop-app-db-home

Conversation

@sanchitrk

@sanchitrk sanchitrk commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

The desktop's database moves out of Electron's userData folder into the CodeWork home, like the CLI's own data:

Build Database
From the repo <home>/desktop/local/app.db
Canary / Dev / Latest <home>/desktop/canary/app.db, …/dev/…, …/latest/…

<home> is CODEWORK_HOME_DIR, else ~/.codework.

  • apps/server: resolves the path with the same home logic the built-in server uses (Servers.cliHome) and creates the folder. CODEWORK_DATABASE still names a file directly (tests).
  • apps/desktop: Electron main passes only CODEWORK_CHANNEL. A packaged build reads its channel from package.json, where electron.config.ts now writes it; from the repo it is local. manifest.ts reads that file for the channel and the Windows app id.

Existing app.db files in userData are not moved: nothing is in production yet.

Verified: the server run from source with a temp home and CODEWORK_CHANNEL=local announces ready and creates desktop/local/app.db with its 16 tables; apps/server schema, health and desk tests; vp check; vp run typecheck. Not run: the Electron app and a packaged build.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The desktop's database moves from Electron's userData folder to
<CodeWork home>/desktop/<channel>/app.db, beside the CLI's data: the home
is CODEWORK_HOME_DIR, else ~/.codework, resolved the way the built-in
server's already is. The app server works out the path and creates the
folder; Electron main passes only CODEWORK_CHANNEL (latest, dev or canary
from the packaged package.json, where electron.config.ts writes it, and
`local` running from the repo). CODEWORK_DATABASE still names a file
directly, for tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit 188b009 into canary Nov 13, 2026
1 check passed
@sanchitrk
sanchitrk deleted the claude/desktop-app-db-home branch November 13, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant