[GH-ISSUE #710] v0.1.38: cross-request tool loop repeats an ineffective repair 98 times despite a thinking budget #327

Closed
opened 2026-11-04 01:41:59 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @pellorao on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/710

On Strata v0.1.38, a text-only review task entered a cross-request loop of client-executed tool calls, despite an existing per-request thinking budget. The model repeatedly issued the same ineffective repair command and did not complete delivery before the harness deadline.

Opening a standalone issue because #75 and #602 are both closed. Their earlier reports are related history; this report specifically concerns repeated tool calls separated by tool results and subsequent model requests, rather than only repeated thinking text within one response. The root cause has not been isolated.

Observed behavior

During one text-only code/document review, the model drafted a JSONL report, then repeatedly attempted the same ineffective JSON repair:

  • 98 consecutive identical shell commands, spanning 2,091.936 seconds (about 34.9 minutes).
  • At an intermediate checkpoint, the draft had 118 lines and the same five lines still failed JSON parsing. The repair command returned exit code 0; successful tool execution did not mean the intended repair had succeeded.
  • At minute 55, the harness delivered a message requiring the model to consolidate the report and finish within the remaining five minutes. Delivery was confirmed in the original session.
  • After that message, the model did repair the JSON syntax, but continued rereading source files instead of completing the task.
  • At minute 60, the harness interrupted the active turn. The native task ended as incomplete; total reviewer elapsed time was 3,600.738 seconds. The syntactically valid draft was retained and was not treated as a completed delivery.

This was continued model/tool activity, rather than an engine that stopped emitting tokens. We did not repair the draft ourselves or rerun the task to replace the failed observation.

Environment and relevant settings

  • Strata v0.1.38, official prebuilt NVIDIA engine; also the latest published release when checked for this report.
  • Qwen3.8-Flash-Next GSQ-RCO Q2_0, text only.
  • Inference on Windows native Python/CUDA; Codex 0.160.0 on WSL owns the session and executes shell/file tools.
  • Hardware: i9-14900K, 64 GB RAM, RTX 4070 Ti SUPER 16 GB.
  • Codex reasoning effort: medium.
  • Per-request defaults for that effort: temperature=0, top_p=1, top_k=20, reasoning_budget_tokens=4096, max_tokens=16384.
  • Speculative decoding setting: --spec-min-p 0.7 (this is not the sampling min_p setting).
  • A separately trained expert-cache profile was loaded, with saving disabled during evaluation. This changes expert placement/profile data, not model weights. It is a relevant condition, not an identified cause; no matched default-profile reproduction of this loop has been established.
  • Codex Responses requests pass through our local adapter to Strata Chat Completions. Ordinary tool calls are returned to Codex and executed by its harness. This observation has not been isolated to a direct-Strata minimal reproducer, so the adapter/harness remains part of the reproduction conditions.

Reproduction scope and distinction from other reports

This is one directly observed failed instance, not a measured failure rate or a deterministic minimal reproducer. The original task was a substantial multi-file review requiring a structured report and validation. Full private session logs and task contents are not attached; the counts above were checked against those logs and preserved drafts.

The behavior resembles the repeated verification/tool calls reported in #602. It differs from #606's persistent single-character output on subsequent independent requests, and from #702's repeated sentences/thinking in ordinary chat. We have not established a shared root cause. Since this run used greedy sampling, it also does not establish whether the recommended sampled thinking settings prevent this behavior.

Questions for mitigation

  1. Does Strata have a supported repeated-tool/no-progress guard for client-owned tool loops across requests, or a supported configuration we have missed? The v0.1.38 engine-silence watchdog and server-owned MCP max_rounds limit appear to address different boundaries.
  2. Is there a recommended inference configuration or model/quantization comparison to distinguish model behavior from an inference-path problem? We would prefer a controlled comparison to assuming that token-level repetition penalties solve semantic repetition.
  3. Would an optional diagnostic/guard be appropriate, or should this live entirely in the calling harness? A per-request thinking/output cap was already enabled here, but the next request receives a fresh budget. Our current fallback is a task deadline; possible earlier intervention is to detect repeated identical calls with unchanged failure evidence, send one warning, then interrupt if no recovery occurs.

A warning produced partial recovery in this instance, but did not produce completed delivery. We are therefore reporting both the recovery and the remaining failure, without claiming that reminders alone prevent recurrence.

Originally created by @pellorao on GitHub (Oct 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/710 On Strata v0.1.38, a text-only review task entered a **cross-request loop of client-executed tool calls**, despite an existing per-request thinking budget. The model repeatedly issued the same ineffective repair command and did not complete delivery before the harness deadline. Opening a standalone issue because #75 and #602 are both closed. Their earlier reports are related history; this report specifically concerns repeated tool calls separated by tool results and subsequent model requests, rather than only repeated thinking text within one response. The root cause has not been isolated. ### Observed behavior During one text-only code/document review, the model drafted a JSONL report, then repeatedly attempted the same ineffective JSON repair: - **98 consecutive identical shell commands**, spanning **2,091.936 seconds (about 34.9 minutes)**. - At an intermediate checkpoint, the draft had 118 lines and the same five lines still failed JSON parsing. The repair command returned exit code 0; successful tool execution did not mean the intended repair had succeeded. - At minute 55, the harness delivered a message requiring the model to consolidate the report and finish within the remaining five minutes. Delivery was confirmed in the original session. - After that message, the model did repair the JSON syntax, but continued rereading source files instead of completing the task. - At minute 60, the harness interrupted the active turn. The native task ended as `incomplete`; total reviewer elapsed time was **3,600.738 seconds**. The syntactically valid draft was retained and was not treated as a completed delivery. This was continued model/tool activity, rather than an engine that stopped emitting tokens. We did not repair the draft ourselves or rerun the task to replace the failed observation. ### Environment and relevant settings - Strata **v0.1.38**, official prebuilt NVIDIA engine; also the latest published release when checked for this report. - Qwen3.8-Flash-Next GSQ-RCO **Q2_0**, text only. - Inference on **Windows native Python/CUDA**; **Codex 0.160.0 on WSL** owns the session and executes shell/file tools. - Hardware: i9-14900K, 64 GB RAM, RTX 4070 Ti SUPER 16 GB. - Codex reasoning effort: `medium`. - Per-request defaults for that effort: `temperature=0`, `top_p=1`, `top_k=20`, `reasoning_budget_tokens=4096`, `max_tokens=16384`. - Speculative decoding setting: `--spec-min-p 0.7` (this is not the sampling `min_p` setting). - A separately trained **expert-cache profile** was loaded, with saving disabled during evaluation. This changes expert placement/profile data, not model weights. It is a relevant condition, not an identified cause; no matched default-profile reproduction of this loop has been established. - Codex Responses requests pass through our local adapter to Strata Chat Completions. Ordinary tool calls are returned to Codex and executed by its harness. This observation has not been isolated to a direct-Strata minimal reproducer, so the adapter/harness remains part of the reproduction conditions. ### Reproduction scope and distinction from other reports This is **one directly observed failed instance**, not a measured failure rate or a deterministic minimal reproducer. The original task was a substantial multi-file review requiring a structured report and validation. Full private session logs and task contents are not attached; the counts above were checked against those logs and preserved drafts. The behavior resembles the repeated verification/tool calls reported in #602. It differs from #606's persistent single-character output on subsequent independent requests, and from #702's repeated sentences/thinking in ordinary chat. We have not established a shared root cause. Since this run used greedy sampling, it also does not establish whether the recommended sampled thinking settings prevent this behavior. ### Questions for mitigation 1. Does Strata have a supported repeated-tool/no-progress guard for **client-owned tool loops across requests**, or a supported configuration we have missed? The v0.1.38 engine-silence watchdog and server-owned MCP `max_rounds` limit appear to address different boundaries. 2. Is there a recommended inference configuration or model/quantization comparison to distinguish model behavior from an inference-path problem? We would prefer a controlled comparison to assuming that token-level repetition penalties solve semantic repetition. 3. Would an optional diagnostic/guard be appropriate, or should this live entirely in the calling harness? A per-request thinking/output cap was already enabled here, but the next request receives a fresh budget. Our current fallback is a task deadline; possible earlier intervention is to detect repeated identical calls with unchanged failure evidence, send one warning, then interrupt if no recovery occurs. A warning produced partial recovery in this instance, but did not produce completed delivery. We are therefore reporting both the recovery and the remaining failure, without claiming that reminders alone prevent recurrence.
Author
Owner

@BlueKingMuch commented on GitHub (Oct 6, 2026):

With temperature: 0 every request is decoded greedy: the model always takes its single most likely continuation, and when the context barely changes from one request to the next (the same failure appended again), that stays the same repair. A per-request thinking budget can't break that, and a config "sampling" block wouldn't either, because a request's own temperature: 0 wins. Earlier Qwen3 model cards warned explicitly that greedy decoding can lead to endless repetitions; for this model Qwen recommends temperature 1.0, top_p 0.95, top_k 20 in thinking mode. If your adapter sends that instead, the next attempt gets a chance to take another path. See also #728.

<!-- gh-comment-id:6018266542 --> @BlueKingMuch commented on GitHub (Oct 6, 2026): With `temperature: 0` every request is decoded greedy: the model always takes its single most likely continuation, and when the context barely changes from one request to the next (the same failure appended again), that stays the same repair. A per-request thinking budget can't break that, and a config `"sampling"` block wouldn't either, because a request's own `temperature: 0` wins. Earlier Qwen3 model cards warned explicitly that greedy decoding can lead to endless repetitions; for this model Qwen recommends temperature 1.0, top_p 0.95, top_k 20 in thinking mode. If your adapter sends that instead, the next attempt gets a chance to take another path. See also #728.
Author
Owner

@pellorao commented on GitHub (Oct 7, 2026):

Thanks @BlueKingMuch for the sampling suggestion. We completed a follow-up comparison on Strata v0.1.40.1 / engine v0.1.40, with Codex 0.160.1. In this workload, the suggested settings did not reduce the observed looping, so we are keeping our existing sampling settings for now.

This was the same frozen, substantial text-only Commit Audit task, with three independent runs per condition. It is a follow-up experiment, not an exact replay of the original v0.1.38 failure: this batch used Q2_0, high effort, the default expert profile with saving disabled, an 8192-token thinking budget / 24576 total output budget, and a 100000 compaction threshold / 156584-token window. Windows-native Strata/CUDA and the WSL Codex harness remained in the path.

Within each machine, hardware and other settings stayed fixed. The baseline excluded only our explicit loop-prevention prompt block. The prompt arm added that block; the sampling arm instead used temperature=1, top_p=0.95, top_k=20. Both retained the same task-completion instructions and compaction policy. Baseline and prompt sampling were temperature=0, top_p=1, top_k=20. We checked the actual sampling path/settings, rather than only changing a configuration default.

Host / condition Loop groups, runs 1 / 2 / 3 Total loop iterations, runs 1 / 2 / 3 Runs with a confirmed loop Mean task work, minutes
RTX 4070 Ti SUPER 16GB: baseline 0 / 3 / 2 0 / 393 / 17 2/3 26.1
Same host: explicit loop-prevention prompt 7 / 4 / 3 51 / 25 / 22 3/3 23.3
RTX 3080 Ti 12GB: baseline 3 / 6 / 4 30 / 65 / 15 3/3 44.6
Same host: suggested sampling 11 / 7 / 9 67 / 64 / 49 3/3 approximately 48.6

The local host has an i9-14900K / 64GB RAM; the remote host has an i9-13900 / 64GB RAM. We compare each intervention only against its same-host baseline; the two machines are not treatment/control partners.

Counting: these are manually classified groups of repeated no-progress reasoning or tool actions, not raw tool-call counts. Each group's count includes its first occurrence; the total sums all confirmed groups. We deduplicated native event mirrors and excluded genuine fixes, new relevant evidence, ordinary mapping of different requirements, and necessary harness recovery. Reasoning can contain several observable repeated decisions inside one item, so semantic segmentation involves judgment.

The prompt arm's lower mean iteration count (136.7 -> 32.7) is dominated by one baseline run's 379 consecutive repeated normalization lines. Its median rose from 17 to 25, and loops occurred in all three prompt runs. This is at most a possible indication of less extreme repetition, not evidence of consistent prevention.

On the RTX 3080 Ti, mean loop groups rose from 4.3 to 9.0 and mean total iterations from 36.7 to 60.0 with the suggested sampling. Mean work time also rose by about 8.8%. The limited batch therefore did not show the hoped-for benefit; it does not prove that sampled thinking is worse for other tasks.

For completeness, the sampled arm's mean internal engine output rate was approximately 79.8-85.1 token/s, versus 86.2 token/s for that host's baseline. Its per-run internal generated-token counts were 134365-150731, 163988-172180, and 79074. The first two are possible ranges: one resumed after an unexpected reboot and lacks one generation stage's final counter; another hit the 60-minute task deadline with an unfinished guardian stage. Bounds use retained internal counters, actual request budgets and timing evidence (including the assumption that retained server/native UTC clocks are comparable), not API usage or guessed midpoint counts; they are not confidence intervals. Downtime is excluded from work time, but the reboot changed cache conditions. These failures remain in the results and were not rerun to obtain better outcomes.

We will retain the current sampling parameters and loop-prevention prompt, without claiming the prompt is a validated optimization. The review results remain diagnostic rather than formal capability acceptance. We are sharing this as a workload-specific counterexample and feedback on the suggestion, rather than an isolated Strata-only reproducer or a general rejection of Qwen's recommended settings.

<!-- gh-comment-id:6036302364 --> @pellorao commented on GitHub (Oct 7, 2026): Thanks @BlueKingMuch for the sampling suggestion. We completed a follow-up comparison on Strata **v0.1.40.1 / engine v0.1.40**, with Codex 0.160.1. In this workload, the suggested settings did **not** reduce the observed looping, so we are keeping our existing sampling settings for now. This was the same frozen, substantial text-only Commit Audit task, with three independent runs per condition. It is a follow-up experiment, **not an exact replay of the original v0.1.38 failure**: this batch used Q2_0, **high** effort, the default expert profile with saving disabled, an 8192-token thinking budget / 24576 total output budget, and a 100000 compaction threshold / 156584-token window. Windows-native Strata/CUDA and the WSL Codex harness remained in the path. Within each machine, hardware and other settings stayed fixed. The baseline excluded only our explicit loop-prevention prompt block. The prompt arm added that block; the sampling arm instead used temperature=1, top_p=0.95, top_k=20. Both retained the same task-completion instructions and compaction policy. Baseline and prompt sampling were temperature=0, top_p=1, top_k=20. We checked the actual sampling path/settings, rather than only changing a configuration default. | Host / condition | Loop groups, runs 1 / 2 / 3 | Total loop iterations, runs 1 / 2 / 3 | Runs with a confirmed loop | Mean task work, minutes | |---|---|---|---|---:| | RTX 4070 Ti SUPER 16GB: baseline | 0 / 3 / 2 | 0 / 393 / 17 | 2/3 | 26.1 | | Same host: explicit loop-prevention prompt | 7 / 4 / 3 | 51 / 25 / 22 | 3/3 | 23.3 | | RTX 3080 Ti 12GB: baseline | 3 / 6 / 4 | 30 / 65 / 15 | 3/3 | 44.6 | | Same host: suggested sampling | 11 / 7 / 9 | 67 / 64 / 49 | 3/3 | approximately 48.6 | The local host has an i9-14900K / 64GB RAM; the remote host has an i9-13900 / 64GB RAM. We compare each intervention only against its **same-host** baseline; the two machines are not treatment/control partners. Counting: these are manually classified groups of repeated **no-progress reasoning or tool actions**, not raw tool-call counts. Each group's count includes its first occurrence; the total sums all confirmed groups. We deduplicated native event mirrors and excluded genuine fixes, new relevant evidence, ordinary mapping of different requirements, and necessary harness recovery. Reasoning can contain several observable repeated decisions inside one item, so semantic segmentation involves judgment. The prompt arm's lower mean iteration count (136.7 -> 32.7) is dominated by one baseline run's **379 consecutive repeated normalization lines**. Its median rose from 17 to 25, and loops occurred in all three prompt runs. This is at most a possible indication of less extreme repetition, not evidence of consistent prevention. On the RTX 3080 Ti, mean loop groups rose from 4.3 to 9.0 and mean total iterations from 36.7 to 60.0 with the suggested sampling. Mean work time also rose by about 8.8%. The limited batch therefore did not show the hoped-for benefit; it does not prove that sampled thinking is worse for other tasks. For completeness, the sampled arm's mean internal engine output rate was approximately **79.8-85.1 token/s**, versus **86.2 token/s** for that host's baseline. Its per-run internal generated-token counts were **134365-150731**, **163988-172180**, and **79074**. The first two are possible ranges: one resumed after an unexpected reboot and lacks one generation stage's final counter; another hit the 60-minute task deadline with an unfinished guardian stage. Bounds use retained internal counters, actual request budgets and timing evidence (including the assumption that retained server/native UTC clocks are comparable), not API usage or guessed midpoint counts; they are not confidence intervals. Downtime is excluded from work time, but the reboot changed cache conditions. These failures remain in the results and were not rerun to obtain better outcomes. We will retain the current sampling parameters and loop-prevention prompt, without claiming the prompt is a validated optimization. The review results remain diagnostic rather than formal capability acceptance. We are sharing this as a workload-specific counterexample and feedback on the suggestion, rather than an isolated Strata-only reproducer or a general rejection of Qwen's recommended settings.
Author
Owner

@BlueKingMuch commented on GitHub (Oct 7, 2026):

Thanks for testing it this carefully. That settles my suggestion for this workload: sampling didn't reduce the loops. So the defaults I proposed in #728 should be read as the model's published settings, not as a loop fix.

On your first question: 0.1.40 added an opt-in "reasoning_loop_recovery" setting in strata-<model>.json (#869, off by default, see DETAILS). It only looks at the reasoning of the reply being generated: "stop" ends a reply whose reasoning repeats whole passages, "recover" (only at high or xhigh effort) continues it once with the low-effort instruction. It doesn't see a loop of tool calls across requests like the one in your report, and I don't know of anything in Strata that does.

On your second question: if I understood correctly, both batches ran Q2_0. On ISTA-DASLab's published tests it reaches a task average of 89.1 against the full model's 93.1, with the largest gap on LiveCodeBench v6 (81.1 against 87.4), while IQ3_XXS reaches 92.6 and IQ3_S 93.3; on 64 GB of RAM all four sizes fit (MODELS.md). In #728, RobinMeyer's loops stopped after he switched from Swift 1.5 IQ2_XS to the standard IQ3_XXS, though that changed the model as well. Repeating your greedy baseline on one host with IQ3_XXS or IQ3_S instead of Q2_0 would show whether the quantization is a large part of the looping.

<!-- gh-comment-id:6037187370 --> @BlueKingMuch commented on GitHub (Oct 7, 2026): Thanks for testing it this carefully. That settles my suggestion for this workload: sampling didn't reduce the loops. So the defaults I proposed in #728 should be read as the model's published settings, not as a loop fix. On your first question: 0.1.40 added an opt-in `"reasoning_loop_recovery"` setting in `strata-<model>.json` (#869, off by default, see DETAILS). It only looks at the reasoning of the reply being generated: `"stop"` ends a reply whose reasoning repeats whole passages, `"recover"` (only at high or xhigh effort) continues it once with the low-effort instruction. It doesn't see a loop of tool calls across requests like the one in your report, and I don't know of anything in Strata that does. On your second question: if I understood correctly, both batches ran Q2_0. On [ISTA-DASLab's published tests](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF#results) it reaches a task average of 89.1 against the full model's 93.1, with the largest gap on LiveCodeBench v6 (81.1 against 87.4), while IQ3_XXS reaches 92.6 and IQ3_S 93.3; on 64 GB of RAM all four sizes fit (MODELS.md). In #728, RobinMeyer's loops stopped after he switched from Swift 1.5 IQ2_XS to the standard IQ3_XXS, though that changed the model as well. Repeating your greedy baseline on one host with IQ3_XXS or IQ3_S instead of Q2_0 would show whether the quantization is a large part of the looping.
Author
Owner

@BlueKingMuch commented on GitHub (Oct 7, 2026):

additional context: i never ran quantizations below IQ3_XXS, just right now I am testing IQ3_S with the "oh my pi" harness, where I run a blender design benchmark.

in this setup, i could not observe tool looping behaviour, but rather tool editing errors, where the model repeatedly guesses line positions wrong and needs sometimes 2-3 retries with re-reading the file it wants to edit:

Image
<!-- gh-comment-id:6037307433 --> @BlueKingMuch commented on GitHub (Oct 7, 2026): additional context: i never ran quantizations below IQ3_XXS, just right now I am testing IQ3_S with the "oh my pi" harness, where I run [a blender design benchmark](https://blenderbench.realityreprojector.com/tasks/worn-boot). in this setup, i could not observe tool looping behaviour, but rather tool editing errors, where the model repeatedly guesses line positions wrong and needs sometimes 2-3 retries with re-reading the file it wants to edit: <img width="1693" height="1000" alt="Image" src="https://github.com/user-attachments/assets/815dceb1-4fdf-4ffb-b6c9-859618ac47c7" />
Author
Owner

@Niko1221 commented on GitHub (Oct 7, 2026):

Closing as a duplicate of #728: the repeated tool call across requests is a client-executed loop, so it lives between your adapter and the model, and the per-request loop recovery in 0.1.40 does not see across requests. If you have the request logs showing the model itself repeating, please open a new issue with them.

<!-- gh-comment-id:6037755816 --> @Niko1221 commented on GitHub (Oct 7, 2026): Closing as a duplicate of #728: the repeated tool call across requests is a client-executed loop, so it lives between your adapter and the model, and the per-request loop recovery in 0.1.40 does not see across requests. If you have the request logs showing the model itself repeating, please open a new issue with them.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#327
No description provided.