[Feature]: Add loop / repetition detection to stop runaway model output (e.g., endless emoji stream)

オープン
#592 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
ai, cli

調査の方向性

Start by locating the interactive TUI's streaming generation path and how it cancels a run when the user presses Esc; the issue does not name specific files or tests. Check whether output limits or repetition checks already exist, then trace how a stop notice and retry or continue options reach the user. Done means repetitive streaming output can be detected, stopped, and covered by configurable safeguards.

索引モデルが issue の本文から書いたものです。

説明

enhancement needs-triage tui
Product or interface

CLI - interactive TUI

Use case and problem

I'm using Mcode with BYOK (Bring Your Own Key) and the MiMo-V2.6-Pro model. Partway through a task, the model appeared to hallucinate and started emitting the same emoji over and over. The output never stopped on its own: the session kept showing Running (2min14s and counting) while the terminal filled with hundreds of identical emoji.

Today the only way out is to notice it and press Esc manually. If I'm not watching the session, it keeps generating indefinitely, which wastes tokens/cost on my own API key and blocks the rest of the task.

Question: does Mcode currently have any built-in mechanism to detect and break infinite/degenerate generation loops? If not, I'd like to request one.

Desired behavior

Mcode should detect degenerate, repetitive output and stop it automatically, regardless of which provider/model is used (including BYOK models).

Acceptance criteria:

  • Detect repetition in the streaming output (e.g., the same token, n-gram, or line repeated beyond a threshold) and abort the current generation.
  • Enforce a sensible per-turn output cap (max output tokens and/or max wall-clock time) as a safety net.
  • When a loop is detected, show a clear notice such as: Generation stopped: repetitive output detected (model may be looping). and return control to the user, with options to retry or continue.
  • Make thresholds configurable (or allow disabling) in settings, since some legitimate outputs may be repetitive.
  • Optionally pass frequency_penalty / repetition_penalty / max_tokens to providers that support them, configurable per model.
Platform

macOS

Alternatives and additional context
  • Workaround: manually pressing Esc to stop the run. This only works if I'm actively watching.
  • Model: MiMo-V2.6-Pro via BYOK. I understand the root cause is model behavior, but a client-side guard would protect users from any model that falls into a loop.
  • A screenshot of the runaway output is attached below.
Image
主要言語
TypeScript
スター
2.2k
フォーク
281
平均マージ
14時間 26分
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MiniMax-AI/minimax-code のほかの issue

MiniMax-AI/minimax-code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。