Skip to content

feat(vscode): migrate extension to Node SDK - #1769

Merged
wbxl2000 merged 10 commits into
mainfrom
qer/vscode-node-sdk
Jul 16, 2026
Merged

feat(vscode): migrate extension to Node SDK#1769
wbxl2000 merged 10 commits into
mainfrom
qer/vscode-node-sdk

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue. This implements the planned migration of the existing Kimi Code VS Code extension into this monorepo.

Problem

The released VS Code extension still runs a separately installed Python CLI over stdio. That duplicates runtime installation and session/config behavior, and prevents the editor integration from using the stable in-process TypeScript SDK and the same Kimi Code home as the terminal app.

What changed

  • add apps/vscode with the existing extension ID, commands, Webview, and target platform matrix
  • replace the Python/stdio host with an in-process @moonshot-ai/kimi-code-sdk v1 harness
  • add the minimal SDK/core APIs required for session replay, permanent delete, turn-based fork, MCP management, and provider-aware model selection
  • reuse migration-legacy for opt-in 0.5.x config/session migration, including already-migrated TUI homes and partial-failure reporting
  • preserve the VS Code file changes panel with extension-owned baselines, Keep/Undo, fork isolation, and workspace path checks
  • add model-aware thinking effort, six-target VSIX packaging, installed-extension smoke tests, and release compatibility notes

The extension keeps version 0.6.0. Legacy OAuth and MCP OAuth credentials are not copied and require reauthorization. Concurrent writes to the same session from multiple processes are not supported.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Validation

  • pnpm --filter kimi-code test — 263 passed
  • pnpm exec vitest run packages/node-sdk/test — 226 passed, 1 todo
  • pnpm --filter @moonshot-ai/migration-legacy test — 191 passed
  • pnpm --filter @moonshot-ai/agent-core test — 3853 passed, expected skips/failures unchanged
  • changed-package typechecks
  • pnpm --filter kimi-code build
  • six-target VSIX package/static audit
  • installed darwin-arm64 VSIX smoke on VS Code 1.100.0
  • pnpm sherif
  • pnpm exec changeset status
  • git diff --check origin/main...HEAD

The VS Code-specific README and changelog are included; no separate CLI docs update is required.

@github-actions

Copy link
Copy Markdown
Contributor

❌ Nix build failed

Hash mismatch in pnpmDeps:

Hash
specified sha256-dqniDBWjKjtTcr+zKhtilkKXdNMfiwnfrqH/7Cg4eZ0=
got sha256-/mJN7mNZgce57+dCQv0MBDESAxQpeBGQCky/2AR1qCk=

Please update flake.nix with the got hash.

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c6af35d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@moonshot-ai/migration-legacy Patch
@moonshot-ai/kimi-code Patch
@moonshot-ai/agent-core Patch
@moonshot-ai/kimi-code-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wbxl2000
wbxl2000 marked this pull request as ready for review July 16, 2026 08:26
@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@c6af35d
npx https://pkg.pr.new/@moonshot-ai/kimi-code@c6af35d

commit: c6af35d

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e3e73c8cb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

function serializeToolOutput(output: unknown): string {
if (typeof output === 'string') return output;
try {
return JSON.stringify(output, null, 2) ?? '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve content-part tool outputs for live events

When a tool returns ContentPart[] output (for example media or MCP image results), this helper stringifies the array before sending it to the webview. The webview protocol and replay path already accept content-part arrays, so live runs render raw JSON/data payloads and then look different after reload. Keep arrays as arrays and only stringify non-content objects.

Useful? React with 👍 / 👎.

@wbxl2000
wbxl2000 merged commit d1ca65e into main Jul 16, 2026
17 checks passed
@wbxl2000
wbxl2000 deleted the qer/vscode-node-sdk branch July 16, 2026 09:27
@github-actions github-actions Bot mentioned this pull request Jul 16, 2026
@wbxl2000
wbxl2000 restored the qer/vscode-node-sdk branch July 16, 2026 10:07
@github-actions github-actions Bot mentioned this pull request Jul 16, 2026
ywh114 pushed a commit to ywh114/kimi-code that referenced this pull request Jul 19, 2026
* feat(vscode): migrate extension to Node SDK

* fix(vscode): address CI failures

* fix(vis): handle token count records

* fix(vscode): keep chat toolbar and header readable at narrow widths

* fix(vscode): map yolo to core yolo permission and honor the global yolo setting

* docs(vscode): record Node SDK migration design

* docs(vscode): split breaking changes out of the 0.6.0 changelog

* fix(vscode): keep a resumed session's thinking effort instead of reapplying the default

* fix(vscode): announce session status when a view attaches so the display matches it

* fix(vscode): align webview thinking effort handling with the TUI
ywh114 pushed a commit to ywh114/kimi-code that referenced this pull request Jul 27, 2026
* feat(vscode): migrate extension to Node SDK

* fix(vscode): address CI failures

* fix(vis): handle token count records

* fix(vscode): keep chat toolbar and header readable at narrow widths

* fix(vscode): map yolo to core yolo permission and honor the global yolo setting

* docs(vscode): record Node SDK migration design

* docs(vscode): split breaking changes out of the 0.6.0 changelog

* fix(vscode): keep a resumed session's thinking effort instead of reapplying the default

* fix(vscode): announce session status when a view attaches so the display matches it

* fix(vscode): align webview thinking effort handling with the TUI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant