Skip to content

fix(vscode): open plan files from review - #2329

Draft
zhuyuy wants to merge 1 commit into
MoonshotAI:mainfrom
zhuyuy:agent/fix-kimi-2317
Draft

fix(vscode): open plan files from review#2329
zhuyuy wants to merge 1 commit into
MoonshotAI:mainfrom
zhuyuy:agent/fix-kimi-2317

Conversation

@zhuyuy

@zhuyuy zhuyuy commented Jul 28, 2026

Copy link
Copy Markdown

Related Issue

Related to MoonshotAI/kimi-cli#2317, reported against the legacy repository.

Problem

The current VS Code extension receives the complete plan_review body, so the missing-text part of the legacy report is already addressed. The plan file path is still flattened away when the SDK display is adapted to the Webview, though, leaving no way to open the full plan from the review or the completed tool card.

The generic file-open RPC intentionally rejects absolute and workspace-external paths, so using it for session plans under the Kimi home directory would either fail or require weakening an unrelated security boundary.

What changed

  • Preserve plan review content and its path in a dedicated Webview display block.
  • Render the plan as Markdown and expose its saved path in both the approval surface and completed tool card.
  • Add a parameterless openPlanFile RPC. The extension host reads the path from the active SDK session with getPlan(), verifies that the file exists, and opens that trusted path in VS Code.
  • Keep the generic openFile RPC restricted to workspace-contained files.
  • Add regression coverage for display adaptation, RPC input validation, and opening a session plan outside the workspace.

Validation

  • apps/vscode extension and Webview TypeScript checks
  • Focused Vitest: 52/52 adapter and bridge tests passed
  • Focused plan handler Vitest: 1/1 passed
  • VS Code full suite: 292 passed, 1 skipped; 7 unrelated Windows/environment failures (symlink privilege, UNC stat, path separator assertion, and additional-directory resume)
  • Type-aware Oxlint on all changed TypeScript files: 0 errors
  • Webview production build: 8,177 modules transformed successfully
  • git diff --check

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; no changeset applies because apps/vscode is not a changeset-managed publishable package.
  • No documentation update is needed for this focused bug fix.

@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 729e69f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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