MoonshotAI / MoonshotAI/kimi-code
[Bug] wind-allskill 插件完全不可用:agent_gw Python SDK 未预装导致 NETWORK_ERROR
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
问题概述
wind-allskill 插件(Wind 万得数据)在 Kimi 桌面版中返回 NETWORK_ERROR,经排查根因为 agent_gw Python SDK 未预装 在 managed Python runtime 中。该依赖缺失导致 Wind 取数链路在导入阶段即崩溃,用户侧无法通过配置修复。
环境信息
| 项目 | 值 |
|---|---|
| 操作系统 | macOS |
| Node.js 版本 | v24.15.0 |
| Python 版本 | 3.12 (Kimi managed runtime) |
KIMI_API_KEY 环境变量 |
✅ 已设置 |
~/.kimi/agent-gw.json |
❌ 不存在 |
agent_gw Python 包 |
❌ 未安装 |
根因分析
执行链路
用户请求 → wind 技能路由 → cli.mjs → wind_tool.py
↓
from agent_gw import ... ← 💥 导入失败
↓
SystemExit("Missing dependency: agent-gw...")
↓
NETWORK_ERROR 返回给用户
关键代码位置
文件: wind-allskill/skills/wind-mcp-skill/scripts/wind_tool.py:28-33
def _client_cls():
try:
from agent_gw import AgentGwClient, AgentGwError
except ModuleNotFoundError as exc:
raise SystemExit(
"Missing dependency: agent-gw. Install it with: "
'pip install "git+ssh://git@dev.msh.team/leixun/agent-gw-pysdk.git@v0.1.0"'
) from exc
安装尝试
pip install "git+ssh://git@dev.msh.team/leixun/agent-gw-pysdk.git@v0.1.0"
失败: Connection closed by 198.18.0.16 port 22 — 客户端无 SSH 权限访问内部私有仓库。
配置 workaround 无效
曾尝试创建 ~/.kimi/agent-gw.json 作为 workaround,但无效 — 因为 agent_gw 导入失败发生在配置文件读取之前。
影响评估
| 插件/功能 | 状态 |
|---|---|
| Wind 行情查询 (A股/港股/美股/基金/指数/债券) | ❌ 完全不可用 |
| Wind K 线数据 | ❌ 完全不可用 |
| Wind 财务数据 | ❌ 完全不可用 |
| Wind 选股筛选 | ❌ 完全不可用 |
| Wind 宏观数据 (EDB) | ❌ 完全不可用 |
复现步骤
- 在 Kimi Work 中加载
wind-allskill插件 - 执行任意 Wind 数据查询,例如:
node cli.mjs call stock_data get_stock_price_indicators \ '{"windcode":"688234.SH","indexes":"最新成交价"}' - 返回
NETWORK_ERROR,detail 显示Missing dependency: agent-gw
建议修复方案
方案 A:预装 agent_gw SDK(推荐)
在 Kimi 桌面版的 managed Python runtime 中预装 agent_gw 包,或将其作为插件的捆绑依赖自动安装。
参考 Yahoo Finance 插件已采用的安装方式:
python3 -m pip install "$(curl -s https://cdn.kimi.com/agentgw/pysdk/manifest.json | python3 -c 'import json,sys; print(json.load(sys.stdin)["latest"]["url"])')"
方案 B:配置 datasource 模式为默认
将 datasource 直连模式设为默认,并确保 WIND_DS_API_KEY 环境变量在 Kimi Work 启动时自动注入。
方案 C:客户端 fallback 提示
在 wind_tool.py 中增加更友好的错误提示,指引用户通过 Kimi 设置面板重新授权或联系技术支持,而非抛出 cryptic 的 NETWORK_ERROR。
相关路径
wind_tool.py:.../wind-allskill/skills/wind-mcp-skill/scripts/wind_tool.pycli.mjs:.../wind-allskill/skills/wind-mcp-skill/scripts/cli.mjs- 插件版本:
wind-mcp-skill v1.9.7
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
Start with wind-allskill/skills/wind-mcp-skill/scripts/wind_tool.py:28-33 and trace how cli.mjs runs it in the managed Python runtime. Reproduce the shown stock query and inspect the Yahoo Finance plugin's installation approach and runtime dependency handling. Done should make Wind queries work without manual private-repository access, or provide a clear supported recovery path instead of NETWORK_ERROR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100