Skip to content

feat(js/genkit): Added cancelOperation for backgroundModels#4559

Merged
ifielker merged 1 commit intomainfrom
if-cancelOperation
Feb 11, 2026
Merged

feat(js/genkit): Added cancelOperation for backgroundModels#4559
ifielker merged 1 commit intomainfrom
if-cancelOperation

Conversation

@ifielker
Copy link
Collaborator

Usage

This PR introduces ai.cancelOperation(), allowing you to programmatically cancel long-running operations for background models that support it.

const ai = genkit({
  plugins: [<your background model plugin>],
});

// Start a long-running operation
let { operation } = await ai.generate({ <your background model config and request> });

// ... later, if you need to cancel it ...
const canceledOperation = await ai.cancelOperation(operation);

console.log('Operation canceled:', canceledOperation);

Checklist (if applicable):

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions bot added the js label Feb 10, 2026
@ifielker ifielker requested a review from pavelgj February 10, 2026 23:45
@ifielker ifielker merged commit a32f06c into main Feb 11, 2026
6 checks passed
@ifielker ifielker deleted the if-cancelOperation branch February 11, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants