Vscode Agent Sdk Update banner
zhaojiale2021 zhaojiale2021

Vscode Agent Sdk Update

Development community

Description

Pre-install VS Code/Insiders agent-host SDK cache (claude/codex) so you can use local agents without a Copilot subscription; fixes "[Claude] SDK not downloaded yet..." that never triggers. Local (%APPDATA%/~) + SSH push.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

更新 VS Code (stable / Insiders) agent-host 的 SDK 缓存 (claude / codex)

目的:**不用订阅 Copilot,也能使用本地的 claude / codex**。

没有 Copilot 订阅时,agent-host 无法自己触发 SDK 下载——日志里会出现

[Claude] SDK not downloaded yet; deferring chat metadata until a session triggers the download

但「session 触发下载」永远不会发生,于是 claude/codex 一直不可用。 本脚本提前把与 [microsoft/vscode](https://github.com/microsoft/vscode) 仓库 `package.json` 依赖一致的 SDK 包缓存预置到 agent-host 的 sdk-cache 目录,本地即可直接使用 claude / codex。

工作原理

  • 版本来源: vscode 仓库 package.json 的 `devDependencies`(默认 `main` 分支)

    • claude ← @anthropic-ai/claude-agent-sdk
    • codex ← @openai/codex
  • 下载地址: `https://main.vscode-cdn.net/agent-sdk///.tgz`

  • 支持的安装通道(默认 `both`):

    通道 本机缓存(Windows) 本机缓存(其他平台) 服务器缓存(SSH)
    Insiders ~/AppData/Roaming/Code - Insiders/agent-host/sdk-cache/ ~/.vscode-server-insiders/data/agent-host/sdk-cache/ ~/.vscode-server-insiders/data/agent-host/sdk-cache/
    Stable ~/AppData/Roaming/Code/agent-host/sdk-cache/ ~/.vscode-server/data/agent-host/sdk-cache/ ~/.vscode-server/data/agent-host/sdk-cache/

    实际目录: `<...>/sdk-cache////`,arch 如 `win32-x64` / `linux-x64`。

  • 完成标记: 解压校验完成后在 `/` 下新建空文件 `.complete`,与 agent-host 原生布局一致

前提

  • 本机: Python 3(纯标准库,零依赖);Windows 10 1803+(自带 System32\tar.exe);网络可达 vscode-cdn.net
  • 推送服务器: SSH 免密(密钥已配置在 ~/.ssh),服务器自带 tar

用法

python update_agent_sdk.py                       # 更新本机全部通道(claude + codex)
python update_agent_sdk.py --server      # 本机更新 + SSH 推送服务器(两个通道)
python update_agent_sdk.py --channel stable       # 只更新 Stable 通道
python update_agent_sdk.py --tool codex           # 只更新 codex
python update_agent_sdk.py --dry-run --server <别名>  # 只预览
python update_agent_sdk.py --server-only --server <别名>  # 只推送服务器
参数 说明
--server SSH 别名或 user@host,来自 ~/.ssh/config;给出后同时推送 linux-x64 到服务器
--channel insiders|stable|both 默认 both