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

2026年医疗AI的可信革命全栈实现(上)

2026年医疗AI的可信革命全栈实现(上)

当AI Agent学会说“我不知道” 主题关键词:Python、向量数据库、医疗AI Agent、贝叶斯网络、NVIDIA 2026 适用对象:医疗信息化团队、算法工程师、医院CIO/CTO、科研与产品团队 核心判断:医疗AI下一阶段的竞争焦点,不是更会“说”,而是更会“量化不确定性、约束错误传播,并在必要时把决定权交还给人类专家”。 执行摘要 本文围绕一个核心命题展开:在2026年的医疗AI部署中,真正稀缺的并不是生成文本的能力,而是系统对“不确定性”的治理能力。大语言模型擅长读懂语言、整合文档、生成解释,却不天然擅长在证据不足时保持克制。贝叶斯网络与贝叶斯增强方法提供的,正是这种“认知刹车”。 工程上,本文给出一套完整实现路径:以Python作为主开发语言,以结构化患者工件作为中间表示,以Milvus/Qdrant/pgvector或FAISS/cuVS承接证据层,以pgmpy/PyMC/NumPyro承接概率推理层,

OpenClaw Skills 安装与实战:打造你的 AI 技能工具箱

OpenClaw Skills 安装与实战:打造你的 AI 技能工具箱

OpenClaw Skills 安装与实战:打造你的 AI 技能工具箱 本文介绍如何使用 ClawHub 安装和管理 OpenClaw 技能包,并通过实战案例演示多个技能的协同使用。 前言 OpenClaw 是一个强大的 AI 助手框架,而 Skills(技能包)则是扩展其能力的核心方式。通过安装不同的技能包,你可以让 AI 助手具备搜索、总结、开发指导、自我学习等能力。 本文将带你完成: * ClawHub CLI 的安装与使用 * 多个实用技能包的安装 * Self-Improving 记忆系统的初始化 * 一个综合实战案例演示 一、ClawHub:技能包管理器 1.1 什么是 ClawHub ClawHub 是 OpenClaw 的官方技能包市场,提供了丰富的技能包供用户安装使用。 安装 ClawHub

AI的提示词专栏:重构建议 Prompt,代码可读性提升

AI的提示词专栏:重构建议 Prompt,代码可读性提升

AI的提示词专栏:重构建议 Prompt,代码可读性提升 本文围绕重构建议 Prompt 在提升代码可读性中的应用展开,先明确代码可读性的五大评价维度(命名规范、函数设计、逻辑简化、注释完整性、代码复用)及量化标准,再构建基础版、进阶版、专家版三级 Prompt 设计框架,结合 Python、Java、JavaScript/TypeScript、Go 等主流语言特性提供适配技巧,还分析了 Prompt 使用中常见问题(如模型误解需求、方案不可执行)及解决方案。最后通过核心要点回顾、实践建议和不同难度的课后练习,形成 “问题识别 - Prompt 设计 - 方案落地 - 效果验证” 的全流程指南,助力开发者利用 Prompt 高效完成代码重构,平衡代码可读性与业务稳定性。 人工智能专栏介绍     人工智能学习合集专栏是

AI写代码工具哪个好用?资深码农实测,看这篇就够!

AI写代码工具哪个好用?资深码农实测,看这篇就够!

身为一个老程序员,我亲身经历了从纯手敲代码到AI智能辅助的演变。现在,如果一个程序员还不懂得利用AI工具,那无异于放弃了“第二次工业革命”。市场上的AI编程工具层出不穷,但究竟哪款才适合你?今天,我就为大家深度评测5款我亲自使用过且认为非常好用的工具,帮你精准避坑,高效提升。 1. Lynx:对话式应用生成器,快速构建原型的神器 Lynx 是一款相对较新但理念非常前沿的对话式AI编程工具。它的目标不仅仅是生成代码片段,而是让你通过自然语言对话,直接创建出可运行的全栈Web应用。 * 核心优势: * 全栈生成: 你只需要用语言描述你想要的应用功能,比如“创建一个带有用户登录和任务列表的待办事项应用”,Lynx 会帮你生成前端、后端和数据库结构,并提供可访问的URL。 * 对话式开发: 整个开发过程就像在与一个资深技术合伙人对话,你可以随时提出修改需求、添加功能,它会实时响应并更新代码。 * 降低门槛: 对于初学者、产品经理或需要快速验证想法的开发者来说,Lynx 能极大地缩短从想法到产品原型的路径。 * 适用场景: 快速构建MVP(最小可行产品)、学习全栈开