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
fix(provider): note file/dir @-mentions as text instead of failing the turn (#58)
* fix(provider): note file/dir @-mentions as text instead of failing the turn
The local Cursor SDK agent (the only backend the chat path uses) cannot
accept attachments in any form: `{url}` images throw "URL images are only
supported for cloud SDK agents", and inline `{data,mimeType}` base64 images
end the run with an empty `status:"error"` — surfacing to users as
"Cursor run ended with status error" on an `@image` or `@directory` mention.
Stop attaching file parts via SDKUserMessage.images. Route every non-text
file part (images, PDFs, directories, other media) through a text note so
the run always completes and the agent still learns a file was referenced.
Applies to both promptToCursorMessage and latestUserMessage (fresh + resumed
turns). Text/plain and directory mentions that opencode inlines upstream are
unaffected.
* test(provider): cover directory @-mentions and no-filename fallback
Add explicit unit tests for application/x-directory file parts (the case
that regressed) in both promptToCursorMessage and latestUserMessage, and a
test asserting the note falls back to the source file URL when a file part
has no filename (exercises describeSource).
* fix(provider): guard file notes against raw base64 data
describeSource returned any non-data: string verbatim, so a raw base64
file part with no filename inlined the whole blob into the note text.
Now only URL-shaped strings are used as names; everything else falls
back to "file". file:// sources are emitted as filesystem paths (via
fileURLToPath, href fallback on invalid URLs) since the local agent's
workspace tools act on paths.
0 commit comments