Add optional harness hooks to the native turn loop #6

Merged
weichen merged 3 commits from feature/agent-harness-p1 into main 2026-10-01 13:41:33 +00:00
Owner

Why: the direct chat path needs one loop for deliverable checks, reminders, and truncated replies, while squad keeps today's behavior when the new fields stay unset.

Evidence: go test ./... passed.

Merge this before Backend and Agent-Squad.

Refs: feature/agent-harness-p1

Why: the direct chat path needs one loop for deliverable checks, reminders, and truncated replies, while squad keeps today's behavior when the new fields stay unset. Evidence: go test ./... passed. Merge this before Backend and Agent-Squad. Refs: feature/agent-harness-p1
weichen added 3 commits 2026-10-01 13:30:53 +00:00
Why: the direct chat path needs one shared loop for deliverable checks, tool pairing, reminders, and truncated replies, while squad callers keep today's behavior when the new fields stay unset.
Evidence: go test ./... in agent-native passed, including Stop cap, BeforeTool pairing, reminders absent from the session, repeat-guard cap, length continuation, and zero-value loop tests.
Impact: runtime.Config and llm.Event grow optional fields; AgentSession.Prompt copies them through. Squad sessions that leave them zero are unchanged.
Refs: feature/agent-harness-p1
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the direct-path adapter accounts usage per turn, including runs that stop on a budget error before the final usage event.
Evidence: go test ./runtime/ ./runtime/llm/ after the field was added.
Impact: message_end and usage events carry TotalTokens. Callers that ignore the new field are unchanged.
Refs: feature/agent-harness-p1
Co-authored-by: Cursor <cursoragent@cursor.com>
Delegate unregistered tool calls when a fallback is set
ci / vet-and-test (pull_request) Failing after 2m48s
ci / docker-checkout-hostgateway (pull_request) Failing after 31s
a34689c78f
Why: the direct chat path still executes model-emitted calls that are not in the profile allow-list, while squad keeps the unknown-tool error when the fallback is unset.
Evidence: go test ./runtime/ passed, including TestLoopUnknownToolFallsThrough and the existing unknown-tool cases.
Impact: Config.UnknownTool is optional. Nil preserves today's registry error.
Refs: feature/agent-harness-p1
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 1a999c344d into main 2026-10-01 13:41:33 +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-Native#6