Skip to content

fix(core): tolerate missing workspace names - #41610

Closed
opencode-agent[bot] wants to merge 1 commit into
devfrom
migration-journal
Closed

opencode-agent[bot] wants to merge 1 commit into
devfrom
migration-journal

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • detect whether a legacy workspace table has the name column before rebuilding it
  • use an empty name only when that legacy column is absent
  • add a regression test reproducing the exact no such column: name failure

Why

Some drifted legacy databases contain the newer workspace fields but lack workspace.name. Migration 20260410174513_workspace-name unconditionally selected that column while rebuilding the table, so affected Desktop upgrades failed during local server startup.

The migration now keeps its existing rebuild behavior and changes only the copied name expression. Existing names are preserved; databases without the column receive the target schema's empty default value.

Closes #32430

Testing

  • bun test test/database-migration.test.ts (17 passed)
  • bun typecheck
  • bun x prettier --check src/database/migration/20260410174513_workspace-name.ts test/database-migration.test.ts
  • git diff --check

Requested by: @neriousy (Filip via Slack)

@opencode-agent opencode-agent Bot changed the title fix(core): recover legacy drizzle journals fix(core): tolerate missing workspace names Aug 10, 2026
@rvdbreemen

Copy link
Copy Markdown

Additional Windows reproduction evidence: OpenCode Desktop 1.18.18 logged a fatal renderer error, no such column: name, immediately after its sidecar exited with code 1 during startup. The ADR Kit native plugin was not involved: the crash was logged on 2026-08-13, before the native plugin session began on 2026-08-14. A subsequent CLI startup completed at 2026-08-13T21:57:44Z and left a healthy migrated database. This confirms the desktop-upgrade failure mode addressed here. PR #37707 appears to cover the separate legacy Drizzle-journal path that can produce the same SQLite error.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop upgrade can fail on workspace migration

1 participant