SPEC COMPLIANCE: Remove loose/passthrough types not allowed/defined by MCP spec + Task types (#1242)

This commit is contained in:
Konstantin Konstantinov 2025-12-09 13:52:23 +02:00 • committed by GitHub
commit a606fb1790
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 866 additions and 488 deletions

View file

@ -1982,11 +1982,8 @@ describe('createMessage backwards compatibility', () => {
// Verify result is returned correctly
expect(result.model).toBe('test-model');
expect(result.content.type).toBe('text');
// With tools param, result.content can be array (CreateMessageResultWithTools type)
// This would fail type-check if we used CreateMessageResult which doesn't allow arrays
const contentArray = Array.isArray(result.content) ? result.content : [result.content];
expect(contentArray.length).toBe(1);
expect(result.content).toMatchObject({ type: 'text', text: 'I will use the weather tool' });
expect(result.content).not.toBeInstanceOf(Array);
});
});

View file

@ -2285,7 +2285,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
// Verify we received the notification that was sent while disconnected
expect(allText).toContain('Missed while disconnected');
}, 10000);
}, 15000);
});
// Test onsessionclosed callback