Skip to content

Commit

Permalink
Don't allow returning a Promise from a tool call (#226688)
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens authored Aug 27, 2024
1 parent 422b8e9 commit ff7a154
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vs/workbench/api/common/extHostLanguageModelTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ export class ExtHostLanguageModelTools implements ExtHostLanguageModelToolsShape
throw new CancellationError();
}

for (const key of Object.keys(extensionResult)) {
const value = extensionResult[key];
if (value instanceof Promise) {
throw new Error(`Tool result for '${key}' cannot be a Promise`);
}
}

return typeConvert.LanguageModelToolResult.from(extensionResult);
}

Expand Down

0 comments on commit ff7a154

Please sign in to comment.