qwen-code/packages/core/src/utils
kefuxin b6a3ab11e0 fix: improve Gemini compatibility by adding configurable schema converter
This commit addresses issue #1186 by introducing a configurable schema compliance
mechanism for tool definitions sent to LLMs.

Key changes:
1.  **New Configuration**: Added `model.generationConfig.schemaCompliance` setting (defaults to 'auto', optional 'openapi_30').
2.  **Schema Converter**: Implemented `toOpenAPI30` converter in `packages/core` to strictly downgrade modern JSON Schema to OpenAPI 3.0.3 (required for Gemini API), handling:
    -   Nullable types (`["string", "null"]` -> `nullable: true`)
    -   Numeric exclusive limits
    -   Const to Enum conversion
    -   Removal of tuples and invalid keywords (``, `dependencies`, etc.)
3.  **Tests**: Added comprehensive unit tests for the schema converter and updated pipeline tests.

Fixes #1186
2025-12-11 14:23:27 +08:00
..
filesearch Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
request-tokenizer Vision model support for Qwen-OAuth (#525) 2025-09-18 13:32:00 +08:00
bfsFileSearch.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
bfsFileSearch.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
browser.ts # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
editHelper.test.ts 🎯 PR: Improve Edit Tool Reliability with Fuzzy Matching Pipeline (#1025) 2025-11-13 19:01:09 +08:00
editHelper.ts 🎯 PR: Improve Edit Tool Reliability with Fuzzy Matching Pipeline (#1025) 2025-11-13 19:01:09 +08:00
editor.test.ts feat: add support for Trae editor (#1037) 2025-11-17 10:58:33 +08:00
editor.ts feat: add support for Trae editor (#1037) 2025-11-17 10:58:33 +08:00
environmentContext.test.ts 🎯 Feature: Customizable Model Training and Tool Output Management (#981) 2025-11-07 17:28:16 +08:00
environmentContext.ts 🎯 Feature: Customizable Model Training and Tool Output Management (#981) 2025-11-07 17:28:16 +08:00
errorParsing.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
errorParsing.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
errorReporting.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
errorReporting.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
errors.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
fetch.ts chore: consistently import node modules with prefix (#3013) 2025-08-25 20:11:27 +00:00
fileUtils.test.ts 🎯 Feature: Customizable Model Training and Tool Output Management (#981) 2025-11-07 17:28:16 +08:00
fileUtils.ts 🎯 Feature: Customizable Model Training and Tool Output Management (#981) 2025-11-07 17:28:16 +08:00
flashFallback.test.ts Session-Level Conversation History Management (#1113) 2025-12-03 18:04:48 +08:00
formatters.ts refactor(core): Centralize shell logic into ShellExecutionService (#4823) 2025-07-26 01:56:49 +00:00
generateContentResponseUtilities.test.ts feat(commands): Enable @file processing in TOML commands (#6716) 2025-08-28 03:22:21 +00:00
generateContentResponseUtilities.ts feat(commands): Enable @file processing in TOML commands (#6716) 2025-08-28 03:22:21 +00:00
getFolderStructure.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
getFolderStructure.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
getPty.ts # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
gitIgnoreParser.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
gitIgnoreParser.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
gitUtils.ts Session-Level Conversation History Management (#1113) 2025-12-03 18:04:48 +08:00
ignorePatterns.test.ts Explict imports & exports with type modifier (#3774) 2025-08-25 22:04:53 +00:00
ignorePatterns.ts Explict imports & exports with type modifier (#3774) 2025-08-25 22:04:53 +00:00
installationManager.test.ts Merge tag 'v0.3.0' into chore/sync-gemini-cli-v0.3.0 2025-09-11 16:26:56 +08:00
installationManager.ts chore: consistently import node modules with prefix (#3013) 2025-08-25 20:11:27 +00:00
jsonl-utils.ts Session-Level Conversation History Management (#1113) 2025-12-03 18:04:48 +08:00
language-detection.ts chore: consistently import node modules with prefix (#3013) 2025-08-25 20:11:27 +00:00
llm-edit-fixer.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
llm-edit-fixer.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
LruCache.ts pre-release commit 2025-07-22 23:26:01 +08:00
memoryDiscovery.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
memoryDiscovery.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
memoryImportProcessor.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
memoryImportProcessor.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
messageInspectors.ts Explict imports & exports with type modifier (#3774) 2025-08-25 22:04:53 +00:00
nextSpeakerChecker.test.ts Session-Level Conversation History Management (#1113) 2025-12-03 18:04:48 +08:00
nextSpeakerChecker.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
openaiLogger.test.ts feat: support for custom OpenAI logging directory configuration 2025-11-05 18:49:04 +08:00
openaiLogger.ts feat: support for custom OpenAI logging directory configuration 2025-11-05 18:49:04 +08:00
partUtils.test.ts feat(commands): Enable @file processing in TOML commands (#6716) 2025-08-28 03:22:21 +00:00
partUtils.ts feat(commands): Enable @file processing in TOML commands (#6716) 2025-08-28 03:22:21 +00:00
pathReader.test.ts 🎯 Feature: Customizable Model Training and Tool Output Management (#981) 2025-11-07 17:28:16 +08:00
pathReader.ts 🎯 Feature: Customizable Model Training and Tool Output Management (#981) 2025-11-07 17:28:16 +08:00
paths.test.ts Feat: Simplify and Improve Search Tools (glob, grep, ripgrep) (#969) 2025-11-06 16:25:06 +08:00
paths.ts Session-Level Conversation History Management (#1113) 2025-12-03 18:04:48 +08:00
projectSummary.ts feat: Add Welcome Back Dialog, Project Summary, and Enhanced Quit Options (#553) 2025-09-11 16:59:26 +08:00
promptIdContext.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
quotaErrorDetection.test.ts feat(oauth): add Qwen OAuth integration 2025-08-08 10:30:18 +08:00
quotaErrorDetection.ts Merge tag 'v0.3.0' into chore/sync-gemini-cli-v0.3.0 2025-09-11 16:26:56 +08:00
qwenIgnoreParser.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
qwenIgnoreParser.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
retry.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
retry.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
ripgrepUtils.test.ts Replace spawn with execFile for memory-safe command execution (#1068) 2025-11-20 15:04:00 +08:00
ripgrepUtils.ts Replace spawn with execFile for memory-safe command execution (#1068) 2025-11-20 15:04:00 +08:00
safeJsonParse.test.ts fix: OpenAI tools (#328) 2025-08-14 21:18:26 +08:00
safeJsonParse.ts fix: OpenAI tools (#328) 2025-08-14 21:18:26 +08:00
safeJsonStringify.test.ts pre-release commit 2025-07-22 23:26:01 +08:00
safeJsonStringify.ts pre-release commit 2025-07-22 23:26:01 +08:00
schemaConverter.test.ts fix: improve Gemini compatibility by adding configurable schema converter 2025-12-11 14:23:27 +08:00
schemaConverter.ts fix: improve Gemini compatibility by adding configurable schema converter 2025-12-11 14:23:27 +08:00
schemaValidator.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
schemaValidator.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
secure-browser-launcher.test.ts New browser launcher for MCP OAuth. (#5261) 2025-08-01 05:47:22 +00:00
secure-browser-launcher.ts # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
shell-utils.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
shell-utils.ts fix(shell-utils): resolve command detection on Ubuntu by using shell for builtins (#1123) 2025-12-02 11:49:40 +08:00
shellReadOnlyChecker.test.ts feat: Implement Plan Mode for Safe Code Planning (#658) 2025-09-24 14:26:17 +08:00
shellReadOnlyChecker.ts feat: Implement Plan Mode for Safe Code Planning (#658) 2025-09-24 14:26:17 +08:00
subagentGenerator.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
subagentGenerator.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
summarizer.test.ts Explict imports & exports with type modifier (#3774) 2025-08-25 22:04:53 +00:00
summarizer.ts Explict imports & exports with type modifier (#3774) 2025-08-25 22:04:53 +00:00
systemEncoding.test.ts fix: prefer UTF-8 encoding for shell output on Windows when detected 2025-12-05 16:49:26 +08:00
systemEncoding.ts fix: prefer UTF-8 encoding for shell output on Windows when detected 2025-12-05 16:49:26 +08:00
terminalSerializer.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
terminalSerializer.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
testUtils.ts pre-release commit 2025-07-22 23:26:01 +08:00
textUtils.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
textUtils.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
thoughtUtils.test.ts Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
thoughtUtils.ts DeepSeek V3.2 Thinking Mode Integration (#1134) 2025-12-05 15:08:35 +08:00
tool-utils.test.ts Refactor: Standardize Tool Naming and Configuration System (#1004) 2025-11-12 19:46:05 +08:00
tool-utils.ts Refactor: Standardize Tool Naming and Configuration System (#1004) 2025-11-12 19:46:05 +08:00
userAccountManager.test.ts Merge tag 'v0.3.0' into chore/sync-gemini-cli-v0.3.0 2025-09-11 16:26:56 +08:00
userAccountManager.ts Refac: Centralize storage file management (#4078) 2025-08-20 01:55:47 +00:00
workspaceContext.test.ts # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
workspaceContext.ts # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
yaml-parser.test.ts fix: tests fail on Windows 2025-09-10 16:24:59 +08:00
yaml-parser.ts fix: tests fail on Windows 2025-09-10 16:24:59 +08:00