-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix(provider-utils): add comprehensive type tests showing broken behavior #11858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(provider-utils): add comprehensive type tests showing broken behavior #11858
Conversation
| */ | ||
| export const DEFAULT_EMPTY_INPUT_SCHEMA = { | ||
| type: 'object', | ||
| properties: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return tool; | ||
| return { | ||
| ...tool, | ||
| inputSchema: tool.inputSchema ?? DEFAULT_EMPTY_INPUT_SCHEMA, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| */ | ||
| export const DEFAULT_EMPTY_INPUT_SCHEMA = { | ||
| type: 'object', | ||
| properties: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9a69e3c to
4a741b9
Compare
4a741b9 to
c88dc6a
Compare
…d add comprehensive type tests
… to demonstrate breakage
1450d06 to
11e6cea
Compare
|
@lgrammel I have added the requested tests, demonstrating that the type definitions are currently incomplete as the TypeScript check now fails |
|
Since it was asked to prove the problem, I created code to verify the initial hypothesis, which at the moment has no corrections. So as it should be, TypeScript does not pass. (Prettier is to be formatted, but I think it's the least of the problems) |
|
@kairosci thanks for creating the tests. I meant that in this PR, the tests should describe the current behavior (even if wrong), i.e. they should just specify what exists. In the follow up PR that fixes the issue, we would change the tests to show the breakage, and then fix it. This approach will make it very clear in the 2nd PR what behavior was changed and how, making it easier to think about (e.g. re backwards compatibility). Can you adjust this PR such that the tests encode the existing behavior, even if buggy? |
Background
The
ToolApprovalRequesttype is currently missingtoolNameandinputproperties. This PR adds comprehensive type tests totool.test-d.tsand explicitly demonstrates the broken behavior by asserting existence of these properties, which causes the tests to fail.Summary
packages/provider-utils/src/types/tool.test-d.tsto be comprehensive for the current state, including tests for:ToolApprovalRequest(failing test to demonstrate missing properties)Manual Verification
Ran
pnpm vitest run packages/provider-utils/src/types/tool.test-d.ts --typecheckand verified that it fails as expected due to missing properties.Checklist