Announce final-only on every material tool result #235

Merged
weichen merged 1 commits from feature/fast-slow-o2-final-only-notice-all-tools into main 2026-10-21 04:40:07 +00:00
Owner

Announce final-only on every material tool result

Why: O2 A01 paid rerun P3 (after #233) failed again on route-contract C8. Final-only was triggered by the budget reserve after a round of three knowledge_search calls; #233 only appended the notice to publish_work_checkpoint results, so the model never saw it, called the checkpoint tool in the final-only request, and the strict contract treated the undeclared tool as terminal.

Change:

  • New subRun.withFinalOnlyNotice appends materialFinalOnlyNotice when the material budget applies and the next request will be final-only or stop; IsError is never changed.
  • Used by the publish_work_checkpoint branch (unchanged behaviour) and by the generic tool branch; the persisted tool-result summary equals the content returned to the model.
  • Final-only checkpoint reject branch, finalOnlyRejected latch, per-request decision, reminder, declaration removal, schemas and task text unchanged.

Evidence (SELF, host): gofmt clean; go vet ./internal/runtime/; go test ./internal/runtime/ ./internal/runmgr/ ./internal/server/ -count=1 ok; go test -tags live -run '^TestFollowupA01KeepsItsOwnOneShotResult$' ./eval/live/ ok; git diff --check clean. Implementation: agent-exec unit o2f1b-i1-backend-notice-all-tools (PI, attempt 1, success). Independent review (fresh session): no blocking issues; non-blocking: runtime-generated results (hook/unknown-tool/cancel) bypass runTool and carry no notice; materialDecision comment still mentions checkpoint results only.

Impact: material subagent with a token budget only; non-material subagents unaffected. Whether the model obeys needs a separately authorized paid rerun.

Refs: Dev feature/fast-slow-o2-final-only-notice-all-tools; previous Backend #233

Announce final-only on every material tool result Why: O2 A01 paid rerun P3 (after #233) failed again on route-contract C8. Final-only was triggered by the budget reserve after a round of three knowledge_search calls; #233 only appended the notice to publish_work_checkpoint results, so the model never saw it, called the checkpoint tool in the final-only request, and the strict contract treated the undeclared tool as terminal. Change: - New `subRun.withFinalOnlyNotice` appends materialFinalOnlyNotice when the material budget applies and the next request will be final-only or stop; IsError is never changed. - Used by the publish_work_checkpoint branch (unchanged behaviour) and by the generic tool branch; the persisted tool-result summary equals the content returned to the model. - Final-only checkpoint reject branch, finalOnlyRejected latch, per-request decision, reminder, declaration removal, schemas and task text unchanged. Evidence (SELF, host): gofmt clean; go vet ./internal/runtime/; go test ./internal/runtime/ ./internal/runmgr/ ./internal/server/ -count=1 ok; go test -tags live -run '^TestFollowupA01KeepsItsOwnOneShotResult$' ./eval/live/ ok; git diff --check clean. Implementation: agent-exec unit o2f1b-i1-backend-notice-all-tools (PI, attempt 1, success). Independent review (fresh session): no blocking issues; non-blocking: runtime-generated results (hook/unknown-tool/cancel) bypass runTool and carry no notice; materialDecision comment still mentions checkpoint results only. Impact: material subagent with a token budget only; non-material subagents unaffected. Whether the model obeys needs a separately authorized paid rerun. Refs: Dev feature/fast-slow-o2-final-only-notice-all-tools; previous Backend #233
weichen added 1 commit 2026-10-21 04:38:16 +00:00
agent-exec transport 2aba0efd75f9b3a95cb01b82b7fcc45c/866c2dd62a06
governance / governance (pull_request) Successful in 13s
ci / vet-and-test (pull_request) Successful in 1m15s
52a3e497ed
weichen merged commit 07228aa381 into main 2026-10-21 04:40:07 +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#235