Merge pull request #2858 from QwenLM/fix/anyof-schema-validation-coercion

fix(core): coerce stringified JSON values for anyOf/oneOf MCP tool schemas
This commit is contained in:
tanzhenxin 2026-04-07 15:52:01 +08:00 committed by GitHub
commit 5b550ae7cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 242 additions and 58 deletions

View file

@ -173,34 +173,6 @@ describe('<AskUserQuestionDialog />', () => {
);
unmount();
});
it('navigates with number keys', async () => {
const onConfirm = vi.fn();
const details = createConfirmationDetails();
const { stdin, unmount } = renderWithProviders(
<AskUserQuestionDialog
confirmationDetails={details}
onConfirm={onConfirm}
/>,
);
await wait();
// Press '2' to select Blue
stdin.write('2');
await wait();
// Press Enter
stdin.write('\r');
await wait();
expect(onConfirm).toHaveBeenCalledWith(
ToolConfirmationOutcome.ProceedOnce,
{ answers: { 0: 'Blue' } },
);
unmount();
});
it('cancels with Escape', async () => {
const onConfirm = vi.fn();
const details = createConfirmationDetails();