feat: 工具调用前穿插逐步文字解说 + 后台唤醒调度 - #180
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
此前多步工具回合表现为「一堆工具先跑、最后才蹦出文字」。日志里每个
ITER_END都是assistant_chars:0—— 模型把「我现在要做 X」的解说全部塞进了 DeepSeek 的reasoning_content(隐藏的 THINK 通道),可见的content通道全程为空。这和 GitHub Copilot「先说一句话 → 再调工具」的穿插体验差距明显。改动
系统提示(核心修复,
src/prompts/system.js)No preamble, no "I'll now…"改成「禁空话(Great question/Sure)、但要求动作解说」—— 每次工具调用前用一句可见正文说明「要做什么 + 为什么」。content而非 reasoning/thinking 通道;多步工具回合里每个工具调用前先写一句,而不是沉默到最后。流式管道本身(
src/api/openai-client.js)已支持content先于tool_calls穿插渲染,无需改动。捆绑的在途功能
本分支同时包含此前在途的后台唤醒相关工作:
src/chat/wake-scheduler.js— watch + yield_turn 的后台条件唤醒调度。src/chat/digest.js— 会话摘要。src/tools/sleep.js— sleep 工具。src/chat/agent-loop.js等相应配套改动。验证
node esbuild.config.js构建通过(out/extension.js666 KB,无错误)。release/deep-copilot-0.43.0.vsix。ITER_END的assistant_chars > 0、每个工具方块前有解说、yield_turn前有总结。风险