Set completion support to false by default

This commit is contained in:
Frédéric Barthelet 2025-05-25 16:29:00 -07:00
commit 4e6c7f9878

View file

@ -86,7 +86,7 @@ export function useConnection({
const [requestHistory, setRequestHistory] = useState<
{ request: string; response?: string }[]
>([]);
const [completionsSupported, setCompletionsSupported] = useState(true);
const [completionsSupported, setCompletionsSupported] = useState(false);
const pushHistory = (request: object, response?: object) => {
setRequestHistory((prev) => [
@ -443,7 +443,7 @@ export function useConnection({
throw error;
}
setServerCapabilities(capabilities ?? null);
setCompletionsSupported(true); // Reset completions support on new connection
setCompletionsSupported(capabilities?.completions !== undefined);
if (onPendingRequest) {
client.setRequestHandler(CreateMessageRequestSchema, (request) => {