Skip to content

Fix DisposedError during slow batch embedding#41

Merged
tobi merged 1 commit intotobi:mainfrom
wuhup:fix-embed-timeout
Jan 30, 2026
Merged

Fix DisposedError during slow batch embedding#41
tobi merged 1 commit intotobi:mainfrom
wuhup:fix-embed-timeout

Conversation

@wuhup
Copy link
Copy Markdown
Contributor

@wuhup wuhup commented Jan 21, 2026

Call touchActivity() after each successful embedding to prevent the inactivity timeout from disposing the context mid-batch.

On slow systems (CPU-only), batch embedding can take much longer than the 2-minute inactivity timeout, causing the context to be disposed while embeddings are still in progress.

Fixes #40

Call touchActivity() after each successful embedding to prevent
the inactivity timeout from disposing the context mid-batch.

On slow systems (CPU-only), batch embedding can take much longer
than the 2-minute inactivity timeout, causing the context to be
disposed while embeddings are still in progress.

Fixes tobi#40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical issue where the qmd embed command fails with DisposedError on slow systems (CPU-only) during batch embedding operations. The root cause is that the 2-minute inactivity timeout disposes the context while embeddings are still in progress. The fix adds a touchActivity() call after each successful embedding to reset the inactivity timer.

Changes:

  • Added touchActivity() call in embedBatch() method after each successful embedding to prevent premature context disposal during long-running batch operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tobi tobi merged commit 6d9871d into tobi:main Jan 30, 2026
6 checks passed
Anrahya pushed a commit to Anrahya/qmd that referenced this pull request Feb 3, 2026
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.

qmd embed fails with DisposedError on slow systems due to inactivity timeout

4 participants