Replay tool calls natively and tighten the deliverable gate #42

Merged
weichen merged 1 commits from feature/agent-harness-p0 into main 2026-10-01 12:43:27 +00:00
Owner

Summary

  • Replay assistant tool calls as native tool messages, pair missing results, compact oversized arguments, and drop forged call text from history.
  • Correct a false deliverable claim twice, then append a notice instead of accepting it. base.deliverables is now v5.

Test plan

  • go test ./internal/ctxasm/ ./internal/runtime/ ./internal/prompts/
  • go test ./... in Agent-System-Backend
  • Dev worktree make test (boundaries, core, backend, frontend, ui, agent-command)
## Summary - Replay assistant tool calls as native tool messages, pair missing results, compact oversized arguments, and drop forged call text from history. - Correct a false deliverable claim twice, then append a notice instead of accepting it. base.deliverables is now v5. ## Test plan - [x] go test ./internal/ctxasm/ ./internal/runtime/ ./internal/prompts/ - [x] go test ./... in Agent-System-Backend - [x] Dev worktree make test (boundaries, core, backend, frontend, ui, agent-command)
weichen added 1 commit 2026-10-01 12:31:10 +00:00
Why: Flattened "[调用工具 …]" history taught the model to imitate calls and invent artifact ids. A single regex correction then accepted the second false claim.
Evidence: ctxasm replay tests cover native tool messages, missing-result pairing, argument compaction, demoted text, and forged-marker stripping. Runtime tests cover forged markers, extension-less claims, two corrections, and the fallback notice.
Impact: Assistant history sent to the model no longer contains flattened tool calls. The direct runner corrects a false deliverable twice, then appends a notice instead of accepting the claim. The squad entry still fails closed on the same predicate. base.deliverables is now v5.
Refs: feature/agent-harness-p0
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit f007c95a03 into main 2026-10-01 12:43:27 +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#42