feat(mcp): refresh provider candidates without switching (#8487)

* fix(mcp): report provider candidate observation scope

* feat(mcp): refresh provider candidates without switching

* docs: clarify candidate inspection ownership

* fix(mcp): clarify provider reselection on reopen

* test(mcp): bound candidate refresh lifecycle gates

* test(mcp): keep temporary fixture cleanup with its owner
This commit is contained in:
morluto authored and GitHub committed 2026-11-08 01:35:39 +00:00
1 parent 1a0e2c77f2
commit 0b028cc75a
12 files changed
+516 -10

No files matched your search

@@ -129,11 +129,26 @@ export class SessionProviderRouter {
);
}
/** Candidate status authoritative for the active or target-free route. */
/** Preserve selection observations unless a caller requests a fresh inspection. */
async candidateStatuses(
route: SessionProviderRoute,
signal?: AbortSignal,
options: {
readonly signal?: AbortSignal;
readonly target?: BinaryTarget;
readonly refresh?: boolean;
} = {},
): Promise<readonly AnalysisProviderCandidateStatus[]> {
const { signal, target, refresh = false } = options;
if (refresh && route.selection !== undefined) {
const current = await this.registry.candidates(
target,
signal === undefined ? {} : { signal },
);
return current.map((candidate) => ({
...candidate,
selected: candidate.provider.id === route.binding?.identity.id,
}));
}
return (
route.selection?.candidates ??
this.registry.candidates(