Skip to content

fix(offline-ai): stop the model when a request is cancelled - #1082

Merged
LeanBitLab merged 2 commits into
mainfrom
fix/ai-cancel
Dec 4, 2026
Merged

LeanBitLab merged 2 commits into
mainfrom
fix/ai-cancel

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Cancel only dropped the result: the model kept computing and the next request waited for it. LeanType now calls cancelGeneration() if the plugin has it (1.0.2). Older plugins behave as before. A stopped request is no longer logged as a failure.

Checked on Waydroid (x86_64, Gemma 3 1B): after cancelling, the plugin stopped after 8 tokens, the text stayed unchanged and the next request started at once. Offline debug build passes.

Not checked: an older plugin, a phone.

Cancel only dropped the result: the model kept computing and the next request
waited for it. Plugin 1.0.2 can stop a generation.
@LeanBitLab
LeanBitLab merged commit 213bf76 into main Dec 4, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/ai-cancel branch December 4, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant