18 Commits
Author SHA1 Message Date
7fa0ab3432 agentHost: Fall back to GitHub token for utility calls (#329870)
* agentHost: fall back to GitHub token for utility calls

Use the existing Copilot token flow by default, but fall back to the authenticated GitHub OAuth token when token minting is forbidden. Restore commit operation coverage and remove the obsolete known issue. (Written by Copilot)

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

* agentHost: scope utility token fallback

Limit GitHub OAuth fallback to commit-message generation, cover both utility authentication invalidation paths, and strip account-specific headers from recorded model responses. (Written by Copilot)

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

* agentHost: use GitHub token for utility calls

Remove Copilot token minting from utility model requests and authenticate them directly with the accepted GitHub OAuth token. Keep provider fixtures stable with deterministic utility stubs. (Written by Copilot)

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

* agentHost: allow ancillary mock responses

Return deterministic content for ancillary requests when Agent Host tests intentionally register a multi-turn default scenario. This prevents direct utility calls from failing Codex provider integration teardown. (Written by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-10 20:01:33 +00:00
Christof MartiandGitHub 23e52847b7 Proxy test with isolated process on macOS (#325774) 2026-07-15 16:44:32 +02:00
PaulandGitHub ff3d330991 Bump baseline version for chat perf (#325706) 2026-07-13 22:23:44 +00:00
PaulandGitHub a6d303eb43 Remove loaf count from chat perf regression metrics (#325695) 2026-07-13 21:42:54 +00:00
1dc485dd0c Add chat terminal sandbox smoke tests (#324848)
* Add chat terminal sandbox smoke tests

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Expand chat terminal sandbox smoke coverage

* Test terminal sandbox temp directory isolation

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-09 01:05:43 +00:00
PaulandGitHub 90b81ef265 Fix issues with chat perf pipeline (#323917) 2026-07-01 22:10:25 +00:00
PaulandGitHub da4387232c Add smoke tests for model configs (#323205) 2026-06-27 17:51:29 +00:00
Christof Marti 6195d33f63 SDK sandbox and tests 2026-06-11 16:39:30 +02:00
Alex RossandGitHub 7c1dd895f5 Convert mock-llm-server.js to ts (#320567)
* Convert mock-llm-server.js to ts

* Ad eslint rule for no new js files

* Message
2026-06-09 15:08:47 +02:00
Alexandru DimaandGitHub ff61118bc0 fix: support token auth for CLI SDK mock server to enable auto-model in smoke tests (#320072)
* fix: support token auth for CLI SDK mock server to enable auto-model in smoke tests

- Add `advanced.debug.overrideAuthType` setting to control HMAC vs token
  auth when overrideProxyUrl is set (default: HMAC for dev, token for tests)
- Update mock server model definitions to match real CAPI response shape
  (family, vendor, version, supported_endpoints, billing, etc.)
- Add `selected_model` to mock `/models/session` response (required by SDK
  auto-mode resolution)
- Add Responses API SSE handler for gpt-5.3-codex which uses `/responses`
  instead of `/chat/completions`
- DRY up mock model definitions with shared `ALL_MODELS` array

* fix: add inspectConfig to test mock for copilotCliAuth and skip the other CLI smoke tests for now

* Don't run in PRs for now
2026-06-05 13:52:11 +02:00
Christof MartiandGitHub 837d9b877e Add Copilot CLI sandbox test (#317981) 2026-06-04 15:12:55 -07:00
Alex RossandGitHub 616eab07e3 Add "hello" tests to VS Code smoke tests (#319719)
* Add "hello" tests to VS Code smoke tests

* Address CCR feedback
2026-06-03 15:29:51 +02:00
PaulandGitHub 4810972048 Run chat performance pipeline on commit (#318868) 2026-05-28 20:35:17 -07:00
Anthony KimandGitHub 3827a8b38a Smoke test for Copilot CLI via chat extension in editor window (#317140)
* Copilot CLI sanity testing

* Make things better

* see if 1.0.48 correctly fails

* Try to be smarter with git auth

* Test  if copilot cli sanity test auth correctly.

* Test if copilot cli sanity test FAILS correctly

* Try to get sanity tests pass?

* Copilot CLI from chat extension sanity test

* Try more smoke test for copilot cli

* More smoke test related things?

* title is messing with chat disabled..?

* Why is there timeout for .editor-instance .interactive-session

* add copilot cli ui smoke auth diagnostics

* Be more descriptive when copilot cli smoke test fail

* remove integration test, upgrade smoke test

* Clean up Copilot CLI smoke test diagnostics

* Get even more inspiration from agent smoke test
2026-05-21 16:00:35 -07:00
3597bff21d fix and enable agents window smoke tests (#317764)
* add logs

* fix _currentNewSession race in async send flows

Async commit-wait flows (_sendFirstChat, _sendFirstChatViaController,
_sendSubsequentChat) unconditionally cleared _currentNewSession on
completion. When a newer session was created while the previous one was
still awaiting commit, the clear stomped the newer session's pointer —
causing 'Session not found' errors on the next send.

Extract _clearCurrentNewSessionIfMatch() that only clears when the
value still points at the session that initiated the async flow.

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

* enable claude test

* update logging

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-21 15:48:29 +02:00
2e8b995ab1 agents: add smoke test for Agents Window with mocked LLM server (#317545)
* agents: add smoke test for Agents Window with mocked LLM server

Adds a smoke test that opens the Agents Window, creates a new session
on a workspace folder, sends a 'hello world' prompt, and verifies the
request reaches a local mock LLM server that returns a canned response.

The test exercises two session types: Copilot CLI and Claude Code. A
third Local-session test is included but marked `it.skip` for now.

Key pieces:

* `test/smoke/src/areas/agents/agents.test.ts` — new smoke suite. Starts
  `scripts/chat-simulation/common/mock-llm-server.js` on a random port,
  registers a per-test scenario with a distinct reply, and injects
  `VSCODE_COPILOT_CHAT_TOKEN` / `GITHUB_PAT` / `IS_SCENARIO_AUTOMATION`
  env vars so the Copilot extension's token manager picks up a fake
  token whose endpoints.api/proxy point at the mock server.

* `test/automation/src/agents.ts` — new `Agents` workbench helper with
  `openCurrentFolderInAgentsWindow`, `switchToAgentsWindow`,
  `startNewSession`, `selectSessionType`, `submitNewSessionPrompt`,
  `waitForAssistantText`.

* `test/automation/src/code.ts` + `electron.ts` — `LaunchOptions` now
  accepts an `extraEnv` map that is merged on top of `process.env`
  when spawning the Electron child, so tests can inject env-based mocks
  without going through a custom launcher.

* `src/vs/sessions/browser/sessionsSetUpService.ts` —
  `shouldSkipSessionsWelcome` now returns `true` whenever
  `enableSmokeTestDriver` is set, so the welcome/auth dialog does not
  block smoke runs.

* `scripts/chat-simulation/common/mock-llm-server.js` — adds two
  models to `EXTRA_MODELS` (`gpt-5.3-codex` for Copilot CLI default,
  `claude-sonnet-4.5` for Claude Code), and routes `/v1/messages` to a
  new `handleMessagesApi` that streams Anthropic-format SSE
  (`message_start` / `content_block_delta` / `message_stop`) which the
  Claude Code session type's messages-API parser expects.

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

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix copilot cli test

* skip claude test

* sessions: fix new-session removal regression and rename smoke test

1. Revert the `_refreshSessionCache` filter change from d5747b31c4
   back to `adapter instanceof AgentSessionAdapter`. The broadened
   `adapter !== this._currentNewSession` check raced with the
   unconditional `this._currentNewSession = undefined` in the
   `_sendFirstChat*` paths: a late callback from a previous session's
   commit would wipe the pointer and the next refresh would evict the
   new session's temp adapter, navigating the Agents Window back to the
   homepage mid-request.

2. Rename the Agents Window smoke test infrastructure for clarity:
   - `test/automation/src/agents.ts` -> `agentsWindow.ts`
     (class `Agents` -> `AgentsWindow`,
     `workbench.agents` -> `workbench.agentsWindow`)
   - `test/smoke/src/areas/agents/agents.test.ts` ->
     `areas/agentsWindow/agentsWindow.test.ts`

Verified with 10 consecutive smoke-test loops: 8/10 fully green
(Copilot CLI + Claude + Local), 2 intermittent UI timing flakes
unrelated to the navigation regression.

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

* agents smoke: address PR #317545 review feedback

- switchToAgentsWindow: replace fixed 2s sleep with waitForElement on
  the Agents workbench DOM (`.agent-sessions-workbench`) so the helper
  returns as soon as the new window is interactable.
- resolveElectronConfiguration: apply `extraEnv` last, after the
  TESTRESOLVER_* assignments in the remote branch, so caller-provided
  env vars truly have final precedence.

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

* agents smoke: skip Agents Window tests for OSS quality

The Copilot extension is not built in OSS CI (it's in excludedExtensions
and its dist/extension.js is only produced by its own esbuild pipeline).
Without it all three session-type providers fail to activate, causing
every Agents Window test to time out.

Skip the suite when quality is OSS, matching the pattern used by
setupExtensionTests and setupLocalizationTests.

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

* copilotcli: add proxy endpoint to getAuthInfo for mock server routing

Without `endpoints.proxy`, the SDK's model-fetch calls
(`/models/session`, `/copilot_internal/v2/token`) fall back to
the real GitHub API which rejects the fake HMAC with a 401. This
caused intermittent smoke test failures (1 in 10) because the
Copilot CLI language models never registered, making the chat-setup
readiness gate depend on Claude's model registration timing.

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

* copilotcli: don't cache failed model fetches

When `getAvailableModels` throws (e.g. transient network failure or
HMAC validation error with a proxy), the empty result was permanently
cached in `_availableModels`. Subsequent calls to `getModels()` would
return the cached empty array without retrying, leaving the Copilot CLI
language model provider with zero models for the rest of the session.

Clear `_availableModels` on error so the next call retries the fetch.

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

* agents smoke: reset workspace before opening Agents Window

Earlier smoke test suites (e.g. Tasks) modify .vscode/tasks.json and
leave uncommitted changes. A dirty workspace prevents worktree creation
and triggers the uncommitted-changes confirmation flow which aborts the
Copilot CLI session on builds.

Reset via `git checkout . --quiet` in the before hook, matching the
pattern used by notebook and search smoke tests.

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

---------

Co-authored-by: Sandeep Somavarapu <sandy081@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-20 13:34:54 -07:00
PaulandGitHub cc33dc6e7c Fixes for the chat perf pipeline (#311605) 2026-04-21 19:11:30 -07:00
PaulandGitHub ec992baa49 Add performance tests (#309700) 2026-04-17 21:23:43 +00:00