mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4195] [Engine] Serve: detect an agent rewriting the same file across turns (identical repeats and A/B oscillation) #1845
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1845
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mnott on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4195
Problem
In agent use (Anthropic Messages API, Claude-Code-style tool loops) Gyro models on Strata often finish a multi-file task and then keep rewriting files they already wrote, instead of sending their final answer:
Writewith byte-identical content, 30-100 times (Gyro Coder-L on a 40-task coding set; Gyro-M after all 40 files: one file written 79 times);calcexpression parser, 12+ writes).Each repeat is a full request with the whole conversation, so the run burns minutes (790 s instead of ~180 s for the same set) and often ends only at the client's own limit. Strata already breaks repetition inside one response (the serve layer raises temperature/presence penalty when the same words keep coming), but nothing looks across requests, although the server sees the whole conversation in every request.
Measurements (Apple Silicon, v0.2.6 + our open Metal PRs, see #4128)
A full night with the guards on (Gyro-M and Gyro-L, 8 runs each of a 20/40/40-task set plus 3 runs of 5 real repository tasks): identical-write fired 257 times (253 notes, 4 stops), revert 66 (7 stops), repeated test command 36, rewrites with changing content ("thrash", up to 16 writes in 10 versions of one file) 9. Harness limits still ended a few runs (two runaways: one inventing 807 files, one reading 79 invented paths; and a 30-minute cap on real tasks). Pass rates Gyro-M 98 / 81 / 83 % (easy / hard / short), Gyro-L 84 / 53 / 89 %.
(The client-side guard tells the model " already contains exactly this content" or "you are switching back to a version you already wrote; pick one and move on", and stops after 20 identical writes or 6 reverts.)
Proposal
An opt-in check in the serve layer for tool-calling requests: hash the arguments of each assistant tool call in the request history; when the new call repeats one of the last N calls exactly (or reverts a file's content to an earlier version) K times, either append a short system note to the prompt or answer with a final message instead of another call. Off by default; thresholds in the run config.
Related, same runs: a model that calls a tool the request did not declare (Gyro-L wanted
Bashtolsits output folder while only Read and Write were offered) gets the call passed through as plain text, because the parser keeps declared tools only; the client takes the text as the final answer and the run ends early (26 of 40 tasks written). Emitting such a call as atool_usewould let the client answer "no such tool" and the model continue with the tools it has.Before writing code: is this in scope for the server, or should it stay with the client/harness?
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.