Improve Gate prompt: explicit expert_type descriptions, codegen boundary fix

"Add function to existing file" now correctly routes to locator_repair
instead of codegen. codegen reserved for "create from scratch" only.
5/5 boundary cases pass on gemma3:4b.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Val-sss
2026-04-26 23:00:14 +08:00
parent 2cf9e6c431
commit c955ecd544

View File

@@ -15,9 +15,18 @@ GATE_SYSTEM = "你是任务分类器。只返回JSON不要有其他内容。"
GATE_PROMPT = """分析用户输入返回分类JSON。
expert_type选项locator_repair | codegen | refactor | doc | office
expert_type选项
- locator_repair修复bug、修改已有代码、在已有文件中添加/删除函数
- codegen从零创建全新文件或全新项目
- refactor重构、优化、整理已有代码结构
- doc写注释、文档、README
- office生成Excel/Word/PPT等办公文档
difficulty选项easy | hardhard = 跨多文件/逻辑复杂/描述模糊)
注意只要任务涉及已有文件就选locator_repair或refactor不要选codegen。
codegen仅用于"从零创建"的场景。
格式:{{"expert_type": "...", "task_summary": "10字内", "difficulty": "..."}}
用户输入:{user_input}"""