opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(app) TypeError: Failed to execute 'set' on 'Headers': String contains non IS0-8859-1 code point.

Open Eric-Guo opened this issue 1 week ago • 2 comments

Why it crashed

mergeConfigs() calls mergeHeaders(), which ends up doing Headers.set(...). In Tauri/WebView, Headers.set() throws if the header key/value contains characters outside ISO‑8859‑1. We were putting a raw filesystem path into x-opencode-directory, and paths can contain Unicode.

Fix (implemented)

SDK: URL-encode the directory header as opencode-uri: + encodeURIComponent(directory) (done for both v1 + v2 clients). Server: If the incoming directory value starts with opencode-uri:, decode it before using it.

企业微信截图_17676675582211

Eric-Guo avatar Jan 06 '26 04:01 Eric-Guo