Repository navigation
[ERROR] litellm.BadRequestError: Github_copilotException - bad request: missing Editor-Version header for IDE auth #93
Description
Activity
@sandyrao could you help to execute
pip show litellm? I need to know the version if the litellm is root cause.Hello @KylinMountain,
$ pip show litellm
Name: litellm
Version: 1.83.7
Summary: Library to easily interface with LLM API providers
Home-page: https://litellm.ai
Author: BerriAI
Author-email:
License: MIT
Location: C:\Users<USER_NAME>\AppData\Roaming\Python\Python314\site-packages
Requires: aiohttp, click, fastuuid, httpx, importlib-metadata, jinja2, jsonschema, openai, pydantic, python-dotenv, tiktoken, tokenizers
Required-by: openkb, pageindexReacted by Kylin@sandyrao can you help verify this ticket with this version? you can try upgrade it by pip install openkb==0.4.0rc1. Thank you very much.
I am on Windows. fcntl doesnt seem to be getting resolved.
$ openkb
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\FabricDev_WS\openKB-adoption.venv\Scripts\openkb.exe_main.py", line 2, in
from openkb.cli import cli
File "C:\FabricDev_WS\openKB-adoption.venv\Lib\site-packages\openkb\cli.py", line 44, in
from openkb.config import (
...<2 lines>...
)
File "C:\FabricDev_WS\openKB-adoption.venv\Lib\site-packages\openkb\config.py", line 4, in
import fcntl
ModuleNotFoundError: No module named 'fcntl'The below did the trick for me. I can also see that once this is resolved I am able to use openkb with Github Copilot by adding extra_headers within config.yaml.
In openkb/locks.py
import sys # Platform-neutral flock fallback try: import fcntl except ImportError: fcntl = None def flock(fd: int, exclusive: bool) -> None: if fcntl is not None: mode = fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH fcntl.flock(fd, mode) elif sys.platform == "win32": import msvcrt curr = os.lseek(fd, 0, os.SEEK_CUR) os.lseek(fd, 0, os.SEEK_SET) try: msvcrt.locking(fd, msvcrt.LK_LOCK, 1) finally: os.lseek(fd, curr, os.SEEK_SET) def funlock(fd: int) -> None: if fcntl is not None: fcntl.flock(fd, fcntl.LOCK_UN) elif sys.platform == "win32": import msvcrt curr = os.lseek(fd, 0, os.SEEK_CUR) os.lseek(fd, 0, os.SEEK_SET) try: msvcrt.locking(fd, msvcrt.LK_UNLCK, 1) finally: os.lseek(fd, curr, os.SEEK_SET)At _fsync_directory() - line 160
def _fsync_directory(path: Path) -> None: if sys.platform == "win32": return fd = os.open(path, os.O_RDONLY) ....At atomic_write_bytes() - line 190
try: with os.fdopen(fd, "wb") as fh: if hasattr(os, "fchmod"): os.fchmod(fh.fileno(), _target_mode(path))In openkb/config.py - line 33
def _with_global_config_lock() -> Iterator[None]: GLOBAL_CONFIG_DIR.mkdir(parents=True, exist_ok=True) with GLOBAL_CONFIG_LOCK_PATH.open("a+", encoding="utf-8") as fh: flock(fh.fileno(), exclusive=True) try: yield finally: funlock(fh.fileno())Thank you so much for the great product and speedy fixes. 👍
Thanks @sandyrao — and thanks for the patch, that's exactly the right approach. 🙏
Recap for anyone following:
- The original GitHub Copilot
missing Editor-Version headerproblem is solved by theextra_headersforwarding in fix: support ChatGPT-subscription & GitHub Copilot providers (litellm 1.87.2 + extra_headers) #98 (now onmain) — as you confirmed. - The
ModuleNotFoundError: No module named 'fcntl'you then hit is a separate, Windows-only regression from the KB-locks feature (feat: add KB mutation locks and atomic state writes #86):fcntl/os.fchmod/ directoryfsyncare all Unix-only.
I've opened #99 to fix #2: a cross-platform
flock/funlock(fcntl on POSIX, msvcrt on Windows), guardedos.fchmod, and skipping the directory fsync on Windows. I can only simulate the Windows path on macOS/Linux, so once it lands it'd be great if you could confirm on your Windows setup. Thanks again for the detailed reports!- The original GitHub Copilot
- added 3 commits that reference this issue
on Jun 15, 2026 @sandyrao now you can try this version which should solve the issue about fcntl: you can upgrade it via
pip install openkb==0.4.0rc3, Thanks again.Confirmed by installing latest openkb to reproduce the issue and openkb==0.4.0rc3 . The fix is working in v0.4.0rc3.
Thanks.
Reacted by Kylinsince issue is fixed, I will close this ticket. Thanks
I am trying to configure OpenKB for my codebase using Github Colilot as a provider. I was able to do
openkb initandopenkb addwith the model provider github_copilot/gpt-5-miniBut when I try to do
openkb queryoropenkb chatand pass a query it fails with the below error:[ERROR] litellm.BadRequestError: Github_copilotException - bad request: missing Editor-Version header for IDE authThe below is my config.yaml:
language: en
model: github_copilot/gpt-5-mini
pageindex_threshold: 20
It tried to add this to the config.yaml but it did not help
extra_headers:
"Editor-Version": "vscode/1.90.0"
"Copilot-Integration-Id": "vscode-chat"
Please provide a provision to pass the extra headers so that Github Copilot provider too can be supported.