qwen-code/packages/core/src/models
Bramha.dev 414b3304cd
fix(core): split tool-result media into follow-up user message for strict OpenAI compat (#3617)
Fixes #3616.

Adds opt-in `splitToolMedia` flag (default false). When enabled, media parts (image / audio / video / file) returned by MCP tool calls are split into a follow-up `role: "user"` message instead of being embedded in the `role: "tool"` message. Required for strict OpenAI-compatible servers (e.g., LM Studio) that reject non-text content on tool messages with HTTP 400 "Invalid 'messages' in payload".

Media from parallel tool responses is accumulated and emitted as a single follow-up user message after all tool messages, preserving OpenAI's contiguity requirement for tool responses.

Default behavior is unchanged for permissive providers.
2026-04-27 23:01:02 +08:00
..
constants.ts fix(core): split tool-result media into follow-up user message for strict OpenAI compat (#3617) 2026-04-27 23:01:02 +08:00
content-generator-config.test.ts test(models): add tests for content-generator-config helpers 2026-03-30 09:35:41 +00:00
content-generator-config.ts feat(subagents): enable cross-provider model selectors 2026-03-30 08:44:13 +00:00
index.ts feat: support runtime model selection for both interactive and ACP 2026-02-02 17:52:50 +08:00
modelConfigErrors.ts fix: refine auth message to give explicit tip 2026-01-07 22:58:11 +08:00
modelConfigResolver.test.ts refactor(config): dedupe QWEN_CODE_API_TIMEOUT_MS env override logic (#3653) 2026-04-27 08:44:18 +08:00
modelConfigResolver.ts refactor(config): dedupe QWEN_CODE_API_TIMEOUT_MS env override logic (#3653) 2026-04-27 08:44:18 +08:00
modelRegistry.test.ts refactor: merge coder-model and qwen3.5-plus, remove vision model switching 2026-02-26 14:43:07 +08:00
modelRegistry.ts fix: add modality defaults to prevent API errors when reading PDFs 2026-02-27 20:00:38 +08:00
modelsConfig.test.ts fix(core): preserve settings-sourced apiKey when registry model envKey is absent (#3495) 2026-04-26 07:37:56 +08:00
modelsConfig.ts fix(core): preserve settings-sourced apiKey when registry model envKey is absent (#3495) 2026-04-26 07:37:56 +08:00
types.ts fix(core): split tool-result media into follow-up user message for strict OpenAI compat (#3617) 2026-04-27 23:01:02 +08:00