Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbe6a1f0c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/app/api/chat/route.ts
Outdated
| const signedUrl = await signCanonicalAttachmentUrl(part.url, userId) | ||
| if (!signedUrl) return part | ||
|
|
There was a problem hiding this comment.
Reject unsignable attachments before calling the model
If signCanonicalAttachmentUrl fails, this branch keeps the original supabase://... URL in the outgoing message part and still proceeds to convertToModelMessages; providers generally need fetchable HTTP/data URLs for file parts, so a transient signing/storage failure can turn a valid user message into a model-call failure (or silently dropped attachment). The request should fail fast (or drop the file part explicitly) instead of forwarding an unusable canonical URI.
Useful? React with 👍 / 👎.
src/dal/chat.ts
Outdated
| if (error || !data) { | ||
| console.error("Failed to batch sign attachment URLs", error) | ||
| return messages |
There was a problem hiding this comment.
Do not return canonical URLs when batch signing fails
When batch signing fails, this returns messages with raw canonical supabase://... attachment URLs unchanged; those URLs are not directly consumable by the browser or model providers, so any temporary Supabase signing outage can break attachment rendering and poison the model context for that request. It is safer to fail the chat load/send path or strip file parts than to propagate unusable canonical URIs.
Useful? React with 👍 / 👎.
No description provided.