Repository navigation
Description
Description
Summary
In OpenCode Desktop 2.0.12 for Windows, opening the native file picker (Ctrl+U / attach button in chat, and folder picker) always fails with the toast "Solicitud fallida / Desktop IPC handler failed". The request never reaches dialog.showOpenDialog. Pasting images (Ctrl+V) and drag & drop work fine.
Root cause (confirmed by in-place instrumentation): the renderer builds the FilesOpenFilePicker request payload with fields set to undefined (title: t?.title, extensions: t?.extensions in openAttachmentPickerDialog), and the desktop IPC request schema requires every field to be present as string | null / array | null. Schema decoding rejects undefined/missing fields, so the request dies before the handler runs. Iteratively patching the payload to send null for title and extensions fixed the picker completely.
Environment
- opencode version: 2.0.12 (desktop, channel: latest, packaged: true)
- OS: Windows_NT 10.0.26200 (win32 x64)
- Terminal: Unavailable (desktop app)
- Shell: cmd.exe
- Install/channel: latest (auto-updater reports up-to-date)
- Active plugins: none
Reproduction
- Launch OpenCode Desktop 2.0.12 on Windows.
- Open a chat.
- Press Ctrl+U (or the attach button) to add a file/image.
Expected Behavior
The native file dialog opens; chosen files are attached.
Actual Behavior
A toast appears: "Solicitud fallida / Desktop IPC handler failed". No dialog opens. The failure is completely silent in all logs (main.log, renderer.log, server log).
With an in-place patch that surfaces the underlying defect in the error message, the actual cause is revealed:
- First:
Expected string | null at ["options"]["title"] - After sending
title: null, the next failure:Expected array | null at ["options"]["extensions"] - After sending
nullfor both fields, the picker works.
The schema definitions (main bundle):
Rl = Qi(L) // string | null
zl = oa({multiple: Qi(ta), title: Rl, defaultPath: Rl})
Bl = oa({multiple: Qi(ta), title: Rl, defaultPath: Rl, extensions: Qi($i(L))})
Gl = R(`FilesOpenFilePicker`, {payload: {options: Qi(Bl)}, ...})
The renderer caller (openAttachmentPickerDialog) sends:
e.openFilePicker({multiple: t?.multiple ?? !1, title: t?.title, defaultPath: t?.defaultPath, extensions: t?.extensions})
title and extensions end up as undefined (they are not required by the callers, e.g. the chat attachment flow passes only {defaultPath, multiple}), and the Effect RPC schema decode rejects them. Either the schema should accept undefined/optional fields, or the client should normalize undefined to null before sending.
A related secondary defect observed in earlier sessions: during first-launch onboarding, app.getPath('documents') failed with Failed to get 'documents' path on this machine (transient; resolved after OS restart), which also surfaced as the same "Desktop IPC handler failed" toast. Separately, the "Configuration file" button failed until ~/.config/opencode/opencode.json was created manually — it would be nicer if that button created/opened the default config instead of failing.
Additional Context
- Workarounds that always worked: paste images with Ctrl+V, drag & drop files into the chat window.
- The .NET common file dialog works fine on the same machine (tested via PowerShell), so the Windows shell is healthy — the bug is in the request/schema layer of the desktop app.
- The failure is completely silent: no log entries anywhere when it happens. Logging the IPC exit defect (
console.erroron theDieexit in the renderer) showed nothing because the error surfaced through a different path; surfacing the schema error text in the toast was what finally revealed the cause. A log line for failed desktop IPC requests would make such bugs much easier to diagnose.
Plugins
No response
OpenCode version
2.0.12
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Activity
github-actions commentedon Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
Your root-cause analysis (schema rejecting
undefinedfortitle/extensions) is a valuable addition — please consider adding it as a comment on #50153 if maintainers decide to close this as a duplicate.Vibe-coding-nvm-delete-repo commentedon Sep 22, 2026
Independent packaged-build confirmation, plus the fix PR for the root cause described here:
Fix PR: #50333 normalizes
undefinedat the renderer's request boundary (omit undefined fields, preserve binary payloads) - same root cause, with regression coverage for the picker, directory/save dialogs,openPathand binary uploads.Packaged-build evidence (Desktop 2.0.12, Windows 11 10.0.26200, instrumented shipped IPC port):
Exit: Failure / Die: "Expected string | null at [\"options\"][\"title\"]"#32770 "Choose a file", owned by the app process).Method and raw traces: #50333 (comment)
Scope note for the fix: in the shipped bundle the request boundary (
Utin/out/renderer/assets/main-C16eq30x.js) is shared by everyFiles*,Menu*andWindow*request, so the same undefined-field rejection also coversFilesOpenPath(application), the save dialog and the directory picker - consistent with the PR's regression cases.Workarounds that match your findings: paste with Ctrl+V and drag & drop; the failure is silent in
main.log/renderer.logbecause theDieexit never reaches a logger.Hona commentedon Sep 22, 2026
Fixed in #50599 (merged to
v2as 8e62ad7). The renderer sent optional picker fields asundefined, which the main process's JSON schema codec rejected before the handler ran. The fix lands in the next desktop release after 2.0.12.Workaround until then: drag and drop or paste from the clipboard.
mmarzook3 commentedon Sep 22, 2026
Confirmed on desktop 2.0.13 (
latest, packaged, Windows 10.0.26200.9457): the #50599 fix is not in this build.Evidence (independent instrumentation of the shipped IPC bridge)
out/renderer/assets/main-B7CTUSLz.jsapp.asarsha256:755CB55C833BCE83FA5D73B27C846EAD0E0537A2A388809791C8C33F408DC8E6title/defaultPath/extensions→null,multiple→ boolean), the nativeChoose a filedialog opens, consistent with the fix in fix(desktop): omit undefined fields from renderer IPC payloads #50599.Timing
2026-09-22T10:11Zand started2026-09-22T10:14Z.v2as8e62ad7at2026-09-22T10:52Z.So
latest(2.0.13) predates the fix and still ships the bug. Could the next desktop release be confirmed to include #50599 (omit-undefined fields at the renderer IPC boundary)?Workarounds that bypass the affected RPCs and keep working: drag & drop, and paste with Ctrl+V.