GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(desktop): omit undefined fields from renderer IPC payloads by Hona · Pull Request #50599 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Sep 22, 2026

Copy link
Copy Markdown
Member

Closes #50583, closes #50153, closes #50503, closes #50177, closes #50173, closes #50309

The composer's attach button, the folder picker, save dialogs and openPath all fail with Desktop IPC handler failed since 2.0.11. The native dialog never opens.

Why

#50112 made the renderer post RPC payloads over the MessagePort directly (structured clone, no RpcClient). The main process still decodes with Schema.toCodecJson, where Schema.optional(String) means key absent | string | null. Structured clone keeps a present-but-undefined key, so the request dies in schema decoding before the handler runs.

flowchart LR
  A["files.ts<br/>{ title: options?.title }<br/>→ title: undefined"] --> B["ipc-client.ts<br/>port.postMessage(raw)"]
  B --> C["ipc-transport.ts<br/>codecFor: toCodecJson"]
  C -- "Expected string | null<br/>at [&quot;options&quot;][&quot;title&quot;]" --> D["Cause.Die"]
  D --> E["toast: Desktop IPC handler failed<br/>(cause never shown)"]
  style D fill:#ff5c7a,color:#000
Loading

Before #50112, RpcClient encoded the payload through the same schema and dropped the undefined optionals on the way out. This restores that behaviour at the renderer boundary.

Change

  • omitUndefined drops undefined properties from a request payload the way JSON.stringify would, leaving Uint8Array payloads untouched.
  • ipc-client.ts runs every outgoing request payload through it.
// renderer → main, before
{ options: { multiple: true, title: undefined, defaultPath: "C:\\proj", extensions: undefined } }
// after
{ options: { multiple: true, defaultPath: "C:\\proj" } }

The transport test drives the real FilesOpenFilePicker schema through IpcServerProtocolLive with a raw renderer-style request and asserts both the rejection without normalisation and the success with it.

Affected requests

RPC undefined field Caller
FilesOpenFilePicker title, extensions attach button, Ctrl+U
FilesOpenDirectoryPicker title folder picker
FilesSaveFile title save/export
FilesOpenPath application open path without an app

Drag & drop and clipboard paste bypass these RPCs, which is why they kept working.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
fix(desktop): omit undefined fields from renderer IPC payloads
354e67b
Since anomalyco#50112 the renderer posts RPC payloads over the MessagePort by structured clone, without RpcClient's schema encoding. The main process still decodes with the JSON codec, where an optional field is 'key absent | value | null'. A present key holding undefined, which is what the composer sends for the picker title and extensions, is rejected before the handler runs and surfaces to the user as 'Desktop IPC handler failed'.

Drop undefined properties at the renderer request boundary the way JSON.stringify would, leaving Uint8Array payloads untouched.

Closes anomalyco#50583, closes anomalyco#50153, closes anomalyco#50503, closes anomalyco#50177, closes anomalyco#50173, closes anomalyco#50309
@Hona
Hona requested a review from Brendonovich as a code owner September 22, 2026 10:39
Copilot AI lite review requested due to automatic review settings September 22, 2026 10:39
Copilot AI reviewed Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona merged commit 8e62ad7 into anomalyco:v2 Sep 22, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Sep 22, 2026
Cant attach files in opencode desktop app #50583
Closed
desktop: "Images and files" picker never opens on Windows (Desktop IPC handler failed) #50153
Closed
desktop: file/folder pickers always fail on Windows — request schema rejects undefined for optional options.title / options.extensions ("Desktop IPC handler failed") #50503
Closed
desktop: attaching a file fails with "Desktop IPC handler failed" #50177
Closed
opencode desktop attachments not working report #50173
Closed
desktop: attachment button fails with request failed (desktop IPC handler failed) #50309
Closed
desktop: Export session and Reveal in Explorer fail with "Desktop IPC handler failed" #50216
Closed
desktop: attachment file picker fails instantly with "Desktop IPC handler failed" (regression from 2.0.6) #50621
Closed
@SonicYeager SonicYeager mentioned this pull request Oct 1, 2026
desktop: attach button in chat fails with "Desktop IPC handler failed" on Windows #50963
Closed
@timehub-uk timehub-uk mentioned this pull request Oct 30, 2026
desktop: stale background-service registration causes Desktop IPC handler failed and breaks attachment picker #60729
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@Brendonovich Brendonovich Awaiting requested review from Brendonovich Brendonovich is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Hona
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.