agent: hint after 3 identical tool calls #162

Merged
hermes merged 1 commits from feat/loop-guard into main 2026-10-15 20:37:34 +00:00
Collaborator

Closes #157.

Repeat in agent.rs: counts consecutive tool calls with identical (tool, args, result). From the 3rd on, the result gets [hx: this exact call returned the same result 3 times in a row; change approach or ask the user] appended. Calls with a timeout arg (polling) are exempt. No hard stop; the existing max_turns stays. Only the request copy changes, so the session file keeps the hint too (same text the model saw).

Test: identical_calls_get_a_hint_on_the_third (4 identical calls: hint on 3rd and 4th only). hx-core 69 tests, clippy, fmt, e2e scripts ok.

Closes #157. `Repeat` in `agent.rs`: counts consecutive tool calls with identical (tool, args, result). From the 3rd on, the result gets `[hx: this exact call returned the same result 3 times in a row; change approach or ask the user]` appended. Calls with a `timeout` arg (polling) are exempt. No hard stop; the existing `max_turns` stays. Only the request copy changes, so the session file keeps the hint too (same text the model saw). Test: `identical_calls_get_a_hint_on_the_third` (4 identical calls: hint on 3rd and 4th only). hx-core 69 tests, clippy, fmt, e2e scripts ok.
hermes added 1 commit 2026-10-15 20:37:33 +00:00
hermes merged commit 846756c0bd into main 2026-10-15 20:37:34 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#162