When a promise failed, the whole queue was ruined#1826
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the smart-tools Web inference pipeline against browser/WebView pathologies where onnxruntime-web runs can hang indefinitely or leave the WASM heap corrupted, and where cache writes can stall model loading.
Changes:
- Make model caching best-effort (fire-and-forget
cache.put) so model loads aren’t blocked by slow/blocked Cache API writes. - Add session “poisoning” semantics, optional per-run timeouts, and a
reset()path to recreate the underlyingInferenceSessionfrom cached model bytes. - Refactor the serial run queue implementation to avoid propagating prior failures through the queue chain.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web_ui/packages/smart-tools/src/utils/tool-utils.ts | Makes caching non-blocking by not awaiting cache.put() and swallowing cache errors. |
| web_ui/packages/smart-tools/src/segment-anything/session.ts | Adds timeout/poison/reset mechanics and refactors the serialized run() queue implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
5 tasks
dwesolow
reviewed
May 12, 2026
dwesolow
reviewed
May 12, 2026
dwesolow
approved these changes
May 12, 2026
Contributor
dwesolow
left a comment
There was a problem hiding this comment.
Tested those changes in tauri, works fine.
Thanks!
jcchr
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Issues addressed:
Manually tested Geti Tune browser and tauri app (by updating the hash of the packages that 'tiged' uses)
✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
✅ Checklist
Before submitting the PR, ensure the following: