Skip to content

Feature/97 add tool call summary results table / 添加工具调用摘要结果表#107

Merged
SunYanbox merged 4 commits intodevelopfrom
feature/97-add-tool-call-summary-results-table
May 3, 2026
Merged

Feature/97 add tool call summary results table / 添加工具调用摘要结果表#107
SunYanbox merged 4 commits intodevelopfrom
feature/97-add-tool-call-summary-results-table

Conversation

@SunYanbox
Copy link
Copy Markdown
Owner

No description provided.

SunYanbox added 4 commits May 3, 2026 09:46
- 新增功能: 实现工具调用结果的持久化存储与检索
  * 新增 `tool_call_summaries` 表结构,包含 session_id, func_name, kwargs_json, result, timestamp 字段及联合主键
  * 创建 `idx_tool_call_summaries_session` 索引以优化按会话查询性能
  * 新增 `record_tool_call_summary` 方法,支持通过 ON CONFLICT DO UPDATE 策略更新重复调用的结果
  * 新增 `get_tool_call_summaries` 方法,用于按时间倒序获取指定会话的所有工具调用摘要
- 新增功能: 实现工具调用后的摘要数据持久化
  * 引入 `_record_tool_summary` 方法用于捕获 `func_name`, `kwargs` 及 `result`
  * 集成 `src.console.result_manager._to_string` 将结果转换为字符串格式
  * 通过 `workspace.db.record_tool_call_summary` 将数据写入数据库,包含 `session_id` 和计算后的 `kwargs_json`
- 重构优化: 增强工具执行流程的可观测性
  * 在 `call_tool` 逻辑末尾增加摘要记录调用点,确保在压缩结果前完成数据收集
  * 排除 `write`, `edit`, `confirm_edit` 等写操作工具,仅记录读/查询类工具的摘要信息
- 新增功能: 验证 `tool_call_summaries` 表的数据库操作逻辑
  * 测试 `record_tool_call_summary` 方法在相同主键下的更新行为及时间戳刷新机制
  * 验证不同 `func_name` 和 `kwargs_json` 参数组合下生成独立记录的正确性
  * 确认 `get_tool_call_summaries` 返回结果按时间戳排序且支持多会话隔离查询
  * 检查外键约束 (FK) 防止无效 `session_id` 插入及索引 `idx_tool_call_summaries_session` 的存在性
- 修复问题: 修正 SQL 语句格式并统一测试中的异常类型断言
  * 将 `CREATE INDEX` 语句合并为单行,移除多余换行符以符合代码风格
  * 在 `test_tool_call_summaries.py` 中将通用的 `Exception` 替换为具体的 `sqlite3.IntegrityError`
  * 确保外键约束失败时能准确捕获 `IntegrityError` 而非泛型异常
@SunYanbox SunYanbox added the enhancement New feature or request label May 3, 2026
@SunYanbox SunYanbox merged commit 7000309 into develop May 3, 2026
3 checks passed
@SunYanbox SunYanbox deleted the feature/97-add-tool-call-summary-results-table branch May 3, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 增加工具调用摘要结果表 / Add Tool Call Summary Results Table

1 participant