In attempting to write come content into opencode.json via payloads.content it first failed with 'local path does not exist' until a little investigation with Cursor and Opus 4.6 revealed a minor issue:
ResolvePayloads wrote inline content: temp files into payloadDir, which createSandbox then renamed to a staging directory. The rename invalidated the temp file paths stored in extraUploads, causing every retry to fail with the same stale path.
Use a separate temp directory for inline content payloads so their paths survive the payloadDir rename.
Fix with test available at fix/resolve-payloads-rename.
Full disclosure, I haven't exhaustively looked a the implications of the fix outside of having a test written and ensuring the before was broken and the after was fixed along with actually solving my problem which was to connect to a local llama.cpp inference endpoint.
In attempting to write come content into opencode.json via payloads.content it first failed with 'local path does not exist' until a little investigation with Cursor and Opus 4.6 revealed a minor issue:
ResolvePayloads wrote inline content: temp files into payloadDir, which createSandbox then renamed to a staging directory. The rename invalidated the temp file paths stored in extraUploads, causing every retry to fail with the same stale path.
Use a separate temp directory for inline content payloads so their paths survive the payloadDir rename.
Fix with test available at fix/resolve-payloads-rename.
Full disclosure, I haven't exhaustively looked a the implications of the fix outside of having a test written and ensuring the before was broken and the after was fixed along with actually solving my problem which was to connect to a local llama.cpp inference endpoint.