Skip to content

feat: Windows compatibility, model selector, stop button & smart model tips#3

Open
nekdima wants to merge 8 commits intopatniko:mainfrom
nekdima:main
Open

feat: Windows compatibility, model selector, stop button & smart model tips#3
nekdima wants to merge 8 commits intopatniko:mainfrom
nekdima:main

Conversation

@nekdima
Copy link

@nekdima nekdima commented Mar 16, 2026

Summary

Adds full Windows support, model selector UI, stop button for cancelling responses, human-readable tool progress cards, and smart model recommendation tips. Supersedes #2.

Changes

Windows Compatibility

SDK dependency

  • Switched @github/copilot-sdk\ from local \ ile:\ path to published ^0.1.32\ on npm
  • Added \postinstall\ script that patches \�scode-jsonrpc\ exports map for ESM compatibility

Native messaging host (\src/host/host.mjs)

  • Cross-platform copilot CLI resolution: \where copilot.exe\ on Windows, well-known paths on macOS/Linux
  • Falls back to SDK-bundled CLI when system CLI is not found
  • Portable shebang (#!/usr/bin/env node) instead of hardcoded Homebrew path
  • Platform-aware PATH injection
  • Added \�pproveAll\ for permission requests

Windows launcher

  • New \src/host/host-wrapper.bat\ — Chrome/Edge on Windows requires a .bat/.exe\ as the native messaging host path
  • Updated \scripts/register-host.bat\ to register the wrapper instead of the .mjs\ file directly

Model Selector Feature

New component (\src/panel/components/ModelSelector.tsx)

  • Dropdown in the panel header to choose the AI model
  • Fetches available models from SDK via \client.listModels()\ on init
  • Model selection persisted in \localStorage\ across sessions

Message flow

  • New \AVAILABLE_MODELS\ message type from host → service worker → panel
  • Model passed with each \SEND_CHAT_MESSAGE\ for per-request selection
  • \setModel\ is best-effort: failure doesn't block the user's message
  • Model list cached in service worker so late-connecting panels receive it
  • Serialized message handling in host with promise queue to prevent races

Stop Button (NEW)

  • Red ■ stop button replaces send button during streaming/tool execution
  • Sends \CANCEL_REQUEST\ through Panel → service-worker → native host → session.cancel()
  • Persists throughout the entire multi-step workflow using deferred loading-off pattern (500ms timer)
  • \TOOL_CALL_START\ and \CHAT_RESPONSE_CHUNK\ cancel the off-timer, keeping stop visible

Smart Model Recommendation Tips (NEW)

  • New \ModelRecommendation.tsx\ component analyzes prompt text as user types (debounced 600ms)
  • Classifies prompts as code/complex/simple and recommends the optimal model
  • Tip banner appears above chat input with Switch/Dismiss buttons
  • Matches available models against a tier system (quality, speed, code categories)

Human-Readable Tool Progress Cards (NEW)

  • Tool call cards show friendly labels with icons (e.g. 📄 'Reading page content' instead of \get_page_html)
  • Animated progress bar on active tool calls instead of static emojis
  • All 20+ browser tools have descriptive labels and contextual icons

Version bump

  • Extension version bumped to 0.3.0

Files Changed (18 files)

  • \manifest.json\ — version bump
  • \package.json\ / \package-lock.json\ — SDK from npm, postinstall, version bump
  • \scripts/patch-vscode-jsonrpc.mjs\ — new ESM patch script
  • \scripts/register-host.bat\ — points to wrapper
  • \src/host/host-wrapper.bat\ — new Windows launcher
  • \src/host/host.mjs\ — platform-aware CLI, model listing, serialized messages, CANCEL_REQUEST handler
  • \src/background/service-worker.ts\ — model caching, forwarding, CANCEL_REQUEST forwarding
  • \src/panel/components/ModelSelector.tsx\ — model dropdown component
  • \src/panel/components/ModelRecommendation.tsx\ — NEW smart model tip component
  • \src/panel/components/HeaderBar.tsx\ — integrates model selector
  • \src/panel/components/ChatInput.tsx\ — stop button, onInputChange for recommendations
  • \src/panel/components/ToolCallCard.tsx\ — human-readable labels, progress bars
  • \src/panel/App.tsx\ — model state, stop handler, recommendation wiring, persistent loading state
  • \src/panel/lib/copilot-client.ts\ — model param, cancelRequest
  • \src/panel/styles/panel.css\ — progress pulse and slide-up animations
  • \src/shared/messages.ts\ — new message types (CANCEL_REQUEST)
  • \src/shared/types.ts\ — ModelInfo type

Testing

  • Verified on Windows 11 + Edge: native host connects, model selector populates, chat works with model switching
  • Stop button persists through multi-step tool call workflows
  • Model recommendation tip appears for code/complex/simple prompts
  • Extension builds cleanly (Vite, 306 modules, 1.2s)
  • macOS/Linux paths remain unchanged

Dmitriy Nekrasov and others added 8 commits March 13, 2026 19:19
- Replace hardcoded macOS copilot CLI path with cross-platform detection
- Add host-wrapper.bat for Windows native messaging (Chrome requires .bat/.exe, not .mjs)
- Fix register-host.bat to reference host-wrapper.bat instead of host.mjs directly
- Use published @github/copilot-sdk (^0.1.32) instead of local file: reference
- Add postinstall script to patch vscode-jsonrpc ESM exports map
- Add approveAll permission handler for tool execution

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change shebang to #!/usr/bin/env node for Linux/macOS portability
- Use 'where copilot.exe' instead of 'where copilot' to avoid
  picking up .bat wrappers on Windows

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a dropdown in the panel header that lets users choose which AI model
powers the Copilot browser assistant.

- Fetch available models from SDK via client.listModels() on init
- New ModelSelector component with dropdown UI
- Model selection persisted in localStorage across sessions
- SET_MODEL message type for mid-session model switching
- Model passed with each SEND_CHAT_MESSAGE for per-request selection
- Full message flow: Panel -> ServiceWorker -> NativeHost -> SDK

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Cache model list in service worker so late-connecting panels get it
- Send AVAILABLE_MODELS after session init (not before) to prevent race
- Serialize message handling in host with promise queue
- Make setModel best-effort: failure doesn't block the user's message
- Remove redundant SET_MODEL path; model sent per-message only

Reviewed by: Claude Opus 4.6, GPT-5.2, Gemini 3 Pro

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add stop button (red square) that replaces send button during streaming
- Stop finalizes streaming message and sends CANCEL_REQUEST through the stack
- CANCEL_REQUEST handled in service-worker → native host → session.cancel()
- New ModelRecommendation component analyzes prompt text (debounced)
- Classifies prompts as code/complex/simple and recommends optimal model
- Tip banner appears above chat input with Switch/Dismiss buttons
- Accepting switches model; dismissing hides for current input session
- Bump version to 0.3.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Tool call cards now show friendly labels (e.g. 'Reading page content'
  instead of 'get_page_html') with contextual icons
- Animated progress bar on active tool calls instead of static emojis
- Stop button now persists throughout the entire workflow:
  uses deferred loading-off (500ms) so tool call rounds keep it alive
  TOOL_CALL_START and CHAT_RESPONSE_CHUNK cancel the off-timer
- Added CSS keyframes for progress pulse and slide-up animations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nekdima nekdima changed the title feat: Windows compatibility + model selector for browser extension feat: Windows compatibility, model selector, stop button & smart model tips Mar 16, 2026
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