Skip to content

feat(core): configure reasoning response extraction#2733

Open
EAGzzyCSL wants to merge 1 commit into
mainfrom
zzy/reasoning-content-fallback
Open

feat(core): configure reasoning response extraction#2733
EAGzzyCSL wants to merge 1 commit into
mainfrom
zzy/reasoning-content-fallback

Conversation

@EAGzzyCSL

@EAGzzyCSL EAGzzyCSL commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds adapter-level message extraction configuration for chat completion responses, including configurable default reasoning keys and custom extraction hooks.
  • Moves reasoning-as-content fallback behind useReasoningAsContentFallback so it is enabled only for supported model families.
  • Enables the fallback for Doubao, Qwen 3.x, GLM, Kimi, and Xiaomi Mimo while leaving OpenAI/GPT, Gemini, Auto-GLM, UI-TARS, and Qwen 2.5 unchanged.
  • Keeps the default extractor conservative: it reads reasoning_content only by default.
  • Configures Qwen 3.x to read reasoning_content first and reasoning second, covering DashScope and vLLM's OpenAI-compatible field migration: [RFC]: reasoning_content -> reasoning vllm-project/vllm#27755.
  • Keeps Gemini on its custom extraction path only: Gemini reads thought parts and inline <thought> content, and ignores provider reasoning_content fields.
  • Adds unit coverage for extraction configuration, Qwen/vLLM-style reasoning fields, Gemini custom extraction, fallback behavior, and the model-family whitelist.

Validation

./node_modules/.bin/vitest --run tests/unit-test/model-adapter/gemini.test.ts tests/unit-test/model-adapter/chat-completion.test.ts tests/unit-test/service-caller-reasoning-fallback.test.ts tests/unit-test/model-adapter.test.ts

Latest result: 4 test files, 42 tests passed.

Note: pnpm --filter @midscene/core test ... was attempted earlier, but pnpm dependency-state checks triggered install/build-script approval flow before tests ran, so the focused Vitest command above was used for validation.

@EAGzzyCSL EAGzzyCSL force-pushed the zzy/reasoning-content-fallback branch from 0b6cf79 to 0158870 Compare June 30, 2026 08:42
@EAGzzyCSL EAGzzyCSL force-pushed the zzy/reasoning-content-fallback branch from 0158870 to 03aba98 Compare June 30, 2026 09:19
@EAGzzyCSL EAGzzyCSL changed the title feat(core): configure reasoning content fallback feat(core): configure reasoning response extraction Jun 30, 2026
@EAGzzyCSL EAGzzyCSL marked this pull request as ready for review June 30, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant