mcpField
Q
qwen-runner

qwen-runner

github.com/robsonrungAgent 工作流246 次安装1 天前更新
代码仓库

关于 qwen-runner

qwen-runner 是通过共享 pi-runner 实现调用固定 Qwen 模型的技能,适用于需要稳定 Qwen 执行席位并使用统一输出格式比较运行结果的工作流。

主要功能

  1. 01通过 OpenRouter 固定 Qwen 模型
  2. 02使用共享 pi-runner 执行
  3. 03分析角色默认只读
  4. 04提供 JSON 输出封装
  5. 05不回退到其他提供方

适用场景

  1. 01以 Qwen 执行席位运行提示词
  2. 02在 council 中比较运行结果
  3. 03以只读方式分析文件

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/robsonrung/rar-skills --skill qwen-runner

安装后在 Claude Code 中输入/qwen-runner确认已加载。

附带文件agents/openai.yamlscripts/run_qwen.py

详细介绍

Qwen Runner

通过共享的 pi-runner 实现,以 Qwen 席位执行提示词。这取代了之前基于 Cline 的垫片——每次调用都会固定使用 --provider openrouter --model qwen/qwen3.8-2.4t-a95b,因此该席位不再依赖 Cline 可变状态当前指向的提供方;应答的始终是转发的 Qwen 模型,由 OpenRouter 提供服务。

默认模型

  • qwen/qwen3.8-2.4t-a95b——Qwen3.8 27B(OpenRouter 目录中的上下文长度为 256K 个 token;属于 Qwen3.8 Max 系列的稠密开源权重 VLM——1M 的旗舰型号是单独的 qwen/qwen3.8-max id),每次运行都会固定使用 --provider openrouter --model qwen/qwen3.8-2.4t-a95b。可通过 --model 将 Qwen 席位切换到其他 OpenRouter 模型 id。

前置条件

  • 已安装 pi CLI 并将其加入 PATH(npm install -g @mariozechner/pi-coding-agent)
  • 环境中设置了 OPENROUTER_API_KEY(或 Pi 的身份验证存储中有 OpenRouter 凭证)

安全模型

此技能委托给 pi-runner,因此其执行和数据共享模型与 Pi 包装器相同——请参阅 ../pi-runner/SKILL.md。运行过程是隔离的(不会发现扩展、技能或 AGENTS.md/CLAUDE.md)。分析角色(除 implementer 外的所有角色)默认处于只读模式(仅启用 Pi 的文件读取工具)。传入 --allow-write 可选择退出只读模式,传入 --no-tools 可完全禁用工具。

共享包装器参考

支持的选项、角色、--json 输出信封键约定、返回码和注意事项均与共享包装器相同——请阅读 shared/references/runner-common.md,了解共享标志、信封键、返回码和席位保真规则。信封由 pi-runner/scripts/run_pi.py 生成,其中 runner=qwen、effective_runner=pi、effective_provider=qwen(根据 qwen/... 模型 id 推断);native_provider=openrouter 是提供服务的网关。

用法

python3 .agents/skills/qwen-runner/scripts/run_qwen.py "your prompt here"

路径使用已安装的 .agents/skills/ 布局。从此源代码仓库中调用 qwen-runner/scripts/run_qwen.py。

示例

python3 .agents/skills/qwen-runner/scripts/run_qwen.py "Explain the core module architecture"
python3 .agents/skills/qwen-runner/scripts/run_qwen.py --prompt-file /tmp/review.md --role codereviewer
python3 .agents/skills/qwen-runner/scripts/run_qwen.py "Read-only analysis" --restrict-tools --json
python3 .agents/skills/qwen-runner/scripts/run_qwen.py "Apply the accepted fix" --role implementer
python3 .agents/skills/qwen-runner/scripts/run_qwen.py "Answer from the brief only" --no-tools --json

行为

  1. 委托给共享的 pi-runner 实现,并将运行器身份设为 qwen(信封报告 runner=qwen、effective_runner=pi)。
  2. 每次调用都会固定使用 --provider openrouter --model qwen/qwen3.8-2.4t-a95b,因此 Qwen 席位实际应答的就是该模型——不存在可悄然将请求改道的可变提供方状态。
  3. 绝不会回退到其他提供方。缺少 CLI 时会明确阻止该席位(status: seat_unavailable、return_code -2);缺少凭证时会报告 status: auth_missing 和 auth_ok: false——这就是席位保真,也是所有运行器都遵循的同一原则:绝不使用其他模型的回答来替代 Qwen 席位的回答。
  4. 保留共享包装器信封,以便各委员会一致地比较 Qwen 与其他运行器的输出。

迁移说明

此技能不再使用基于 Cline 的垫片——现在仅依赖 pi 和 OPENROUTER_API_KEY。Gemma 和 Minimax 之前复用了此包装器中基于 Cline 的 main(),现在改为直接委托给 cline-runner,不受影响。如果其他工具仍直接通过 shell 调用 cline,也不受此更改影响。

评论

支持 Markdown