Skip to content

组合式语音 Agent:删除确认硬保证、字段裁剪降本与稳定性修复 - #362

Merged
LUPENGHAN merged 11 commits into
1024XEngineer:mainfrom
yyy-router:feature/agent-prompt-tuning
Aug 24, 2026
Merged

LUPENGHAN merged 11 commits into
1024XEngineer:mainfrom
yyy-router:feature/agent-prompt-tuning

Conversation

@yyy-router

Copy link
Copy Markdown
Contributor

关联 issue:#361

概述

优化组合式语音(composed voice,TIMEFLOW_VOICE_AGENT_MODE=2)LLM 环节的稳定性、删除安全性与成本。

改动

删除确认硬保证

schedule_delete 改为代码层强制确认:只有在本轮用户刚回答过 confirmation 或 recurrence_scope 时才放行,否则注入 refusal 强制模型回头确认。

字段裁剪降本

composed 与 realtime 两个 agent 的 schedule 结果改为白名单序列化(约 25 字段 → 13/14 字段),裁掉模型不读的内部字段。实测 input token 降约 73%,input:output 从 203:1 降到 61:1。

稳定性与日期修复

  • LLM 温度降到 0.2,提升工具调用确定性。
  • 提示词细化:信息补全 /「改成 X 点」默认改开始时间 /「某一次不参加」识别为单次删除。
  • 上下文补「今天是星期几」,修复「每周一」「下周一」等相对日期算错。
  • 无工具调用却声称成功的纠正、道别未调用 end_conversation 的处理。

修复

  • 单次删除周期性日程后客户端不刷新(mutation 结果漏传 occurrence_overrides)。
  • temperature 请求体测试未同步。

验证

  • 全量 pytest 97.29% 覆盖;ruff check / format、mypy 干净。

@yyy-router
yyy-router marked this pull request as ready for review August 24, 2026 10:31
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审阅了本次组合式语音 Agent 的删除确认、结果裁剪、客户端交付和 LLM 请求参数变更。发现一个删除安全性问题:删除授权只记录问题类型,没有绑定到明确的肯定回答或在一次删除后消耗,因此模型在用户拒绝确认、或同一轮已完成一次删除后仍可能继续调用 schedule_delete。其余变更的调用链和序列化契约未发现达到报告门槛的问题。验证:python3 -m compileall 与 git diff --check 通过;未能运行 pytest,因为环境中未安装 pytest。

Comment thread backend/src/timeflow/intelligence/conversation/agent.py
@LUPENGHAN
LUPENGHAN merged commit 80b3ec8 into 1024XEngineer:main Aug 24, 2026
5 checks passed
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.

2 participants