[Bug]: mcode 0.8.0 omits contentReviewEnabled for TUI/exec, stalling non-CN streaming every 80 thinking chars (1.4x-3.15x slowdown)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli, performance
Hướng nghiên cứu
Đọc packages/local-runtime-v2/src/services.ts quanh phần kết hợp máy chủ runtime cho runtimeOwnerKind === "tui"; so sánh với hành vi được báo cáo ở phiên bản 0.7.2. Kiểm tra giá trị khu vực và xác nhận các phiên quốc tế đặt contentReviewEnabled thành false. Hoàn tất khi luồng streaming của phiên bản 0.8.0 không còn thực hiện các bước kiểm tra an toàn đồng bộ được báo cáo cho các phiên ngoài Trung Quốc và hiệu năng khớp với tốc độ tiêu thụ dữ liệu dự kiến theo tốc độ mạng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Product or interface
CLI (mcode TUI / mcode exec)
中文摘要:在
@minimax-ai/[email protected](npm 当前latest)中,services.ts创建本地 runtime host 时,当runtimeOwnerKind === "tui"只传了{ tuiProductPolicy: true },漏掉了contentReviewEnabled: getRuntimeRegion() === "cn"。结果contentReviewEnabled变成undefined,安全门控managedProvider && !(tuiProductPolicy === true && contentReviewEnabled === false)在海外(en)环境也恒为true。OutputSafetyEventWriter会每 80 个字符同步阻塞thinking/ 文本流并发起一次串行 HTTP 安全审核(每次约200ms),导致思考较长的步骤出现 1.4×–3.15× 的纯流式阻塞耗时(单步多出+30s、长任务多出+100s至+310s并频繁触发超时)。建议在runtimeOwnerKind === "tui"分支恢复contentReviewEnabled: getRuntimeRegion() === "cn"。
Version
@minimax-ai/[email protected] (npm latest), Node.js v22.22.2, macOS 15 arm64, international (en) region with minimax-managed provider (minimax/MiniMax-M3.1-Flash).
Platform
macOS observed. The root cause is in the JS runtime composition, so it affects every non-CN (en) user on macOS, Linux, and Windows running mcode 0.8.0 (both TUI and mcode exec).
Issue area
Runtime / Streaming / Latency
Steps to reproduce
- Install
@minimax-ai/[email protected](npm i -g @minimax-ai/[email protected]) on an international (en) account. - Run a multi-step reasoning task with diagnostics enabled:
mcode exec \
--model minimax/MiniMax-M3.1-Flash \
--effort medium \
--output-format stream-json \
--diagnostics-dir /tmp/mcode-080-diag \
"Investigate a multi-file bug in a repository (any task producing ~5k-12k chars of thinking per step)"
- Compare
durationMs(end-to-end model step time) vsrequestDurationMs(actual LLM HTTP time) inprogress.jsonl, and inspect inter-chunk timestamps instream-json.
Expected and actual behavior
Expected: Outside cn, contentReviewEnabled is false so streaming chunks drain at network speed (modelDur ≈ reqDur, ~1.0×, ~1–2 ms per chunk).
Actual: Every ~80 chars (~5 chunks) of thinking or assistant text stalls for ~200–400 ms waiting on a synchronous HTTP content-safety flush, inflating wall-clock time by 1.4×–3.15× across every run:
Task (same commit, --effort medium) |
mcode 0.8.0 modelDur vs reqDur |
Overhead | Result | 0.7.2 baseline (contentReviewEnabled: false) |
|---|---|---|---|---|
Exploration T01 (4.4k think chars) |
68.0s vs 26.1s |
+42.0s (2.61×) |
ok (93.6s) |
38.9s vs 38.9s (1.00×, 65.7s) |
Investigation T04 (75.9k think chars) |
412.0s vs 203.8s |
+208.3s (2.02×) |
timeout at 480s | 224.2s vs 231.2s (0.97×, 289.7s, ok) |
Exploration T05 (2.9k think chars) |
58.8s vs 29.3s |
+29.4s (2.00×) |
ok (82.3s) |
62.2s vs 61.4s (1.01×, 100.3s) |
| Multi-file Edit E06 (Go) | 454.8s vs 144.6s |
+310.2s (3.15×) |
timeout at 480s | 1.07× (ok) |
| Multi-file Edit E12 (Python) | 357.1s vs 254.7s |
+102.3s (1.40×) |
timeout at 480s | 1.01× (ok) |
Inter-chunk delta proof on a single thinking step (10,390 chars, 650 chunks):
mcode 0.8.0: total drain27.85s,mean = 42.8ms/chunk,median = 0.0ms,p90 = 197ms— exact sawtooth of 5 zero-ms chunks (~80 chars) followed by a ~200–400ms blocking HTTP round-trip, repeated ~130 times in one step.0.7.2withcontentReviewEnabled: false(run simultaneously on the same machine/model):15,364chars /789chunks drained in1.08s,mean = 1.4ms/chunk,p90 = 2ms.
Root cause
In the 0.7.2 source (packages/local-runtime-v2/src/services.ts:1538-1543), the TUI/exec runtime host composition explicitly gates content review by region:
...(input.options.runtimeOwnerKind === "tui"
? {
tuiProductPolicy: true,
contentReviewEnabled: getRuntimeRegion() === "cn",
}
: {}),
In the published @minimax-ai/[email protected] bundle (chunks/chunk-JNRKF55Q.js), contentReviewEnabled was omitted from that branch:
...e.options.runtimeOwnerKind==="tui"?{tuiProductPolicy:!0}:{}
Because contentReviewEnabled is now undefined, the policy gate right above it:
function Y_s(e, t) {
return e && !(t.tuiProductPolicy === true && t.contentReviewEnabled === false);
}
evaluates to true for every minimax-managed session regardless of region. Downstream, pi-agent-core's stream consumer awaits onEvent → OutputSafetyEventWriter.handleChunk → await this.flushStreamingWindow("thinking") every 80 chars (cSs = 80), serializing an HTTP content-safety call onto the hot token-streaming path.
Suggested fix
Restore contentReviewEnabled: getRuntimeRegion() === "cn" in the runtimeOwnerKind === "tui" branch of local runtime host creation so international (en) CLI/TUI sessions do not run synchronous 80-char streaming content-safety checks.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 315
- Merge trung bình
- 3 giờ 54 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MiniMax-AI/minimax-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MiniMax-AI/minimax-code#639 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MiniMax-AI/minimax-code#615 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
MiniMax-AI/minimax-code#556 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MiniMax-AI/minimax-code#507 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage tui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MiniMax-AI/minimax-code#481 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MiniMax-AI/minimax-code
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
tashfeenahmed/freellmapi#2217 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
remotion-dev/skills#37 ·
-
gui: a narrow window's gateway key row with a line under it wraps its faded badges onto blank linesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Slider: Escape during a thumb drag keeps and commits the dragged value, unlike ui-sdk's other dragsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
vercel-labs/ui#1758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nicobailon/pi-subagents#3425 ·
Maintainer thường phản hồi trong vòng 1 ngày