mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1803] [CLOSED] serve: opt-in guard for a repeated phrase (repeat_stop_period), and name repetition stops (stop_cause) #3684
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#3684
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1803
Author: @gt50
Created: 10/10/2026
Status: ❌ Closed
Base:
main← Head:repetition📝 Commits (2)
c5ce86bserve: an opt-in guard for a repeated phrase (repeat_stop_period), and name repetition stops (stop_cause)20baf99serve: stop_cause only with repeat_stop_period set; the repetition error names no unmerged option📊 Changes
5 files changed (+159 additions, -6 deletions)
View changed files
📝
docs/DETAILS.md(+10 -0)📝
serve/server.py(+51 -2)📝
serve/structured.py(+19 -2)📝
serve/test_server.py(+44 -2)📝
serve/test_structured.py(+35 -0)📄 Description
Title
Issue: relates to #606 and #728
Summary
Two things about replies Strata ends because they repeat:
Split out of #1789 (which now only carries the Windows AMD images), as AGENTS.md asks: one change per PR, a new feature opt-in.
What changed
serve/server.py,"repeat_stop_period": N(opt-in; default 1 = only #606's one-token rule):repeat_stop_tokenstokens that repeats with a period of 2..N tokens ends the reply like #606;[unclear]written untilmax_tokensran out (12,000 tokens, 229 s), which the one-token rule never sees;choices[0].stop_cause: a reply ended by either guard (or by #728'sreasoning_loop_recovery: "stop") keepsfinish_reason: "length"and adds Strata's own"stop_cause": "repetition"/"reasoning_loop". On the OpenAI chat API, streamed and not.serve/structured.py: a structured answer ended that way fails with a message that says the reply repeated itself, instead of "increase the output budget", which a largermax_tokenscannot fix. Responses API too.json_schemaon a scanned rent roll: the model wrote the escaped newline 256 times, #606 stopped it, and the client was told to raise the budget.docs/DETAILS.md.Extra Notes
repeat_stop_period1, the guard code is skipped. Replies that end normally, or atmax_tokens, are unchanged.stop_causeand the new message appear only when #606 or #728 already end a reply, which are replies that were already cut short.serve/test_server.pyRepeatStop: off by default, a phrase ended with period 16, period 1, a long varied reply runs to its end;serve/test_structured.py: the message,stop_causestreamed and not, and no cause for a real budget stop.serveand setup test files pass onmain61b3fb5d(1158 tests; rebased).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.