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

Aperta
#592 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
ai, cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
2.2k
Fork
281
Merge medio
14h 26m
PR unite (30g)
38

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MiniMax-AI/minimax-code

Tutte le issue di MiniMax-AI/minimax-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.