Skip to content

fix: let Freestyle desktop previews reach ready again - #7654

Open
reachjalil wants to merge 3 commits into
devfrom
fix/freestyle-desktop-preview-ready
Open

reachjalil wants to merge 3 commits into
devfrom
fix/freestyle-desktop-preview-ready

Conversation

@reachjalil

Copy link
Copy Markdown
Member

What is this about?

Freestyle desktop previews (pnpm world up preview-desktop --place freestyle) failed on every build, so nobody could open a desktop preview on Freestyle.

What problem does it solve?

Two causes stopped the preview at its ready check, and the failure said nothing useful.

What was the situation before?

Step Before After
Engine v1 on a profile with OPENCODE_DB Exits: "Database is not empty and has no session table" (v2 owns the file) Moves only v1's database and starts
Ready check on a fresh signed-out desktop Fails: free Auto provider and model are present Accepts the built-in free provider only
Failure report Flags only Engine database tables, notable desktop log lines, model state

How is this implemented?

  • apps/server/src/managed-opencode.ts: the v2-owned-database recovery from fix(server): start engine v1 when a standalone OpenCode v2 owns storage #6662 now also applies when OPENCODE_DB is explicit. OpenWork hands that same path to its own v2 engine, so isolated test, preview and dev profiles hit the collision.
  • apps/server/src/opencode-history.ts: after that move, the v1 to v2 history migration reads the moved database first.
  • packages/world-freestyle/src/desktop-state.mjs: the pristine check accepts openwork-free and its model; any other provider or model still fails.
  • packages/world-freestyle/src/desktop-runtime.mjs: on startup failure, print the engine database tables and the desktop log's notable lines.

What else changed?

  • New focused test apps/server/test/managed-opencode-shared-database.test.ts.

Release note

OpenWork starts again when OpenCode is pointed at a custom database (OPENCODE_DB) that OpenCode v2 already uses.

Evidence

  • Freestyle desktop snapshot: ready check fails on engine exit → snapshot builds and reports ready, signed out.
  • bun test test/managed-opencode-shared-database.test.ts: 3 pass; server typecheck clean.

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Nov 21, 2026 1:18am UTC
openwork-den Skipped Skipped Nov 21, 2026 1:18am UTC
openwork-landing Skipped Skipped Nov 21, 2026 1:18am UTC

Request Review

…E_DB

Isolated test, preview and dev profiles set OPENCODE_DB, and OpenWork hands
that same path to its own v2 engine. Once v2 initialized it, engine v1 exited
with "Database is not empty and has no session table", the server never
became ready, and the Freestyle desktop preview snapshot failed every build.

Treat that exit like the default-path collision: move only v1's database to
OpenWork's own storage and retry. The v1 to v2 history migration reads the
moved database, which now wins over the explicit path.

The Freestyle desktop preview now prints the engine database's tables and
the desktop log's notable lines when startup fails.

Signed-off-by: Jalil <reachjalil@gmail.com>
…esktop ready check

A signed-out desktop now provisions the openwork-free provider and selects
its model. The Freestyle preview's pristine check still expected the retired
default model and no providers at all, so the snapshot never reached ready.
Accept the built-in free provider and its model; any other provider or model
still fails the check. On failure, report the model state the check saw.

Signed-off-by: Jalil <reachjalil@gmail.com>
Signed-off-by: Jalil <reachjalil@gmail.com>
@reachjalil
reachjalil force-pushed the fix/freestyle-desktop-preview-ready branch from 60d4476 to 567b309 Compare November 21, 2026 01:18
@vercel
vercel Bot temporarily deployed to Preview – openwork-app November 21, 2026 01:18 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing November 21, 2026 01:18 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den November 21, 2026 01:18 Inactive

This branch was previously deployed

3 inactive deployments
Preview – openwork-app — 567b309f Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-landing — 567b309f Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-den — 567b309f Deployed Nov 21, 2026 by vercel[bot]
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