opencode
opencode copied to clipboard
fix(app) TypeError: Failed to execute 'set' on 'Headers': String contains non IS0-8859-1 code point.
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.