Skip to content

fix: 记忆抽取关闭 Qwen 思考模式 + 测试模型与生产配置对齐 - #117

Merged
lishuceo merged 1 commit into
mainfrom
fix/memory-extraction-thinking
Mar 9, 2026
Merged

fix: 记忆抽取关闭 Qwen 思考模式 + 测试模型与生产配置对齐#117
lishuceo merged 1 commit into
mainfrom
fix/memory-extraction-thinking

Conversation

@lishuceo

@lishuceo lishuceo commented Mar 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • 生产 extractor 和测试中添加 enable_thinking: false,记忆抽取是结构化输出任务不需要 CoT 推理
  • 测试硬编码的 qwen3.5-plus(思考模型)改为 process.env.MEMORY_EXTRACTION_MODEL || 'qwen3.5-flash',与生产配置对齐
  • quality.test.ts 抽取 case 超时兜底从 120s 放宽到 240s

Test plan

  • npx vitest run src/memory/__tests__/quality.test.ts — 抽取 case 全部通过,耗时从 >310s 降至 ~6s
  • 运行 npx vitest run 全量测试通过

🤖 Generated with Claude Code

- extractor.ts 和测试中添加 enable_thinking: false,抽取是结构化输出任务不需要 CoT
- 测试硬编码的 qwen3.5-plus 改为读取 MEMORY_EXTRACTION_MODEL 环境变量(默认 qwen3.5-flash)
- quality.test.ts 抽取 case 超时从 120s 放宽到 240s(外部 API 兜底)
- 实测 5 个抽取 case 总耗时从 >310s 降至 ~6s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Mar 5, 2026

Copy link
Copy Markdown

Claude finished @lishuceo's task in 49s —— View job


PR Review: 记忆抽取关闭 Qwen 思考模式

  • Check for previous review comments — none found
  • Read changed files and understand context
  • Review changes
  • Post summary

Approved — Clean, focused fix. No issues found.

Changes reviewed:

  1. src/memory/extractor.ts — Added enable_thinking: false to the DashScope API call with as never type assertion. This is correct: memory extraction is a structured JSON output task where CoT reasoning adds latency without benefit. The as never pattern is consistent with the existing codebase (utils/quick-ack.ts:105).

  2. src/memory/__tests__/integration.test.ts — Model changed from hardcoded qwen3.5-plus to process.env.MEMORY_EXTRACTION_MODEL || 'qwen3.5-flash', aligning with production config. Also added enable_thinking: false + as never to match production behavior.

  3. src/memory/__tests__/quality.test.ts — Same model and thinking mode alignment. Timeout bumped from 120s → 240s as a safety margin for CI, though with thinking disabled the actual runtime should be much faster (~6s per PR description).

Assessment: All three changes are minimal, correct, and well-motivated. Tests mirror production config, as never is the established pattern for DashScope-specific extensions not in OpenAI's type definitions, and the performance improvement (310s → ~6s) is significant.

@lishuceo
lishuceo merged commit 3eaa4cb into main Mar 9, 2026
2 checks passed
lishuceo added a commit that referenced this pull request Apr 8, 2026
fix: 记忆抽取关闭 Qwen 思考模式 + 测试模型与生产配置对齐
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