Repository navigation
Fix file drops in new project chats - #14472
Conversation
## Problem Five checks fail on main, so the `Repo tests (CPU, studio)`, `Repo tests (CPU, rest)` and `workflow-trigger lint` shards are red on every open PR (for example #14472, #14482, #14488, #14490 and #14494). All five reproduce on main `4d7ebf5cea`. | Test | Introduced by | Fault | |---|---|---| | `tests/security/test_lint_risky_loaders.py::test_the_tree_matches_the_baseline` | #14437 | Baseline. Two new dynamic-import sites: `import_module` in `studio/backend/core/rag/embeddings.py`, and a third `import_from_string` in `unsloth/models/sentence_transformer.py` (`_require_word_tokenizer`). Both are safe, see below. | | `tests/studio/test_tauri_branding_contract.py::test_desktop_surfaces_do_not_restore_studio_branding` | #14473 | Product. "Studio" became "Unsloth Studio" in the Markdown import errors and the Tauri webview reject message. The desktop contract allows "Unsloth" there, never "Unsloth Studio". "Unsloth" meets both #14473's rule (no bare "Studio") and this one. | | `tests/studio/test_usage_examples_model_source_contract.py::test_auto_switch_section_sits_above_the_usage_examples` | #14455 | Test. The redesign moved the usage examples above the monitor link on purpose, and its own `api-settings-tab.test.ts` pins that. | | `tests/studio/test_usage_examples_model_source_contract.py::test_monitor_can_unload_the_loaded_model` | #14455 | Test. Unloading moved from a standalone button on the page into the model picker's eject (`ApiModelLoadControls`). The `/unload` path itself is unchanged. | | `tests/studio/test_settings_compact_overflow_contract.py::test_api_monitor_entries_and_expanded_text_can_shrink` | #14455 | Test. Entry rows are now rounded cards (no `border-b`), and the prompt/reply box's `rounded-lg` became conditional, so the class literals the test matched are gone. The overflow guards themselves are still in the source. | ## Fix - **Risky loaders:** two baseline entries with reasons. - `embeddings.py` imports only the three `sentence_transformers.models` paths written out in a literal tuple, to wrap their `import_from_string` with the trust gate. - `_require_word_tokenizer` imports only after its caller has refused any `tokenizer_class` outside `sentence_transformers.*`, and only dotted identifiers. - **Branding:** "Unsloth Studio" to "Unsloth" in those seven Markdown import errors and the Rust reject message. `conversation-markdown-import.test.ts` now matches `/Unsloth Markdown/`. - **#14455 contracts:** rewritten to guard what the redesign keeps: - the auto-switch section still follows the monitor link, and the usage examples come before both; - the page passes `unloadActiveModel` to the load controls as `onUnloadActive`, and eject is withheld while `busy` (`modelLoading || unloading`, #11223's rule); - the `/unload` call still reads the internal id from status; - entry rows keep `w-full min-w-0`; - the prompt/reply box keeps `max-h-72 overflow-auto break-words`; - the model id keeps `min-w-0 break-all`. ## Verification - The four Python files: 78 passed (5 failed on main). - `studio/frontend/tests/conversation-markdown-import.test.ts`: 20 passed. - Sabotage, each run against the rewritten tests, each failing exactly one test: - removing `min-w-0` from the entry row, or `break-words` from the text box: the overflow test fails; - dropping `unloading` from `busy`, or passing `onEject` while busy: the unload test fails; - putting the auto-switch section above the monitor link: the order test fails.
|
That run merged into |
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be92eb4bb9
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
A cancelled add under an unchanged owner and target key requeued into the same queue and re-drained immediately, so a destination that keeps refusing (a tombstoned chat still mounted) spun forever re-reading the file. Retry once, then drop it and cancel any parked send.
The draft-scoped adapter resolves a cancelled add instead of throwing, so the Library handoff counted the file as attached and dropped it. Treat the cancellation as a refusal so attachLibraryChatFiles holds it.
- Cancel when a delegate generator returns without another yield after a draft switch, so native drains requeue instead of losing the file. - Hold native drains until the runtime reaches the route's thread, so a saved project chat's queue cannot drain into the previous chat. - Re-drain images only for the owning composer, matching the other kinds. - Skip removing the pasted selection when the attachment add was cancelled.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Project landing pages show a new-chat composer but reject desktop file drops with “Dropped files need a single chat. Open one, then drop it there.” This enables those drops and routes the file into the project's draft, while preserving Sources drop priority and Compare rejection.
Keep asynchronous attachment work associated with its originating draft. Late reads and adapter results are discarded when an unsaved runtime is reused; files remain associated with their original chat after it is saved and backgrounded. Cancellation cleanup tracks each operation separately.
Before / after
Comparison: merge base
37f53745d15141de71711772c8bb301b6467c968→ PR head1107b7ad447c0867d71da54a4fcc5b5442c47d19. The browser replay uses isolated app instances and controlled HTTP/native bridge fixtures.Saved-chat registration regression (5 November 2026)
Opening a saved project chat through its thread URL during native file registration could leave the attachment in the project's old queue. Commit
98e9a657famakes both routes use the same queue. A Chromium replay with delayed native registration lost the file before the fix and displayed it once after the fix. The regression tests also cover registration finishing while another chat is open.At this head, 14,968 frontend tests passed with one Windows-only skip. All 192 focused tests passed on both WSL and Windows. TypeScript, the production build, and the startup bundle check passed.
Validation after refreshing main (3 November 2026)
Refreshed against main
d6ca61ae0cin92744852c8. Resolved the composer/runtime-provider conflicts while retaining draft ownership and saved-chat attachment handling.The screenshot above and the original test report describe the earlier
1107b7ahead. They remain historical evidence; the refreshed checks are listed separately here.Remaining validation
This is a draft pending packaged Unsloth Desktop drag/drop and native macOS/Safari smoke checks. Browser evidence does not exercise physical OS drops, packaged webviews, or live model inference. GitHub CI has been requested for
98e9a657fa.Packaged Desktop drop smoke (macOS 15 and Windows)
Debug Tauri builds of the merge base (
91935a13e4) and this head (8501ed8f18) were run on GitHub-hostedmacos-15andwindows-latestrunners against a real Studio backend installed withinstall.sh --local --tauri/install.ps1 --local --tauri. A test-only hook does what the runtime does for an OS drop on the main webview: it records the path withNativeIntakeState::note_dropped_paths, then delivers thetauri://drag-enter,drag-overanddrag-dropevents. The physical OS drag itself is not simulated.The macOS network prompt in the screenshots belongs to the test harness's Python process, not to the app.