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

OpenClaw + GitHub Copilot GPT-5.4 Technical Fix Guide

Date: 2026-03-07

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

/home/water/.nvm/versions/node/v22.22.0/lib/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 /home/water/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/reply-DhtejUNZ.js, add a wrapper like this near the other provider wrappers:

constGITHUB_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"};functioncreateGitHubCopilotHeadersWrapper(baseStreamFn){const underlying = baseStreamFn ?? streamSimple;return(model, context, options)=>{returnunderlying(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:

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

Replace it with:

}elseif(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('/home/water/.openclaw/openclaw.json','utf8')); console.log('OK')"

Validate patched bundle syntax

node--check"/home/water/.nvm/versions/node/v22.22.0/lib/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.

  • 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.

Read more

榨干你的 OpenClaw:AI 编程 PUA 完全指南,从此让它不敢摆烂。

榨干你的 OpenClaw:AI 编程 PUA 完全指南,从此让它不敢摆烂。

大家好,我是顾北! 最近你有没有这种体验: 让 Claude Code / OpenClaw 帮你调个 bug,AI 试了两下,然后很礼貌地说: "I'm unable to resolve this issue. Please check your environment configuration." 我的环境怎么了?配置有什么问题?你 TM 就是在甩锅啊! 好消息是,现在有人把这件事做成了开源项目——用大厂 PUA 话术驯服 AI,让它不敢摆烂、不敢放弃、主动出击。 而且,还有另一个项目,把整个 AI 提示词操控技术系统化成了一本「学术框架」——配完整的龙虾评级体系。 🦞 先说那只改变了一切的龙虾 时间回到

OpenClaw国产平替来了!CoPaw个人助理告别复杂配置,新手10分钟上手,普通人也能薅爆国产AI羊毛

OpenClaw国产平替来了!CoPaw个人助理告别复杂配置,新手10分钟上手,普通人也能薅爆国产AI羊毛

第一章:CoPaw 是什么?国产 AI 数字搭档的核心魅力 现在市面上的 AI 智能助理不少,但要么门槛高得劝退普通人,要么功能单一没灵魂。而 CoPaw 不一样——它是通义实验室(阿里) 靠着 AgentScope 智能体生态做的国产 AI 数字搭档,既是 OpenClaw 的平替升级款,还把**「好用」** 和**「实用」** 拉满了,就算你不是技术出身,也能轻松拿捏专属智能助理。 跟传统 AI 工具比,CoPaw 最戳人的点就是既会干活又有温度: * 有长期记忆还懂你:能自定义专属人设,不管是称呼、性格还是相处模式,都由你说了算。系统会自动记着你的偏好、待办和重要决定,越用越合心意,再也不用面对冷冰冰的问答机器人; * 电脑杂活全包揽:重复又繁琐的活直接甩给它就行——定时清理桌面、查天气查股价、编辑

什么是人工智能?AI、机器学习、深度学习的关系

什么是人工智能?AI、机器学习、深度学习的关系

文章目录 * 什么是人工智能 * 人工智能的定义 * 人工智能的分类 * 什么是机器学习 * 机器学习的基本概念 * 机器学习的工作流程 * 机器学习的主要类型 * 什么是深度学习 * 深度学习的基本概念 * 深度学习的优势 * 深度学习的应用领域 * AI、机器学习、深度学习的关系 * 三者的层次关系 * 三者的发展历程 * 如何选择合适的方法 * 实际应用案例分析 * 案例一:垃圾邮件过滤 * 案例二:图像识别 * 案例三:推荐系统 * 学习路径建议 * 第一阶段:打好基础 * 第二阶段:深入学习 * 第三阶段:实战提升 * 总结 本篇文章将带你深入理解人工智能的核心概念,厘清AI、机器学习、深度学习之间的关系,为后续的学习打下坚实的基础。 什么是人工智能 人工智能的定义 人工智能,英文名称为Artificial Intelligence,简称AI,这个概念最早由约翰·麦卡锡在1956年的达特茅斯会议上提出。那么什么是人工智能呢?简单来说,人工智能就

用 python 开发一个可调用工具的 AI Agent,实现电脑配置专业评价

用 python 开发一个可调用工具的 AI Agent,实现电脑配置专业评价

在人工智能时代,AI Agent凭借其强大的任务处理能力,逐渐成为开发人员手中的得力工具。今天,我们就来一起动手,用Python打造一个能够调用工具的AI Agent,实现根据电脑信息对电脑配置进行专业评价的功能。 一、项目创建与目录结构 1.1 项目创建 首先,我们需要创建一个新的项目环境。这里使用UV进行项目创建。 uv init demo 项目创建完成后,进入项目文件夹并安装必要的包, 比如安装psutil uv add psutil 安装的包都会记录在pypoject.toml, 看看我都安装了哪些包 [project] name = "demo" version = "0.1.0" description = "Add your description here" readme = "README.