mcp: fix default model selection to exclude CLI models
- Changes _findMatchingModel to use a new _getDefaultModels helper instead
of filtering for models with ChatAgentLocation.Chat default location
- The new _getDefaultModels method filters for free models (no multiplier
numeric or target chat session type), preventing CLI-only models from
being selected as defaults by default
- Also removes unused ChatAgentLocation import
Fixes#299336
(Commit message generated by Copilot)
The agent will interpret 'Verify a change count appears in the
session list' by finding +N/-N text in the snapshot during generate.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix terminal autopilot + some description language
* fix ci
* use last focused widget:
* autoreply in autopilot
* better wording around task complete tool + auto reply for ask questions
Instead of just counts, provide IChatSessionFileChange objects with
actual file URIs so the Changes view can display individual files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Conversations are stored per session URI in a Map. When a session
is re-opened, provideChatSessionContent returns the stored history
so previous messages are visible. Not persisted across reloads.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The requestHandler wasn't being called (agent invoke takes precedence).
Move session tracking to the agent's invoke callback so the session
list updates after each chat response.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After each chat response, the session is added to an in-memory list
and the item controller fires onDidChangeChatSessionItems so the
sidebar session list updates. Sessions are not persisted across reloads.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The spinner kept spinning because the response was never marked
complete. The mock session now sets isCompleteObs to true after
streaming the response, which triggers response.complete().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 'Can not find provider' error was because no extension registered
a content provider for the copilotcli:// URI scheme. Now the
MockChatAgentContribution registers providers for both 'copilotcli'
and 'copilot-cloud-agent' schemes with a requestHandler that returns
canned responses.
Also removes chat participant from mock extension to avoid conflict
with the workbench contribution's agent registration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MockChatAgentContribution registers dynamic agents for 'copilotcli',
'copilot', and 'copilot-cloud-agent' IDs with canned responses.
Also pre-seeds agentSessions.lastPickedFolder storage key.
Uses registerWorkbenchContribution2 pattern so the mock agent is
registered by the DI system with proper service injection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The test/e2e/ directory was too deep for TypeScript to resolve imports
back to src/vs/. Move to test/ (one level up) where imports work.
E2E runner scripts (.cjs) and scenarios stay in test/e2e/.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keeps all E2E test code (mocks, runners, scenarios, extensions) in one
place, separate from production Sessions code. Updates import paths,
server path, and ESLint config.
Note: ESLint import-patterns warnings remain because the relative
imports from test/e2e/ depth don't match the restriction glob syntax.
This is cosmetic — the imports are valid TypeScript.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Sign In button in the sidebar uses IDefaultAccountService, not
IChatEntitlementService. Mock it to return a fake signed-in account.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New files:
- web.test.ts: TestSessionsBrowserMain with MockChatEntitlementService
- web.test.factory.ts: Factory using TestSessionsBrowserMain
- sessions.web.test.internal.ts: Test entry point
Server uses test entry point when --mock, which injects a mock
IChatEntitlementService returning ChatEntitlement.Free with
installed=true, so Sessions thinks the user is signed in.
Also adds ESLint import patterns for sessions web entry points.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pre-sets the workspace to github-remote-file://mock-repo/ so the
Sessions UI starts with a folder already open, backed by the mock
file system provider from the E2E extension.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New extension at extensions/sessions-e2e-mock/ provides:
- Mock GitHub auth provider (fake token, skips sign-in)
- Mock chat participant (canned responses based on input keywords)
- Mock file system for github-remote-file:// (in-memory files)
Server loads the extension when --mock flag is passed. The generate
and test runners both use --mock automatically.
New npm scripts:
- serve:mock — opens Sessions in browser with mocks loaded
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The serve script now opens with ?skip-sessions-welcome to bypass
the sign-in overlay during manual testing.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass command strings directly to runPlaywrightCli() which already
handles quote-aware splitting, instead of naive whitespace split
that breaks 'type "build the project"' into 4 args.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New approach:
- generate.cjs: Uses Copilot CLI to compile .scenario.md files into
.commands.json by feeding each step + accessibility snapshot to the LLM.
The agent returns exact playwright-cli commands (e.g. 'click e143').
- test.cjs: Replays .commands.json deterministically. No LLM calls, no
regex matching, no icon stripping. Just sequential playwright-cli commands.
- common.cjs: Shared helpers (server, playwright-cli wrapper, parser).
Workflow: npm run generate (slow, LLM) → npm test (fast, deterministic).
The .commands.json files are committed to git so tests are reproducible.
Removes all old infrastructure: run.cjs, actionMap.ts, scenarioParser.ts,
sessionApp.ts, scenarios.spec.ts, mock extension, tsconfig, old scenarios.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>