Repository navigation
Desktop crashes repeatedly with NotFoundError after task completion (non-git directory, 1.2GB DB) #26122
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Description
Description
OpenCode Desktop crashes repeatedly with service=server error=NotFoundError failed after task completion. The CLI backend (opencode.exe) remains unaffected — only the Desktop (Electron) GUI crashes and auto-restarts.
Pattern: Task completes → Desktop crashes → restarts → crashes again within 3-6 seconds → eventually stabilizes after a few cycles.
Today alone the Desktop has restarted 8+ times following this pattern.
Environment
- OpenCode Desktop: Latest (installed 2026-05-07,
anomalyco/opencodevia electron-updater) - CLI:
opencode.exefrom~/.opencode/bin/ - OS: Windows 11
- Working directory:
D:\yhl10000(NOT a git repository) - Database size:
opencode.db= 1.2 GB + WAL 6.3 MB - DB location:
C:\Users\hoyu\.local\share\opencode\opencode.db - DB created: 2026-02-24 (3 months of accumulated session data)
Error Logs
Every crash log (~/.local/share/opencode/log/) ends identically:
ERROR 2026-05-07T04:19:15 +3105ms service=server error=NotFoundError failed
ERROR 2026-05-07T04:19:15 +9ms service=server error=NotFoundError failed
ERROR 2026-05-07T04:19:16 +353ms service=server error=NotFoundError failed
(log ends = process exits)
Additional errors seen on startup:
ERROR service=plugin.copilot error=The operation was aborted due to timeout failed to fetch copilot models
ERROR service=mcp clientName=azure_mcp error=MCP error -32601: Method 'prompts/list' is not available. failed to get prompts
Steps to Reproduce
- Run OpenCode Desktop in a non-git directory (no
.gitfolder) - Accumulate a large session database (1+ GB over weeks of usage)
- Execute a task that produces substantial output (e.g., file generation, multi-tool operations)
- Task completes → Desktop crashes
- Desktop auto-restarts but crashes again within seconds (NotFoundError on session restore)
- After 2-3 restart cycles, eventually stabilizes
Root Cause Analysis
Based on log analysis:
- The NotFoundError occurs during Desktop's
service=serverrequest handling - It appears the Desktop tries to restore/reload the last session after restart
- Since the working directory is NOT a git repo,
projectIDresolves to"global" - The session may have been stored under a different project scope, or the 1.2GB DB causes lookup failures
- The error is unhandled — it crashes the app instead of gracefully recovering
Key Observations
| Signal | Data |
|---|---|
| DB size | 1.2 GB (created 3 months ago, continuously growing) |
| WAL size | 6.3 MB |
| Crash log size | ~75 KB each (only startup + duplicate skill warnings + NotFoundError) |
| CLI backend | Survives all crashes (PID stable from yesterday) |
| Desktop lifetime | 3-30 seconds per cycle during crash loop |
| Working directory | Non-git (D:\yhl10000) |
Expected Behavior
NotFoundErrorshould be caught gracefully — clear stale session reference and recover to project view- Desktop should not crash-loop when session restore fails
- Large databases (1GB+) should not cause session lookup failures
Related Issues
- [Bug] History session cannot be viewed in OpenCode Desktop - Session not found error #19191 — Same error (
NotFoundError failed), same platform (Windows Desktop), session not found - Desktop: switching servers can restore stale session IDs and crash with "Session not found" #25131 — Stale session IDs causing NotFoundError crash (different trigger: server switching)
- opencode desktop crash seems to corrupt opencode.db #24780 — Desktop crash corrupting opencode.db
- Session lookup fails with NotFoundError when PTY spawned from non-git directory context #8538 — NotFoundError when PTY spawned from non-git directory (same "global" project ID issue)
Plugins
{
"plugin": [
"opencode-antigravity-auth",
"oh-my-openagent@3.17.14",
"opencode-openai-codex-auth"
]
}OpenCode version
Latest (2026-05-07 build)
Operating System
Windows 11
Terminal
OpenCode Desktop (Electron + WebView2)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon May 7, 2026
This issue might be a duplicate of existing issues. Please check:
NotFoundErrorcrash on OpenCode Desktop — session not found errorgithub-actions commentedon Jul 8, 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.