MiniMax-AI / MiniMax-AI/minimax-code

[Bug]: mcode 默认不走系统代理,导致 provider test 在仅有代理出口的机器上固定 10000ms 超时

Open
#175 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug cli
Dominant language
TypeScript
Stars
1.3k
Forks
141
Avg merge
2h 45m
Merged PRs (30d)
46

Description

Product or interface

CLI - interactive TUI

Version

0.4.12

Platform

Linux

OS version and architecture

openEuler 24.03 (LTS-SP1) aarch64

Issue area

Startup / install / update

Desktop log upload ID (optional)

No response

Steps to reproduce

这是一个代理不支持的常见问题,如果用国外 API BYOK 的方式就会触发问题。

我们机器仅有代理出口,所以同样触发了这个问题。但是这个问题并不只是在这里触发。MiniMax 给 FrontierHarness Eval 的 PR 中也提到了这一问题。这是一个普适性问题。

$ echo $http_proxy;echo $https_proxy;echo $socks_proxy;
http://127.0.0.1:7890
http://127.0.0.1:7890


$ mcode provider add \
  --name "ds4.1flash" \
  --base-url "https://api.deepseek.com/anthropic" \
  --api-format anthropic-messages \
  --model "deepseek-flash[1m]" \
  --use

$ mcode provider test provider-7b0fdd --model deepseek-flash
Provider test failed: Request timed out after 10000ms. Check the URL, API key, and model ID, then retry.

使用 MiniMax 给 FrontierHarness Eval 的 PR 中类似的 proxy-adapter 可以解决

// file: /tmp/mcode-proxy.cjs
const { EnvHttpProxyAgent, setGlobalDispatcher } = require('/tmp/mcode-proxy/node_modules/undici');
if (!process.env.HTTPS_PROXY && !process.env.HTTP_PROXY) {
  throw new Error('HTTP(S)_PROXY is required');
}
setGlobalDispatcher(new EnvHttpProxyAgent());
$ NODE_OPTIONS='--require=/tmp/mcode-proxy.cjs' \
  mcode provider test provider-851e29 --model deepseek-flash --json
{
  "success": true,
  "status": {
    "state": "available",
    "lastTestedAt": 1789782605854
  }
}

$ NODE_OPTIONS='--require=/tmp/mcode-proxy.cjs' \
  mcode exec --cwd /tmp --permission off --max-steps 2 --timeout 45s \
  --output-format json \
  --model custom_provider:provider-851e29/deepseek-flash \
  'Reply with exactly OK and do not inspect or modify any files.'

{"status":"succeeded","output":"OK","model":{"providerId":"custom_provider:provider-851e29","modelId":"deepseek-flash","protocol":"openai-completions"},"durationMs":1247}
Expected and actual behavior

期望行为:mcode 支持代理,避免代理情况下超时报错发生。

Redacted error summary

Screenshots
Image
Before submitting
  • I have searched existing issues.
  • I have included my version and removed sensitive information.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mcode provider test and mcode exec entry points, reproducing the timeout on Linux with HTTP_PROXY and HTTPS_PROXY set. Trace how their outbound requests are made and compare the reported undici proxy-adapter behavior; done means provider tests and execution work through the configured proxy without the fixed 10000ms timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.