fix(desktop): restore the managed default project on startup by pupa-jupa · Pull Request #57779 · anomalyco/opencode · GitHub
Skip to content

fix(desktop): restore the managed default project on startup - #57779

Draft
pupa-jupa wants to merge 1 commit into
anomalyco:devfrom
pupa-jupa:restore-default-project
Draft

pupa-jupa wants to merge 1 commit into
anomalyco:devfrom
pupa-jupa:restore-default-project

Conversation

@pupa-jupa

Copy link
Copy Markdown

Issue for this PR

Fixes #57777

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Desktop creates its default project during onboarding, but a later missing folder leaves restored tabs without models. Record the original path after successful creation and recreate that managed directory before startup releases restored tabs. Filesystem failures are logged without blocking startup; existing files are preserved.

The saved path survives upgrades and locale changes. Profiles without a recorded path are left unchanged: older builds did not persist enough identity to distinguish a Desktop-created folder from a user project safely. This is narrower than the unavailable-project UI in the closed #50952.

How did you verify your code works?

  • Bun 1.4.2: new default-project tests plus existing settings/install-state tests, 7 passed. The 3 new cases also passed 10 consecutive runs.
  • Disabling the restore operation makes the restart regression fail with ENOENT; restoring it passes.
  • Focused TypeScript check passes. Focused repository oxlint reports only the existing typeof current warning in onboarding; git diff --check passes.
  • Full bun run check is blocked locally: the monorepo dependency installation ran out of disk space, and the selective dependency setup lacks the remaining workspace tooling. This is a draft pending complete workspace/CI verification.

The tests use the real filesystem and settings store, covering a localized saved path, existing content, an unrecorded profile, and a conflicting file. They do not launch Electron.

Screenshots / recordings

No layout changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

This branch has not been deployed

No deployments
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.

desktop: automatically created default project is not restored on restart

1 participant