Skip to content

fix(issue #1265): [Bug]: 意图识别模块,构造messages时,里面只有 system_prompt,没有 user_prompt,这会导致llm接口兼容问 - #172

Open
openjiuwen-sync-bot[bot] wants to merge 1 commit into
openJiuwen-ai:studio-2.0-devfrom
openjiuwenai:sync/pr-1761
Open

fix(issue #1265): [Bug]: 意图识别模块,构造messages时,里面只有 system_prompt,没有 user_prompt,这会导致llm接口兼容问#172
openjiuwen-sync-bot[bot] wants to merge 1 commit into
openJiuwen-ai:studio-2.0-devfrom
openjiuwenai:sync/pr-1761

Conversation

@openjiuwen-sync-bot

@openjiuwen-sync-bot openjiuwen-sync-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

Paired: GitHub #172GitCode !1761

Fixes #​1265

机器人基于 issue 分析自动修复。

根因

Bug 根因分析:

意图识别模块在构造 LLM 请求的 messages 数组时,仅包含 system_prompt 角色的消息,未添加 user_prompt 角色的消息。这导致部分 LLM API(如 GLM 系列)因缺少 user 角色消息而报错,而 DeepSeek 等宽松实现的 API 可以正常处理。

受影响的代码路径:

  • agent-runtime/jiuwen/common/intent_detection/adapt/intent.pyIntent 类(第134行),通过 build 方法实例化,负责意图识别的 LLM 调用
  • agent_builder/nl_to_agent/ 下多个子模块(clarifier/prompt.pydesigner/prompt.pygenerate_json_workflow/prompt.pyagent_designer/prompt.py)均定义了 SYSTEM_PROMPT 常量,调用链中仅引用 system prompt,未见构造 user prompt

由 issues-robot auto-fix 生成,复核后可合并。

Linked Closing Issues:

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: e8d8e9e6515a2d8cd155fd2f0313ff43abd74340

TASK STATUS DETAILS
CodeCheck ✅SUCCESS Click here
AntiPoison ✅SUCCESS Click here
Software Composition Analysis ✅SUCCESS Click here
Npm Build ✅SUCCESS See CHECK tab
Ruff Check ✅SUCCESS See CHECK tab
UT测试 ✅SUCCESS 点此跳转

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants