MiniMax-AI / MiniMax-AI/minimax-code
[Feature]: 启动时主动检测系统代理(PAC),避免 undici 不支持 SOCKS5 导致握手失败
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 141
- Avg merge
- 2h 45m
- Merged PRs (30d)
- 46
Description
Problem / 你遇到的问题
背景
mavis(MiniMax Code)开启 PAC 模式 VPN(如 Xray / V2rayU)时,会自动走系统代理。但 mavis 底层使用的 Node.js undici fetch 不支持 SOCKS5 协议,握手阶段会报 UnsupportedProxyProtocol。
影响范围
所有使用 PAC 模式代理的中国开发者,特别是 Xray / V2rayU / Clash 系用户。
根因简述
- mavis 基于 Electron,Chromium 网络栈自动读 macOS 系统 PAC
- PAC 默认返回 SOCKS5 代理 URL(如
SOCKS5 127.0.0.1:1080) - mavis daemon 是 Node.js 子进程,用 undici fetch
- undici fetch 只支持 HTTP/HTTPS proxy,不支持 SOCKS5
- 握手阶段崩溃,根本到不了 VPN 路由层
复现步骤
- macOS 安装 V2rayU + Xray 核心
- 启动 PAC 模式(GFWList + 绕过大陆和局域网)
- 打开 MiniMax Code
- 触发一次 LLM 请求
- 报错:
UnsupportedProxyProtocol fetching "https://agent.minimaxi.com/mavis/api/v1/llm/v1/messages"
当前临时 workaround
```bash
launchctl setenv NO_PROXY "agent.minimaxi.com,*.minimaxi.com,localhost,127.0.0.1"
launchctl setenv no_proxy "$NO_PROXY"
完全退出 MiniMax Code(⌘Q),重新打开
```
建议改进
- 启动时主动检测 PAC / 系统代理,给一次性友好提示
- 错误信息本地化:把
UnsupportedProxyProtocol包装成中文提示,而不是直接透传 undici 底层错误 - config.yaml 支持
noProxy字段:配置文件级别排除 - 可选:集成
socks-proxy-agent,让 mavis 支持 SOCKS5 代理
环境
- 平台:macOS
- VPN:V2rayU + Xray 核心
- 代理协议:SOCKS5 (1080) / HTTPS proxy (1087)
- Node.js:undici fetch(默认不支持 SOCKS5)
Proposed solution / 期望方案
建议改进
- 启动时主动检测 PAC / 系统代理,给一次性友好提示
- 错误信息本地化:把
UnsupportedProxyProtocol包装成中文提示,而不是直接透传 undici 底层错误 - config.yaml 支持
noProxy字段:配置文件级别排除 - 可选:集成
socks-proxy-agent,让 mavis 支持 SOCKS5 代理
Platform / 平台
macOS
Additional context / 补充信息
No response
Before submitting / 提交前确认
- I have searched existing issues.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Start by locating the daemon startup path and its undici fetch usage, then determine which of the proposed approaches is in scope: PAC detection, localized error handling, noProxy configuration, or SOCKS5 support. Done should include a clear startup response for the reported macOS PAC/SOCKS5 failure and verification against the reproduction steps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, node.js, typescript
- Domain
- backend, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100