Skip to content

feat: Copilot SDK migration + E2E test consolidation#25

Merged
sbroenne merged 11 commits intomainfrom
feat/copilot-sdk
Feb 20, 2026
Merged

feat: Copilot SDK migration + E2E test consolidation#25
sbroenne merged 11 commits intomainfrom
feat/copilot-sdk

Conversation

@sbroenne
Copy link
Owner

All tests passing: 265 unit/integration, 15 UI, 230/234 E2E (4 pending need live Copilot). Tool consolidation 134->10 configs. LEGACY_TOOL_MAP for E2E compat.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Stefan Broenner and others added 11 commits February 19, 2026 21:01
- Replace Vercel AI SDK + Azure AI Foundry with GitHub Copilot SDK
- Add Node.js proxy server (src/server.js + src/copilotProxy.js) that
  spawns @github/copilot CLI and bridges it via WebSocket to the task pane
- Add browser WebSocket client (src/lib/websocket-client.ts + websocket-transport.ts)
  implementing Copilot LSP over JSON-RPC
- Rewrite useOfficeChat.ts: WebSocket session lifecycle + useExternalStoreRuntime
- Convert tool factory from Zod ToolConfig to Copilot SDK Tool[] (JSON Schema)
- Remove SetupWizard, SettingsDialog, aiClientFactory, chatService,
  modelDiscoveryService, providerConfig -- auth is now GitHub account-based
- Simplify settingsStore: remove endpoint/model CRUD, add activeModel
  with COPILOT_MODELS list; bump persist version to 2 (clean break)
- Delete all live-API integration tests; keep jsdom unit + component tests
- All 259 tests pass, tsc and webpack build clean
- Update README and CONTRIBUTING to reflect new architecture

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Three tests covering the full WebSocket → proxy → Copilot API path:
1. Connect to proxy server
2. Create a session and get a real LLM response (checks assistant.message_delta)
3. Execute a tool call and verify the handler fires

Tests skip automatically when npm run server is not running.
Uses SystemMessageConfig typed correctly (mode: 'append').

Also updated vitest.integration.config.ts:
- Switch to jsdom environment (WebSocket global available)
- Include .test.tsx files
- Drop stale Foundry dotenv load

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…al server

- Switch to node environment (// @vitest-environment node) so real TCP
  connections work (jsdom's WebSocket is a stub)
- Patch global WebSocket with ws package (rejectUnauthorized: false) so
  Node trusts the office-addin-dev-certs localhost cert
- Handle both assistant.message and assistant.message_delta event types
  (Copilot emits complete message, not streaming deltas, in this flow)
- Fix SERVER_URL to wss:// (server is HTTPS/WSS)

All 3 tests now pass against live GitHub Copilot:
  ✓ connects to the proxy server
  ✓ creates a session and gets a response to a simple prompt
  ✓ executes a tool call and returns the result to the model

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- useOfficeChat: use type guard predicate instead of non-null assertion
- websocket-client: use undefined-check instead of non-null assertion
- server.js: add eslint-disable comments for intentional console logs
- ci.yml: remove Azure/Foundry secrets, integration tests always run
  (Copilot WebSocket tests skip gracefully when no server available)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Integration tests were missing two critical settings vs the unit config:
- setupFiles: ['tests/setup.ts'] — needed for OfficeRuntime mock and
  jsdom polyfills (ResizeObserver, matchMedia, IntersectionObserver)
- globals: true — needed for @testing-library/react auto-cleanup;
  without it, afterEach is not global and cleanup never runs, causing
  stale Radix UI portal elements to accumulate across tests

Result: 47/47 integration tests passing (up from 12/47)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- .github/copilot-instructions.md: full rewrite for Copilot SDK
  architecture (WebSocket proxy diagram, updated unit/integration test
  tables with 18/12 files, new key files list, OfficeRuntime test guidance)
- README.md: replace Chat Architecture, Key Hooks, Authentication,
  Tech Stack sections to reflect Copilot SDK + proxy server
- docs/TESTING_STRATEGY.md: full rewrite with current test file tables,
  correct counts, removed Azure/Foundry references

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- tests-e2e/src/test-taskpane.ts: replace Azure/Foundry AI round-trip
  with GitHub Copilot WebSocket client (createWebSocketClient +
  tool.execution_start events); skips gracefully when proxy unavailable
- tests-e2e/webpack.config.js: replace FOUNDRY_* DefinePlugin vars with
  COPILOT_SERVER_URL; remove Entra ID token acquisition
- tests-ui/fixtures.ts: update makeSettingsJSON to match current
  UserSettings shape (activeModel, no endpoints); fix stale comments
- tests-ui/chat/chat-ui.spec.ts: update model name gpt-4.1 → Claude Sonnet 4.5
- tests-ui/chat/chat-copilot.spec.ts: new Playwright E2E test that sends
  a message and verifies AI response; auto-skips when server unavailable

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 11 alternate tool name aliases (find_values, insert_range, delete_range,
  merge_cells, unmerge_cells, group_rows_columns, ungroup_rows_columns,
  auto_fill_range, get_range_precedents, get_range_dependents, get_tables_for_range)
- Fix copy_range: rename sourceAddress->address, add copiedTo result field
- Fix filter_table: rename values->filterValues arg
- Fix resize_table: rename newAddress->address arg
- Add set_table_style, set_table_header_totals_visibility mappings
- Fix set_chart_title: include title in result transform
- Add set_chart_data_source mapping
- Fix edit_comment: rename newText->text arg
- Fix CF add_* operations: add applied result transform for all
- Fix add_data_bar: rename barColor->fillColor
- Fix add_cell_value_format: rename fillColor->backgroundColor
- Fix add_top_bottom_format: rename rank->topBottomRank, topOrBottom->topBottomType,
  fillColor->backgroundColor; add defaults for rank/type
- Fix add_color_scale:defaults: provide default min/max colors
- Fix add_text_contains_format/add_contains_text_format: rename text->containsText,
  fillColor->backgroundColor
- Fix add_custom_format: rename formula->formula1, fillColor->backgroundColor
- Fix sort_pivot_field_values: include valuesHierarchyName in result
- Fix get_pivot_table_location: use rangeAddress field name
- Fix refresh_all_pivot_tables: return refreshed:true field
- Fix set_number_validation: support decimal type (maps to Excel decimal rule)
- Add decimal type support to dataValidation.config.ts

All 230 E2E tests now passing (4 pending AI round-trip tests)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update Playwright fixtures and UI test specs to match current app state
- Simplify wizard-flow.spec.ts (remove SetupWizard/SettingsDialog tests no longer applicable)
- Add useCustomSortLists param to pivotTable.config.ts configure action
- All 15 UI tests pass, 230 E2E tests pass, 265 unit/integration tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	src/tools/configs/dataValidation.config.ts
#	src/tools/configs/pivotTable.config.ts
#	src/tools/index.ts
#	tests/unit/toolSchemas.test.ts
@sbroenne sbroenne merged commit 5596abe into main Feb 20, 2026
@sbroenne sbroenne deleted the feat/copilot-sdk branch February 20, 2026 06:17
sbroenne pushed a commit that referenced this pull request Feb 20, 2026
sbroenne pushed a commit that referenced this pull request Feb 20, 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