Skip to content

Feature/vscode extension#4

Open
KillerQueen-Z wants to merge 2 commits intoBlockRunAI:mainfrom
KillerQueen-Z:feature/vscode-extension
Open

Feature/vscode extension#4
KillerQueen-Z wants to merge 2 commits intoBlockRunAI:mainfrom
KillerQueen-Z:feature/vscode-extension

Conversation

@KillerQueen-Z
Copy link
Copy Markdown
Contributor

  • Add a VS Code sidebar extension (vscode-extension/) that provides the full RunCode agent experience
    inside VS Code — chat panel, tool execution, model switching, and all slash commands

    • Implement real-time balance tracking in the webview: balance updates synchronously on each usage
      event using local cost estimation (same approach as the Ink terminal UI), with RPC sync on turn
      completion
    • Add headless session API (src/api/vscode-session.ts) that decouples the agent loop from terminal
      I/O, enabling any host (VS Code, future web UI, etc.) to drive sessions via getUserInput + onEvent
    • Enhance /model command to render a full numbered model list via StreamEvent (previously only worked
      via console.error in TTY), allowing VS Code and other non-terminal hosts to display the picker
    • Add StreamStatusUpdate event type so model changes propagate to persistent UI elements without
      stderr
    • Two-tone banner rendering (gold "Run" + cyan "Code") in webview, matching CLI chalk output
    • Update README with VS Code extension install instructions and architecture diagram
    • Add dist/, .vscode/, vscode-extension/out/, *.vsix to .gitignore

    Test plan

    • npm run build in root — compiles cleanly
    • npm run compile in vscode-extension/ — compiles cleanly
    • F5 launch Extension Development Host — RunCode panel appears in sidebar
    • Send a message — agent responds, model and balance update in status strip
    • Balance decreases after each API call (no page reload needed)
    • /model displays numbered list in chat log
    • /model 3 or /model sonnet switches model, status strip updates
    • Stop button / Esc cancels in-flight requests
    • CLI runcode still works as before — no regressions

- Updated .gitignore to include VS Code and distribution files.
- Added exports for VS Code integration in package.json.
- Expanded README with installation instructions for the VS Code extension.
- Introduced new functions for plain-text banner lines and footer for non-terminal UIs.
- Enhanced model management commands to support listing models and switching via index or name.
- Updated StreamEvent types to include status updates for UI hosts.
Copy link
Copy Markdown
Member

@1bcMax 1bcMax left a comment

Choose a reason for hiding this comment

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

Thanks for the PR — good feature choices. /history, /delete, and the numbered model picker are all real user pain points. The headless session API is the right abstraction for multi-host support.

A few things before I can review further:

  1. Remove dist/ from the PR. Compiled output shouldn't be committed — it'll be generated by CI. Please also remove vscode-extension/package-lock.json and vscode-extension/out/ if present.

  2. Split extension.ts (782 lines) into smaller modules. Suggestion: webview-provider.ts, session-manager.ts, and ui-renderer.ts. One file doing webview setup + session management + HTML rendering + balance tracking is too much to review or maintain.

  3. Version bump should be a separate commit (2.5.28 → 2.5.29), not mixed into the feature.

  4. Can you explain the design decision behind the headless session API (vscode-session.ts) — why decouple via getUserInput + onEvent callbacks rather than importing the agent loop directly? Want to make sure we're aligned on the architecture before this ships.

Looking forward to the updated 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.

2 participants