Skip to content

fix: replace AbortSignal.any with manual polyfill for WebKit compatibility#7552

Merged
louis-jan merged 3 commits into
janhq:mainfrom
since-2017-hub:fix/abort-signal-any-polyfill
Feb 27, 2026
Merged

fix: replace AbortSignal.any with manual polyfill for WebKit compatibility#7552
louis-jan merged 3 commits into
janhq:mainfrom
since-2017-hub:fix/abort-signal-any-polyfill

Conversation

@since-2017-hub

@since-2017-hub since-2017-hub commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Describe Your Changes

AboartSignal.any() is not supported in the WebKit/JavaScriptCore runtime that Tauri uses on macOS, causing all llama.cpp and MLX model loads to immediately fail with:
TypeError: AbortSignal.any is not a function

-The fix creates a combined AbortController that manually forwards both timeout and user-abort signals, preserving identical behavior across all platforms

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@louis-jan

louis-jan commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Good stuff. What MacOS version are you using? @since-2017-hub. Want to reproduce for testing.

@since-2017-hub

Copy link
Copy Markdown
Contributor Author

Good stuff. What MacOS version are you using? @since-2017-hub. Want to reproduce for testing.

I am using 26(Tahoe)

@louis-jan

Copy link
Copy Markdown
Contributor

@nhhai please help take a look at this PR, give it a test then we are good to merge.

@nhhai

nhhai commented Feb 26, 2026

Copy link
Copy Markdown

Hi @since-2017-hub,

We tried to reproduce this first to verify but none of our machine can reproduce this. If it happens on your machine, can you help verify it with this build?

It's not signed so you may need to go to Security & Privacy > Open Anyway to launch it.

Thank you,

@since-2017-hub

Copy link
Copy Markdown
Contributor Author

@nhhai
Could you explain more details. I am a bit confused.
I need your kindly helpful what do i have to do more to approve this PR.

@louis-jan

louis-jan commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

@nhhai this is the PR to fix this issue. I think you might want to check the build instead. As contributors can build from source.

@louis-jan

louis-jan commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

I gave this fix a test, and there is a performance degradation issue. The token speed drop from 44 > 17 after stopping the first inference. Which means the abort signal didn't work somehow, hence the aborted stream still running in the background. We will need to look into it.

Screenshot 2026-02-27 at 10 30 48

@louis-jan louis-jan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@louis-jan

Copy link
Copy Markdown
Contributor

I gave this fix a test, and there is a performance degradation issue. The token speed drop from 44 > 17 after stopping the first inference. Which means the abort signal didn't work somehow, hence the aborted stream still running in the background. We will need to look into it.

Screenshot 2026-02-27 at 10 30 48

This is a legacy issue, it seems. I will check on the main branch after it is merged.

@louis-jan louis-jan merged commit fc2d0bc into janhq:main Feb 27, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this to QA in Jan Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

bug: AbortSignal.any is not a function when loading llama.cpp model on Jan 0.7.5

3 participants