Skip to content

fix(offline-ai): one generation at a time - #949

Merged
LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
4di-hello:fix/offline-generation-lock
Nov 27, 2026
Merged

LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
4di-hello:fix/offline-generation-lock

Conversation

@4di-hello

Copy link
Copy Markdown
Contributor

Split out of #889 as suggested.

The plugin can't stop a running generation: after a cancelled request (e.g. the X on the key) it keeps running, and a new request failed with "Context is busy" and gave no output.

  • A new request now waits for the running one, and is skipped if it was cancelled while waiting.
  • isBusy is set and cleared inside the lock, so a waiting request can't clear it while another one runs.

🤖 Generated with Claude Code

The plugin can't stop a running generation: after a cancelled request (e.g.
the X on the key) it keeps running, and a new request failed with "Context is
busy" and gave no output. A new request now waits for the running one, and is
skipped if it was cancelled while waiting. isBusy is set and cleared inside the
lock, so a waiting request can't clear it while another one runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@LeanBitLab LeanBitLab left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks, moving the busy flag inside the generation lock addresses the earlier race, and a request cancelled while waiting no longer starts a generation. Checked: the offline flavor compiles on current main (not run on a device).

@LeanBitLab
LeanBitLab merged commit 90eb0db into LeanBitLab:main Nov 27, 2026
1 check passed
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.

2 participants