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

从零开始:Xilinx FPGA实现RISC-V五级流水线CPU手把手教程

从一块FPGA开始,亲手造一颗CPU:RISC-V五级流水线实战全记录 你还记得第一次点亮LED时的兴奋吗?那种“我真正控制了硬件”的感觉,让人上瘾。但如果你能 自己设计一颗处理器 ,让它跑起第一条指令——那才是数字世界的终极浪漫。 今天,我们就来做这件“疯狂”的事:在一块Xilinx FPGA上,用Verilog从零实现一个 完整的RISC-V五级流水线CPU 。不是调用IP核,不是简化版demo,而是包含取指、译码、执行、访存、写回五大阶段,并解决真实数据冒险与控制冒险的可运行核心。 这不仅是一次教学实验,更是一场对计算机本质的深度探索。 为什么是 RISC-V + FPGA? 别误会,我们不是为了赶潮流才选RISC-V。恰恰相反,它是目前最适合学习CPU设计的指令集。 * 开放免费 :没有授权费,文档齐全,连寄存器编码都写得明明白白。 * 简洁清晰 :RV32I只有40多条指令,没有x86那样层层嵌套的历史包袱。 * 模块化扩展 :基础整数指令够用,后续想加浮点、压缩指令、向量扩展,都可以一步步来。

LoRA训练入门指南:5步掌握AI绘画模型定制

LoRA训练入门指南:5步掌握AI绘画模型定制 【免费下载链接】LoRA_Easy_Training_ScriptsA UI made in Pyside6 to make training LoRA/LoCon and other LoRA type models in sd-scripts easy 项目地址: https://gitcode.com/gh_mirrors/lo/LoRA_Easy_Training_Scripts 想要个性化定制AI绘画模型却担心技术门槛?LoRA训练正是为你量身打造的解决方案!这种低秩适应技术让普通用户也能轻松训练专属模型,无需高端设备,告别复杂参数调整。本指南将带你从零开始,5步掌握LoRA训练的核心技巧。✨ 🚀 快速上手:环境搭建只需3分钟 系统配置要求: * 操作系统:Windows 10/11或Linux系统 * 显卡:

B站直播神器:神奇弹幕机器人完整使用教程

B站直播神器:神奇弹幕机器人完整使用教程 【免费下载链接】Bilibili-MagicalDanmaku【神奇弹幕】哔哩哔哩直播万能场控机器人,弹幕姬+答谢姬+回复姬+点歌姬+各种小骚操作,目前唯一可编程机器人 项目地址: https://gitcode.com/gh_mirrors/bi/Bilibili-MagicalDanmaku 想要打造一个高互动、自动化的B站直播间吗?神奇弹幕作为目前唯一可编程的B站直播机器人,能够帮你实现弹幕互动、礼物答谢、智能点歌等多种功能,让你的直播变得更加高效和专业。无论你是新手主播还是经验丰富的UP主,这个工具都能为你节省大量时间精力。 🎯 核心功能深度解析 智能弹幕管理系统 神奇弹幕机器人提供了完整的弹幕管理解决方案。通过主控制台界面,你可以轻松管理直播间的各项设置,包括修改标题、封面、公告等基础信息。 在弹幕姬功能模块中,你可以配置显示时长、弹幕发送字数限制,开启自动重试功能,甚至设置弹幕翻译和新人提示等智能互动选项。 自动化答谢与互动系统 根据观众不同身份,机器人能够智能设置专属欢迎语: 观众类型欢迎语示例特色功

【论文阅读】世界模型发展脉络整理---Understanding World or Predicting Future? A Comprehensive Survey of World Models

论文来源: Understanding World or Predicting Future? A Comprehensive Survey of World Models arXiv编号: 2411.14499v2 作者: Jingtao Ding, Yunke Zhang, Yu Shang, Yuheng Zhang, et al. 发布时间: 2024年11月 目录 1. 概述 2. 世界模型的定义 3. 发展时间线 4. 关键技术演进 5. 主要研究方向 6. 应用领域 7. 未来趋势 8. 参考文献 1. 概述 1.1 什么是世界模型?