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
Long session titles produce unsavable export filenames #54721
sessionExportFilename in packages/app/src/session/commands/export.ts has no length cap, so a long session title produces a filename over the 255-byte filesystem component limit and the export cannot be saved.
Version
2.0.27
Reproduction
Call sessionExportFilename with a 300-character title on current dev. The returned name is over 255 bytes before the .json extension handling.
Thanks for the report. I reproduced this on 2.0.27, and it still happens on the latest dev (773d862).
Calling sessionExportFilename with a 300-character title returns a 305-byte name (aaa…a.json). Writing a file with that name fails with ENAMETOOLONG: name too long. The function cleans up the title but never limits its length. The script below reproduces it.
Your open PR #54726 is the related fix for v2. #49142 was the earlier report of the same problem on v1.
Reproduction script (repro.ts)
// Reproduces #54721: sessionExportFilename has no length cap.// Usage: bun /workspace/repro/repro.ts [path/to/packages/app/src/session/commands/export.ts]// Default: /workspace/repo checkout. For v2.0.27: git show v2.0.27:packages/app/src/session/commands/export.ts > /tmp/opencode/v27/export.tsimport{mkdirSync,writeFileSync,rmSync}from"node:fs"import{join}from"node:path"constpath=process.argv[2]??"/workspace/repo/packages/app/src/session/commands/export.ts"const{ sessionExportFilename }=awaitimport(path)constname: string=sessionExportFilename({id: "ses_test",title: "a".repeat(300)})constbytes=Buffer.byteLength(name)console.log(`source: ${path}`)console.log(`filename length: ${bytes} bytes (limit 255)`)constdir="/tmp/opencode/export-test"mkdirSync(dir,{recursive: true})try{writeFileSync(join(dir,name),"{}")console.log("write: OK")}catch(e: any){console.log(`write failed: ${e.code}${e.message}`)}finally{rmSync(dir,{recursive: true,force: true})}process.exit(bytes>255 ? 1 : 0)
Activity
opencode-agent commentedon Oct 12, 2026
Thanks for the report. I reproduced this on 2.0.27, and it still happens on the latest
dev(773d862).Calling
sessionExportFilenamewith a 300-character title returns a 305-byte name (aaa…a.json). Writing a file with that name fails withENAMETOOLONG: name too long. The function cleans up the title but never limits its length. The script below reproduces it.Your open PR #54726 is the related fix for v2. #49142 was the earlier report of the same problem on v1.
Reproduction script (repro.ts)
Run it:
bun repro.ts