fix(mcp): keep prompt completion within ready provider sessions
Avoid lazy provider startup for document and procedure completion. Propagate MCP cancellation through completers, cancel lookups during session transitions, and share provider result projection with ordinary operations. Cover cold, starting, warm, queued, cancelled, and closed sessions through MCP composition and provider boundaries.
This commit is contained in:
@@ -94,6 +94,15 @@ export class CompositeProvider implements AnalysisProvider {
|
||||
return outcomes.find((outcome) => !outcome.ok) ?? ok(null);
|
||||
};
|
||||
return {
|
||||
executeIfReady: (operation, parameters, options) => {
|
||||
const provider = this.#providerByOperation.get(operation);
|
||||
const client =
|
||||
provider === undefined ? undefined : clients.get(provider);
|
||||
return (
|
||||
client?.executeIfReady?.(operation, parameters, options) ??
|
||||
Promise.resolve(undefined)
|
||||
);
|
||||
},
|
||||
execute: (operation, parameters, options) => {
|
||||
if (operation === "health")
|
||||
return Promise.resolve(
|
||||
|
||||
Reference in New Issue
Block a user