Record tool time and reject false file claims #37

Merged
weichen merged 4 commits from feature/chat-timeline-preview into main 2026-10-01 07:40:52 +00:00
Owner

摘要

  • 思考时长写入 durationMs,工具调用写入时长,成功的工具结果也落摘要。
  • 终轮若声称生成了文件但没有对应工件,把该段降为过程并纠正一次。
  • 提示词要求:没有调用工具就不能说已生成,回复里不要写工件 ID。

验证

  • 同步 origin/main 后,go test 覆盖 runtime、prompts、tools、squadadapter,均通过。

合入

Core 合入之后再合本 PR。

## 摘要 - 思考时长写入 `durationMs`,工具调用写入时长,成功的工具结果也落摘要。 - 终轮若声称生成了文件但没有对应工件,把该段降为过程并纠正一次。 - 提示词要求:没有调用工具就不能说已生成,回复里不要写工件 ID。 ## 验证 - 同步 `origin/main` 后,`go test` 覆盖 runtime、prompts、tools、squadadapter,均通过。 ## 合入 Core 合入之后再合本 PR。
weichen added 3 commits 2026-10-01 06:20:24 +00:00
Why: After a refresh the timeline had no thinking duration and successful tool rows expanded to nothing, because only failures stored a summary.
Evidence: go test ./internal/runtime/ -count=1 -run 'TestLLMRunnerRecordsThinkingAndToolDuration|TestLLMRunnerToolTurnTextIsProcess|TestLLMRunnerDeliverablePinnedAfterText'
Impact: Thinking parts gain durationMs; tool calls gain durationMs; tool results keep a short success summary. Requires the core duration field.
Refs: feature/chat-timeline-preview
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: A turn with no tool call can still say a document was generated and invent an artifact id, and the chat then shows only that text.
Evidence: go test ./internal/runtime/ ./internal/prompts/ -count=1. The guard fires on an unknown art id or a generation claim with no deliverable, cites an existing artifact without firing, and corrects at most once.
Impact: One extra model turn when the reply falsely claims a file. base.deliverables is now version 2 and forbids claiming a file or printing artifact ids.
Refs: feature/chat-timeline-preview
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 1 commit 2026-10-01 07:40:30 +00:00
Why: Main moved the deliverable recipes into skills after this branch
recorded the false-file rule, so the prompt has to keep both.

Evidence: go test ./internal/prompts/ ./internal/runtime/ passed.
The resolved prompt is version 2 and points at the skill library.

Impact: This branch contains the B10 assembly and still rejects a final
reply that claims a file it did not create.

Refs: feature/chat-timeline-preview
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 1ea3b1db97 into main 2026-10-01 07:40:52 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#37