跳到主要内容
极客日志极客日志面向AI+效率的开发者社区
首页博客GitHub 精选镜像工具UI配色美学隐私政策关于联系
搜索内容 / 工具 / 仓库 / 镜像...⌘K搜索
注册
博客列表
JavaScriptNode.jsAI

OpenClaw + GitHub Copilot GPT-5.4 技术修复指南

综述由AI生成档记录了在 OpenClaw 中配置和修复 GitHub Copilot GPT-5.4 模型的技术方案。主要问题包括模型拒绝、缺少 IDE 认证头、API 路由错误以及网关不稳定。根本原因在于模型配置未完全接入、缺少 Copilot 专用 IDE 头信息、GPT-5.4 需使用 Responses API 而非 Chat Completions,以及 OpenClaw 传输层未正确支持 github-copilot 提供商。解决方案涉及更新 openclaw.json 配置文件以设置正确的 API 类型和模型注册,修改运行时 Bundle 文件以注入 IDE 头并修正路由逻辑,最后重启网关验证。升级后需重新应用补丁脚本以确保功能正常。

云朵棉花糖发布于 2026/4/6更新于 2026/6/237 浏览

OpenClaw + GitHub Copilot GPT-5.4 Technical Fix Guide

Overview

This guide documents how to make github-copilot/gpt-5.4 work inside OpenClaw when the model already works in OpenCode but fails in OpenClaw.

The final solution requires both:

  1. a config fix in ~/.openclaw/openclaw.json
  2. a runtime patch in the installed OpenClaw bundle

This is necessary because the problem is not only model registration. It is also an OpenClaw transport-routing issue for GitHub Copilot Responses API traffic.

Symptoms

The following errors may appear during debugging:

Symptom 1: model rejected
github-copilot/gpt-5.4 ... not allowed 
Symptom 2: IDE auth header missing
HTTP 400: bad request: missing Editor-Version header for IDE auth 
Symptom 3: unsupported provider mode
No API provider registered for api: github-copilot 
Symptom 4: wrong endpoint
HTTP 400: model "gpt-5.4" is not accessible via the /chat/completions endpoint 
Symptom 5: gateway instability
gateway disconnected: closed | idle 

Root Cause Analysis

There are four distinct problems.

1. Model config and allowlist mismatch

OpenClaw could see the provider, but github-copilot/gpt-5.4 was not fully wired into the active model config path used by the agent defaults.

2. Missing GitHub Copilot IDE headers

GitHub Copilot requires IDE-style headers for auth. OpenClaw was sending requests through a generic OpenAI-compatible path, so required headers were not included.

Required headers:

User-Agent: GitHubCopilotChat/0.35.0 Editor-Version: vscode/1.107.0 Editor-Plugin-Version: copilot-chat/0.35.0 Copilot-Integration-Id: vscode-chat 

Without them, Copilot returns:

missing Editor-Version header for IDE auth 
3. GPT-5.4 is not a Chat Completions model

gpt-5.4 must use the Responses API, not /chat/completions.

So this is wrong for gpt-5.4:

"api":"openai-completions"

This is required instead:

"api":"openai-responses"
4. OpenClaw transport routing only handled openai, not github-copilot

Even after changing gpt-5.4 to openai-responses, OpenClaw still fell back to the generic stream path because its embedded runner only activated the Responses transport for provider openai.

That caused OpenClaw to keep hitting /chat/completions for GitHub Copilot GPT-5.4.

Files Involved

Config file

~/.openclaw/openclaw.json

Installed OpenClaw runtime bundle

~/node_modules/openclaw/dist/reply-DhtejUNZ.js

Reapply script

~/.openclaw/workspace/ken-patchs/reapply-openclaw-copilot-gpt54-patches.mjs

Step 1: Fix the OpenClaw config

Update the GitHub Copilot provider block in ~/.openclaw/openclaw.json.

Provider-level requirements

Use:

{
  "baseUrl": "https://api.individual.githubcopilot.com",
  "api": "openai-completions"
}

Why keep provider API as openai-completions?

  • OpenClaw runtime expects the provider to stay on a supported generic adapter path
  • switching the entire provider to github-copilot caused runtime/provider registration failures
Model-level requirements for GPT-5.4

Set the gpt-5.4 model entry to:

{"id":"gpt-5.4","name":"GPT-5.4","api":"openai-responses","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":64000}
Agent model registration

Make sure this exists:

"agents":{"defaults":{"models":{"github-copilot/gpt-5.4":{}}}}

Step 2: Patch OpenClaw to inject Copilot IDE headers

OpenClaw needs to attach Copilot IDE headers before sending provider requests.

In ~/node_modules/openclaw/dist/reply-DhtejUNZ.js, add a wrapper like this near the other provider wrappers:

const GITHUB_COPILOT_IDE_HEADERS = {
  "User-Agent": "GitHubCopilotChat/0.35.0",
  "Editor-Version": "vscode/1.107.0",
  "Editor-Plugin-Version": "copilot-chat/0.35.0",
  "Copilot-Integration-Id": "vscode-chat"
};
function createGitHubCopilotHeadersWrapper(baseStreamFn) {
  const underlying = baseStreamFn ?? streamSimple;
  return (model, context, options) => {
    return underlying(model, context, { ...options, headers: { ...GITHUB_COPILOT_IDE_HEADERS, ...options?.headers } });
  };
}

Then apply it inside the provider wrapper logic:

if (provider === "github-copilot") agent.streamFn = createGitHubCopilotHeadersWrapper(agent.streamFn);

Step 3: Patch OpenClaw to route GitHub Copilot Responses correctly

Find the branch that decides which stream transport to use.

Original behavior:

} else if (params.model.api === "openai-responses" && params.provider === "openai") {

Replace it with:

} else if (params.model.api === "openai-responses" && (params.provider === "openai" || params.provider === "github-copilot")) {

Why this matters:

  • before the patch, github-copilot never entered the Responses transport branch
  • OpenClaw fell back to streamSimple
  • streamSimple hit /chat/completions
  • GPT-5.4 rejected that endpoint

After this patch:

  • github-copilot + openai-responses uses the correct Responses transport
  • GPT-5.4 no longer falls back to Chat Completions

Step 4: Validate and restart

Validate config JSON
node -e "JSON.parse(require('fs').readFileSync('~/node_modules/openclaw/dist/reply-DhtejUNZ.js', 'utf8')); console.log('OK')"

Note: Adjust the file path based on your actual installation.

Validate patched bundle syntax
node --check "~/node_modules/openclaw/dist/reply-DhtejUNZ.js"
Restart gateway
openclaw gateway restart 

Verification Procedure

  1. Set the model to github-copilot/gpt-5.4
  2. Send a simple prompt like hi
  3. Confirm the gateway stays connected
  4. Confirm none of these errors return:
missing Editor-Version header for IDE auth 
model "gpt-5.4" is not accessible via the /chat/completions endpoint 
No API provider registered for api: github-copilot 

Reapply After OpenClaw Updates

Because the runtime fix patches the installed OpenClaw bundle, upgrades or reinstalls may overwrite it.

Use the reapply script:

node ~/.openclaw/workspace/ken-patchs/reapply-openclaw-copilot-gpt54-patches.mjs openclaw gateway restart 

Design Notes

Why not switch the whole provider to api: "github-copilot"?

That looked tempting, but OpenClaw's runtime path did not have a compatible registered streaming provider for that mode in this setup, which caused runtime/provider registration failures.

Why not keep GPT-5.4 on openai-completions?

Because GitHub Copilot GPT-5.4 is not accessible on /chat/completions. It must go through the Responses API.

Why did OpenCode work earlier?

OpenCode already handled the GitHub Copilot transport path correctly, including the required Copilot headers and the proper API mode, while OpenClaw needed both config and runtime fixes.

Recommended Maintenance Notes

  • Keep this guide with the reapply script path documented nearby
  • After any OpenClaw upgrade, rerun the patch script
  • If OpenClaw changes its bundle file name, update the script path target accordingly
  • If GitHub Copilot changes required IDE header versions, update both the runtime patch and reapply script

Quick Recovery Commands

node ~/.openclaw/workspace/ken-patchs/reapply-openclaw-copilot-gpt54-patches.mjs openclaw gateway restart openclaw status 

Final State

With the config fix and runtime patches in place, github-copilot/gpt-5.4 works in OpenClaw and the gateway remains stable.

目录

  1. OpenClaw + GitHub Copilot GPT-5.4 Technical Fix Guide
  2. Overview
  3. Symptoms
  4. Symptom 1: model rejected
  5. Symptom 2: IDE auth header missing
  6. Symptom 3: unsupported provider mode
  7. Symptom 4: wrong endpoint
  8. Symptom 5: gateway instability
  9. Root Cause Analysis
  10. 1. Model config and allowlist mismatch
  11. 2. Missing GitHub Copilot IDE headers
  12. 3. GPT-5.4 is not a Chat Completions model
  13. 4. OpenClaw transport routing only handled openai, not github-copilot
  14. Files Involved
  15. Config file
  16. Installed OpenClaw runtime bundle
  17. Reapply script
  18. Step 1: Fix the OpenClaw config
  19. Provider-level requirements
  20. Model-level requirements for GPT-5.4
  21. Agent model registration
  22. Step 2: Patch OpenClaw to inject Copilot IDE headers
  23. Step 3: Patch OpenClaw to route GitHub Copilot Responses correctly
  24. Step 4: Validate and restart
  25. Validate config JSON
  26. Validate patched bundle syntax
  27. Restart gateway
  28. Verification Procedure
  29. Reapply After OpenClaw Updates
  30. Design Notes
  31. Why not switch the whole provider to api: "github-copilot"?
  32. Why not keep GPT-5.4 on openai-completions?
  33. Why did OpenCode work earlier?
  34. Recommended Maintenance Notes
  35. Quick Recovery Commands
  36. Final State
  • 💰 8折买阿里云服务器限时8折了解详情
  • Magick API 一键接入全球大模型注册送1000万token查看
  • 🤖 一键搭建Deepseek满血版了解详情
  • 一键打造专属AI 智能体了解详情
极客日志微信公众号二维码

微信扫一扫,关注极客日志

微信公众号「极客日志V2」,在微信中扫描左侧二维码关注。展示文案:极客日志V2 zeeklog

更多推荐文章

查看全部
  • LLM 性能优化核心概念与工程实践
  • AI Agent Skills 资源合集:支持 Cursor、Claude Code 及 Copilot 一键安装
  • VSCode Copilot 无法连接网络问题解决方案
  • C++11 核心新特性详解:初始化、右值引用与类型推导
  • Visual Studio 2022 AI 编码工具 Windsurf 功能与安装指南
  • Flutter ml_algo 在鸿蒙系统下的端侧计算适配与重构指南
  • OpenCode 使用 GitHub Copilot 计费异常分析与修复
  • CSS 元素显示模式详解:块级、行内与行内块
  • Stable Diffusion 写真生成完整教程
  • TRAE vs Qoder vs Cursor vs GitHub Copilot 深度对比与选型指南
  • SFTPGo WebUI 中文汉化方案
  • ClaudeCode 与 Figma-MCP 实现前端 UI 代码 1:1 还原指南
  • 前端图片加载失败与裂图原因全解析
  • AI 领域顶级教授课程推荐:吴恩达、李飞飞、李宏毅等深度学习资源
  • Angular 中 Observable 的数据流抽象机制
  • 无需公网 IP 安全远程访问本地 AI 服务方案
  • Rust语言入门全攻略:从选型到首个可发布CLI工具
  • Fooocus 部署实践:本地手动配置与云端一键启用对比
  • StructBERT 中文情感分类 WebUI 实现与多语言切换
  • Mac M4 环境 VMware Fusion 安装 Ubuntu 24.04 LTS ARM 版

相关免费在线工具

  • RSA密钥对生成器

    生成新的随机RSA私钥和公钥pem证书。 在线工具,RSA密钥对生成器在线工具,online

  • Mermaid 预览与可视化编辑

    基于 Mermaid.js 实时预览流程图、时序图等图表,支持源码编辑与即时渲染。 在线工具,Mermaid 预览与可视化编辑在线工具,online

  • 随机西班牙地址生成器

    随机生成西班牙地址(支持马德里、加泰罗尼亚、安达卢西亚、瓦伦西亚筛选),支持数量快捷选择、显示全部与下载。 在线工具,随机西班牙地址生成器在线工具,online

  • Keycode 信息

    查找任何按下的键的javascript键代码、代码、位置和修饰符。 在线工具,Keycode 信息在线工具,online

  • Escape 与 Native 编解码

    JavaScript 字符串转义/反转义;Java 风格 \uXXXX(Native2Ascii)编码与解码。 在线工具,Escape 与 Native 编解码在线工具,online

  • JavaScript / HTML 格式化

    使用 Prettier 在浏览器内格式化 JavaScript 或 HTML 片段。 在线工具,JavaScript / HTML 格式化在线工具,online