feat(agent): require Chinese thinking and reports in subagent prompts (AG-4)

Subagent / vision subflow prompts (audience=agent) get a dedicated section:
report goes to the parent session, and thinking, step notes and reports stay
in Chinese even when the goal, tool results or web pages are in English.
Prompt regression test covers both the shared hard rule and the new section.

Child reports reaching the user are already humanized: the child session page
uses the same FIX-7 report-humanize path, and the parent's final report resolves
child run IDs to their goal titles; agent.spawn/await tool rows show no raw summary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-30 17:58:08 +08:00
1 parent 081db4651c
commit 0508f3418f
3 files changed
+35 -1

No files matched your search

+18
View File
@@ -48,6 +48,24 @@ describe("汇报格式(AGUI-3)", () => {
const p = buildSystemPrompt({ role: "网页挑战处理员", goal: "过验证", audience: "agent" });
expect(p).not.toContain("## 汇报格式");
});
it("子会话与父会话一样要求思考、步骤说明和汇报都用中文(AG-4)", () => {
const child = buildSystemPrompt({
role: "媒体库自动化智能体",
goal: "Check the torrent list on the site",
audience: "agent",
});
// 与父会话同一条硬规则
expect(child).toContain("思考、步骤说明和汇报都用中文");
expect(userPrompt()).toContain("思考、步骤说明和汇报都用中文");
// 子会话专有的一节:目标 / 工具结果是英文也用中文
expect(section(child, "汇报对象")).toMatchInlineSnapshot(`
"## 汇报对象
- 你的汇报交给父会话汇总,不直接给用户看,可以带对象 ID。
- 思考、步骤说明和汇报一律用中文,即使目标、工具结果或网页是英文;引用文件名、原站标题时保持原文。"
`);
expect(section(userPrompt(), "汇报对象")).toBe("");
});
});
describe("工作方式(AGUI-3)", () => {