You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Non-ASCII (Korean/CJK) characters in directory path cause "Header has invalid value" error (regression in v1.1.56) #13167
opencode crashes on startup when the working directory path contains non-ASCII characters (Korean, CJK, etc.).
This is a regression introduced between v1.1.53 and v1.1.56.
Error
TypeError: Header 'x-opencode-directory' has invalid value
at mergeHeaders (../sdk/js/src/gen/client/utils.gen.ts:184:23)
at mergeConfigs (../sdk/js/src/gen/client/utils.gen.ts:161:20)
at createClient (../sdk/js/src/gen/client/client.gen.ts:21:17)
at createOpencodeClient (../sdk/js/src/gen/client/client.gen.ts:135:10)
Root Cause
The x-opencode-directory HTTP header is set with the raw directory path string. The Web Headers.set() API only accepts Latin1 (ISO-8859-1) characters, so any path containing Korean, CJK, or other non-Latin1 characters causes a TypeError.
Reproduction
Create a directory with non-ASCII characters in the path:
mkdir C:\temp\test\한글경로\coding
Run opencode v1.1.56 in that directory:
cd C:\temp\test\한글경로\coding
opencode
Observe the TypeError crash.
Version Testing Results
Version
Result
v1.1.36
✅ Works
v1.1.49
✅ Works
v1.1.50
✅ Works
v1.1.53
✅ Works
v1.1.56
❌ Fails
Environment
OS: Windows 10 (Build 26200.7840)
opencode: v1.1.56 (installed via scoop)
Node: v24.13.0
Bun: 1.3.9
Suggested Fix
URL-encode or Base64-encode the x-opencode-directory header value before passing it to Headers.set(). For example:
// Before (broken for non-ASCII)headers.set('x-opencode-directory',directory);// After (safe for all characters)headers.set('x-opencode-directory',encodeURIComponent(directory));
On the receiving end, decode with decodeURIComponent().
All of these appear to be related to the same root cause you've identified: the x-opencode-directory HTTP header not properly encoding non-ASCII characters in v1.1.56.
Activity
github-actions commentedon Feb 11, 2026
This issue appears to be a duplicate or closely related to existing reports about the same regression. Please check these issues:
All of these appear to be related to the same root cause you've identified: the x-opencode-directory HTTP header not properly encoding non-ASCII characters in v1.1.56.
ars-ppi commentedon Feb 12, 2026
Tested the below versions:
Results
@rekram1-node I think this and related issues can be closed.
github-actions commentedon Apr 14, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.