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

AI写作大师-Qwen3-4B-Instruct多行业落地:教育出题、法律文书、电商文案

AI写作大师-Qwen3-4B-Instruct多行业落地:教育出题、法律文书、电商文案 1. 这不是普通AI,是能“想清楚再动笔”的写作伙伴 你有没有遇到过这样的情况: * 教师要出一套覆盖知识点、难度梯度合理、题干严谨的月考卷,手动编题花掉整个周末; * 律师助理需要在30分钟内整理一份格式规范、条款无歧义、引用准确的合同初稿; * 电商运营盯着100款新品发愁——每款都要写5条不同风格的详情页文案,还要兼顾转化率和平台规则。 过去,这些任务要么靠经验堆时间,要么靠模板硬套,结果不是千篇一律,就是漏洞百出。而今天,Qwen3-4B-Instruct 不是“快速生成”,而是“理解之后再表达”——它不急着输出,先拆解逻辑、对齐标准、预判风险,再落笔成文。 这不是参数堆出来的“大”,而是推理链拉得够长、知识面铺得够宽、语言组织够严密的“实”。40亿参数不是数字游戏,它意味着模型能记住更复杂的上下文关系,能在2000字的法律条款里保持主谓一致、术语统一、逻辑闭环;能在一道物理题的解析中,自动补全隐含条件、标注易错点、

2026年Midjourney AI 图像生成器使用教程详解

2026年Midjourney AI 图像生成器使用教程详解

Midjourney 是一款领先的 AI 图像生成工具,用户只需输入简单的文本描述(提示词),即可快速生成高质量、富有艺术感的图像。它主要通过 Discord 平台操作,无需本地安装,但需要订阅付费计划。本文将系统介绍 Midjourney 的核心功能、详细使用教程、价格方案以及提升出图效果的实用技巧,适合设计师、内容创作者和 AI 绘画新手阅读。 一、什么是 Midjourney? Midjourney 是一个由独立研究实验室开发的人工智能图像生成程序,能够根据用户输入的文字描述生成数字图像。它通过深度学习模型理解自然语言,并将其转化为细节丰富、风格多样的视觉作品。 由于其出色的艺术表现力和视觉冲击力,Midjourney 已成为设计师、插画师、品牌创意人员以及 AI 爱好者广泛使用的工具之一。 Midjourney 核心特点 * 文本生成图像:将抽象想法直接转化为可视画面 * 高艺术质量:在光影、构图、风格化方面尤为出色 * 云端运行:通过 Discord 操作,

AIGC 与艺术创作:机遇

AIGC 与艺术创作:机遇

目录 一.AIGC 的崛起与艺术领域的变革 二.AIGC 在不同艺术形式中的应用 1.绘画与视觉艺术 2.音乐创作 三.AIGC 为艺术创作带来的机遇 1.激发创意灵感 2.提高创作效率 总结 在当今数字化时代,人工智能生成内容(AIGC)正以惊人的速度重塑着艺术创作的格局,为艺术家们带来了令人振奋的新机遇。 一.AIGC 的崛起与艺术领域的变革 随着人工智能技术的不断进步,AIGC 逐渐在艺术领域崭露头角。它依托强大的机器学习算法和深度学习模型,能够分析大量的艺术作品数据,并从中学习各种风格、技巧和表现形式。 例如,OpenAI 的 DALL・E 2 是一款强大的图像生成模型。艺术家可以输入描述 “一只穿着太空服的猫在月球上漫步”,DALL・E 2 就能生成一幅非常逼真且富有创意的图像。这一技术突破使得艺术创作不再局限于传统的手工绘制,而是可以通过算法来实现。艺术家们可以利用这些工具来快速探索不同的创意方向,

Nanbeige 4.1-3B Streamlit WebUI实战案例:适配Qwen/Llama的通用改造方法

Nanbeige 4.1-3B Streamlit WebUI实战案例:适配Qwen/Llama的通用改造方法 你是不是也厌倦了那些千篇一律、界面呆板的AI对话界面?侧边栏挤满了按钮,头像方方正正,聊天记录像代码一样堆叠在一起,毫无美感可言。 今天,我要分享一个完全不同的方案——一个专为Nanbeige 4.1-3B模型打造的极简WebUI。它看起来就像你手机里的短信应用,或者二次元游戏里的聊天界面,干净、清爽、充满现代感。 更重要的是,这个方案的核心思路是通用的。无论你是用Nanbeige、Qwen还是Llama模型,只要稍作调整,就能拥有同样惊艳的交互体验。接下来,我就带你一步步了解这个项目的核心亮点,并分享如何将它适配到其他主流模型上。 1. 项目核心亮点:为什么这个WebUI与众不同 在开始技术细节之前,我们先看看这个WebUI到底有什么特别之处。传统的Streamlit应用往往受限于原生组件的样式,很难做出精致的界面。但这个项目通过一些巧妙的技术手段,完全打破了这些限制。 1.1 极简现代的视觉设计 第一眼看到这个界面,你可能会怀疑这真的是用Streamlit