Repository navigation
Description
Description
After upgrading to OpenCode Desktop v1.17.11, the app shows ConfigInvalidError at startup in renderer.log. The sidebar shows no projects (or a partial list), even though sessions exist in the SQLite database. This affects non-git directories on Windows.
Root Cause
Two separate issues combine to cause this:
1. variant: null in workspace .dat files causes ConfigInvalidError
The workspace .dat files (%APPDATA%\ai.opencode.desktop\opencode.workspace.*.dat) store session model selection as JSON strings in workspace:model-selection. Some entries contain "variant": null:
"workspace:model-selection": "{\"session\":{\"ses_xxx\":{\"agent\":\"build\",\"model\":{\"modelID\":\"big-pickle\",\"providerID\":\"opencode\"},\"variant\":null}}}"The renderer process validates this JSON against a schema that rejects null for the variant field — the field is optional (some sessions don't have it at all), but null is not a valid value. This causes ConfigInvalidError in the Electron renderer at startup.
Other sessions in the same .dat files have no variant field at all and work fine:
"ses_yyy":{"agent":"build","model":{"providerID":"opencode","modelID":"big-pickle"}}2. Missing project entries in opencode.global.dat sidebar list
The opencode.global.dat file contains server.projects.local[] — the list of projects shown in the desktop sidebar. After migration, this list can be incomplete. Directories with sessions but no sidebar entry will not appear, making those sessions invisible in the UI.
Environment
- OpenCode version: Desktop v1.17.11 (Electron)
- OS: Windows 10/11
- Terminal: N/A (desktop app)
- Repository: Non-git directory (project_id = 'global')
Steps to Reproduce
- Use OpenCode Desktop with multiple non-git project directories
- Have sessions with
"variant": nullstored in workspace.datfiles - Launch the desktop app
- Observe
ConfigInvalidErrorin%APPDATA%\ai.opencode.desktop\logs\<timestamp>\renderer.log - Observe missing projects in the sidebar
Impact
- Sessions become inaccessible from the desktop UI
ConfigInvalidErrorspams the renderer log (5 occurrences at startup)- User must manually edit
.datfiles to recover access
Workaround / Fix
Fix 1: Remove variant: null from workspace .dat files
Edit each affected opencode.workspace.*.dat file in %APPDATA%\ai.opencode.desktop\:
- Locate entries with
"variant":nullin theworkspace:model-selectionJSON string - Remove
,"variant":nullfrom each session entry - Ensure the resulting JSON is valid
Example fix:
// Before:
"ses_xxx":{"agent":"build","model":{"modelID":"big-pickle","providerID":"opencode"},"variant":null}
// After:
"ses_xxx":{"agent":"build","model":{"modelID":"big-pickle","providerID":"opencode"}}Fix 2: Add missing projects to sidebar list
Edit opencode.global.dat in %APPDATA%\ai.opencode.desktop\:
- Parse the
serverJSON string - Add entries to
server.projects.local[]for any directory that has sessions but is not listed - Each entry:
{"worktree": "C:\\path\\to\\project", "expanded": true} - Restart the desktop app
Additional Notes
- The
workspacetable andworkspace_idcolumn are not involved — the desktop app loads sessions byproject_idanddirectory, not byworkspace_id. All 124 sessions in our DB haveworkspace_id = NULL(from migration20260604172448per issue bug: migration 20260604172448 deletes entire event log for all users on next release #30963), but this does not affect the desktop app. - The CLI/TUI does not have this issue — only the Electron desktop app's renderer process validates the
.datfile schema strictly. - All sessions have
project_id = 'global'(non-git directories) — this is expected and correct. eventtable andmessagetable are intact — no data loss despite the migration.
Related Issues
- bug: migration 20260604172448 deletes entire event log for all users on next release #30963 — Migration
20260604172448setsworkspace_id = NULLon all sessions - After upgrading to OpenCode v1.2.21, previous sessions disappear from the TUI session list. #16579 — Session project_id migration from
'global'to git SHA - Desktop/Windows: newly opened project has sessions in SQLite but missing history/sidebar because opencode.global.dat is not updated #26207 — Desktop sidebar project list management
Plugins
none
OpenCode version
Desktop v1.17.11 (Electron)
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Activity
github-actions commentedon Jun 25, 2026
This issue might be a duplicate of existing issues. Please check:
.datfiles) are cleared — sameopencode.global.dat/opencode.workspace.*.datroot cause and workaroundConfigInvalidErrorat startupIf your issue is distinct from the above (e.g. specifically about
variant: nullschema rejection), please add a note clarifying how it differs.pjzzzz commentedon Jun 25, 2026
How This Differs From Similar Issues
variant: nullas the specific schema rejection causingConfigInvalidError. This report provides the exact root cause:variant: nullis invalid in the renderer's JSON schema validator.ConfigInvalidError. The root cause is different fromvariant: nullon Windows.Related Issues
20260604172448setsworkspace_id = NULLon all sessions'global'to git SHA[-]Desktop app shows ConfigInvalidError and no sessions in sidebar after upgrade[/-][+][BUG]: Desktop app shows ConfigInvalidError and no sessions in sidebar after upgrade[/+]pjzzzz commentedon Jun 25, 2026
OpenCode Issue #33938 — ConfigInvalidError and missing sidebar projects
Findings after recovery (2026-06-25)
1. variant:null confirmed
The
variant:nullbug in workspace.datfiles was found in a non-git project: "workspace:model-selection": "{"session":{"ses_xxx":{"agent":"build","model":{"providerID":"opencode","modelID":"big-pickle"},
"variant":null}}}"
Fix: Remove
"variant":nullfrom the JSON string — the session works without ConfigInvalidError afterwards.2. Missing sidebar projects reproducible
The working
opencode.global.dat(122KB) contained 5 projects inserver.projects.local[]. The broken version (15KB) had only 1 project — the rest had disappeared. All sessions in the SQLite database were intact.Fix: Restored working backup
global.dat+ all workspace.datfiles from the same backup.3. Workspace .dat file consistency is critical
Restoring only
global.datis not enough — the workspace.datfiles contain session-specific data (model-selection, prompts, followup state) that must be consistent with the session IDs inglobal.dat.The backup had 8 workspace
.datfiles, the live state had 10 (2 created after the backup). After restore both matched.4. Recovery process
Restored via a manual script (outside OpenCode Desktop):
taskkill /f /im OpenCode.exe)global.dat+ 8 workspace.datfiles to%APPDATA%\ai.opencode.desktop\5. Recommendations for OpenCode Desktop
variant:nullvalidation: The schema validator in the renderer should acceptnullfor optional fields, or the backend should stripvariant: nullduring serialization.server.projects.local[], the app should auto-add it, or at least provide a "scan for missing projects" button.ConfigInvalidErrorappears inrenderer.logbut is invisible to end users. Consider a badge or notification in the UI.StarDreamG commentedon Jul 1, 2026
I can reproduce a very similar Desktop sidebar/project loss on macOS with Desktop v1.17.12.
Environment:
OpenCode Desktop: v1.17.12
OS: macOS, Apple Silicon
Plugins: none
Config only contains one local MCP server (
codegraph)CLI is not installed (
opencode: command not found), Desktop onlyObserved behavior:
After first launch/restart on v1.17.12, the Desktop sidebar no longer shows previous projects/sessions.
Chat/session data is not lost.
Removing/renaming
~/Library/Application Support/ai.opencode.desktop/opencode.global.datandopencode.workspace*.datdid not rebuild the sidebar/project UI correctly; it also cleared the remaining UI project list.SQLite checks:
github-actions commentedon Aug 31, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.