Repository navigation
Desktop: drop documents into a chat instead of rejecting them as non-GGUF (#7661) - #7668
Conversation
…GGUF (unslothai#7661) One window-level Tauri drag handler owned every drop and only took a lone .gguf, so dragging a pdf at the composer got "GGUF models only" while the dom attachment dropzones sat disabled under isTauri, waiting on the token bridging this adds. Rust classifies a dropped document as NativePathKind::Attachment and signs an Attach grant for it; the RAG document routes take that grant in place of a multipart file, re-verify it and copy from the signed path under the usual size cap, so the webview never names a path itself. The drop handler registers the paths and queues them for the thread bar, which owns the upload and can materialize a thread id. Leases are minted per upload since they expire in two minutes. A mixed model+document drop is still refused, and native drops dedup by filename because the webview has no size or mtime for them.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5be7a3c0f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ped doc visible Two things surfaced testing the drop in the desktop shell. The overlay sat at top-4 of a container whose top belongs to the chat header, so the card rendered under it and got clipped. Offset it by the header vars the header fade already uses. A drop with the RAG pill off uploaded and indexed fine, but the thread bar returns null when retrieval is off, so nothing appeared: the file landed in a bar that renders nothing. Dropping a document is the intent, so turn retrieval on and let the chips show. A KB-scoped chat uploads through the KB dialog instead, so refuse that case with a toast rather than indexing into something this bar never displays.
…on a real fingerprint Review follow-ups on the native document drop. register_native_attachment_path signed whatever path the renderer named, so a script in the webview could have registered any readable document and spent it through the RAG upload. Rust now records the paths the OS reports on WindowEvent::DragDrop and refuses to register anything else, with a two minute expiry so a stale drop can't be spent later. NativePathRef carries the size and mtime Rust already stat'd, so a native drop dedups on name|size|mtime like a browser File does. Two different README.md files were previously collapsed into one by the name-only signature. Document drops also wait for native_path_leases_supported. A lease is the only way they reach the ingest, so offering the drop before the backend can verify one just fails after release.
|
Thanks, all four addressed. Codex reviewed P1, require a real drop before signing attachment paths. Fixed in Worth noting the same shape exists on P2, name-only dedup. Fixed. P2, wait for lease support. Fixed. P2, gate on the active RAG thread source. Already fixed in Test status on |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 114370cec7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a448f456fc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |

Fixes #7661.
On desktop, one window-level Tauri drag handler owned every drop and only accepted a lone
.gguf, so dragging a pdf at the composer got "GGUF models only". The dom attachment dropzones were switched off underisTauriwaiting on "Phase 1d token bridging". This adds that bridging, so document drops attach the way they do in the web ui.The enums were already there (
NativePathKind::Attachment,NativePathOperation::Attach), nothing minted or spent them.rust
classify_native_attachment_pathaccepts the RAG upload types and grantsAttach+Revealonly, so an attachment grant can never be spent as a model load.register_native_attachment_pathcommand,NativePathValidationPolicy::Attachmentso the path is re-classified and re-fingerprinted at sign time like model paths are.backend
_save_native_path_uploadverifies the grant (operationattach, kindattachment, file, extension inUPLOAD_EXTS), then copies into the uploads root under the same size cap as a multipart upload. The webview never names a path; it forwards what Rust signed.fileORnativePathLeasethrough_resolve_document_upload.frontend
classifyDropPathsdecides model / docs / unsupported once, used by both the hover overlay and the drop.tests
.exe, refuses model opsLocal runs on this branch:
cargo test98 passed, backend pytest 21 passed (new file plus the neighbouring upload tests),npm test74 passed,npm run buildclean, eslint on the touched features matches main's baseline exactly.Behavior notes: a mixed gguf+doc drop is still refused (ambiguous), and native drops dedup by filename since the webview has no size/mtime for them.
Not included: the Projects source dropzone still silently eats drops on desktop (
project-source-dropzone.tsxhas noisTauriguard). Called out in the issue, separate fix.