[Feature]: Add loop / repetition detection to stop runaway model output (e.g., endless emoji stream)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
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 内容生成。
描述
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_tokensto providers that support them, configurable per model.
Platform
macOS
Alternatives and additional context
- Workaround: manually pressing
Escto stop the run. This only works if I'm actively watching. - Model:
MiMo-V2.6-Provia 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.
- 主要语言
- TypeScript
- 星标
- 2.2k
- 派生
- 281
- 平均合并
- 14 小时 26 分钟
- 30 天内合并 PR
- 38
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MiniMax-AI/minimax-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
MiniMax-AI/minimax-code#556 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MiniMax-AI/minimax-code#507 ·
维护者通常 1 天内回复
-
bug needs-triage tui
难度 2/5 1-3 小时 新手友好度 72/100
MiniMax-AI/minimax-code#481 · 1 条评论 ·
维护者通常 1 天内回复
-
bug cli documentation needs-triage
难度 2/5 1-3 小时 新手友好度 84/100
MiniMax-AI/minimax-code#299 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
MiniMax-AI/minimax-code#588 · 1 条评论 ·
维护者通常 1 天内回复
查看 MiniMax-AI/minimax-code 的全部 Issue
相似的 Issue
-
needs-area-label
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
liberation-data/drivine#615 ·
维护者通常 1 天内回复
-
backend bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 78/100
geolens-io/geolens#3639 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
radius-project/ai-extensions#1196 ·
维护者通常 1 天内回复
-
good first issue
难度 1/5 1-3 小时 新手友好度 88/100