qwen-code/packages/vscode-ide-companion
易良 fb91acdf25
fix(vscode): force fresh ACP session on new-session action (#2874)
* fix(vscode-ide-companion/session): force fresh sessions for new chats

Ensure explicit new-session actions bypass active ACP session reuse so the VS Code sidebar clears context correctly.

Add regression coverage for the agent manager and webview new-session entry points.

* fix(vscode): remove core runtime imports from webview bundle

Replace the runtime import of `isSupportedImageMimeType` from
`@qwen-code/qwen-code-core` with a local `SUPPORTED_PASTED_IMAGE_MIME_TYPES`
set in the vscode-ide-companion package. The webview is bundled for a
browser environment where Node.js-only core modules are unavailable,
so keeping the MIME list local avoids esbuild failures during development.

Added tests to verify the local list stays aligned with core and that
the webview bundle does not contain core runtime imports.

* fix(vscode): reset context usage display on new session (#2847)

The webview context-usage bar did not clear when the user started a new
session because the old code always fell back to DEFAULT_TOKEN_LIMIT,
producing a stale percentage even after usageStats and modelInfo were
both cleared.

Key changes:
- Extract `knownTokenLimit()` in core/tokenLimits.ts that returns
  `undefined` for unrecognized models instead of a default, keeping
  `tokenLimit()` behavior unchanged.
- In acpModelInfo.ts, derive `_meta.contextLimit` from the known-model
  table when the ACP payload omits a numeric limit.
- Extract `computeContextUsage()` into its own module, which returns
  `null` when no trusted numeric limit is available — the UI then
  correctly hides the context bar.
- Remove the `@qwen-code/qwen-code-core` runtime import from App.tsx
  so the webview bundle stays free of Node-only dependencies.

Closes #2847

* fix(vscode-ide-companion/webview): reset state on new session

* test(vscode-ide-companion/webview): cover stale conversation reset

* fix(vscode): remove webview token limit runtime import

* fix(vscode): fully reset state for explicit new session

* fix(vscode-ide-companion/webview): clear residual state on new session

---------

Co-authored-by: tanzhenxin <tanzhenxing1987@gmail.com>
2026-04-11 10:16:16 +08:00
..
.vscode pre-release commit 2025-07-22 23:26:01 +08:00
assets feat(vscode-ide-companion/layout): add sidebar view and simplify chat positioning 2026-03-07 00:30:40 +08:00
schemas fix: improve /model --fast description clarity and prevent accidental activation (#3077) 2026-04-10 12:09:46 +08:00
scripts Merge branch 'main' of https://github.com/QwenLM/qwen-code into feat/unified-ui-for-vscode-extension 2026-01-28 18:52:37 +08:00
src fix(vscode): force fresh ACP session on new-session action (#2874) 2026-04-11 10:16:16 +08:00
.vscodeignore feat: add JSON Schema validation for VS Code settings 2026-02-13 17:32:18 +08:00
development.md Sync upstream Gemini-CLI v0.8.2 (#838) 2025-10-23 09:27:04 +08:00
esbuild.js feat: add wasm build config (#2985) 2026-04-09 14:21:00 +08:00
eslint.config.mjs fix(vscode-ide-companion): 修复 Tailwind 可重用组件类和 ESLint 配置, 调整 ChatHeader 按钮样式 2025-11-29 18:13:50 +08:00
LICENSE Upload VSIX of companion VS Code extension (#4241) 2025-07-15 18:44:03 +00:00
NOTICES.txt refactor(acp): migrate to @agentclientprotocol/sdk and clean up handlers 2026-03-06 21:57:41 +08:00
package.json chore: bump version to 0.14.3 (#3112) 2026-04-10 21:08:34 +08:00
postcss.config.js refactor(vscode): 重构消息排序和展示逻辑 2025-11-28 22:35:31 +08:00
README.md fix: update TOS link in VS Code extension README 2026-03-19 17:36:32 +08:00
tailwind.config.js feat(webui): add webview container and isolate styles for VSCode integration 2026-01-17 10:53:32 +08:00
tsconfig.json fix: upgrade @lydell/node-pty to 1.2.0-beta.10 to fix PTY FD leak 2026-04-01 07:55:56 +08:00
vitest.config.ts refactor(vscode-ide-companion): Refactoring the project structure and updating dependencies 2025-11-29 13:16:58 +08:00

Qwen Code Companion

Version VS Code Installs Open VSX Downloads Rating

Seamlessly integrate Qwen Code into Visual Studio Code with native IDE features and an intuitive chat interface. This extension bundles everything you need — no additional installation required.

Demo

Features

  • Native IDE experience: Dedicated Qwen Code Chat panel accessed via the Qwen icon in the editor title bar
  • Native diffing: Review, edit, and accept changes in VS Code's diff view
  • Auto-accept edits mode: Automatically apply Qwen's changes as they're made
  • File management: @-mention files or attach files and images using the system file picker
  • Conversation history & multiple sessions: Access past conversations and run multiple sessions simultaneously
  • Open file & selection context: Share active files, cursor position, and selections for more precise help

Requirements

  • Visual Studio Code 1.85.0 or newer (also works with Cursor, Windsurf, and other VS Code-based editors)

Quick Start

  1. Install from the VS Code Marketplace or Open VSX Registry

  2. Open the Chat panel using one of these methods:

    • Click the Qwen icon in the top-right corner of the editor
    • Run Qwen Code: Open from the Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  3. Start chatting — Ask Qwen to help with coding tasks, explain code, fix bugs, or write new features

Commands

Command Description
Qwen Code: Open Open the Qwen Code Chat panel
Qwen Code: Run Launch a classic terminal session with the bundled CLI
Qwen Code: Accept Current Diff Accept the currently displayed diff
Qwen Code: Close Diff Editor Close/reject the current diff

Feedback & Issues

Contributing

We welcome contributions! See our Contributing Guide for details on:

  • Setting up the development environment
  • Building and debugging the extension locally
  • Submitting pull requests

Terms of Service and Privacy Notice

By installing this extension, you agree to the Terms of Service.

License

Apache-2.0