* Show only cloud coding agent tasks in cloud sessions list (v2)
Two fixes to the Task API (v2) cloud sessions list, where local VS Code /
CLI / JetBrains sessions mirrored into Mission Control were leaking in and
settled tasks were stuck showing "In Progress".
- Filter the list to cloud coding agent tasks only. The owning surface is
identified by the agent integration slug on a task's `agent_collaborators`
(`copilot-developer` / `copilot-swe-agent` = cloud; `copilot-developer-cli`,
`vscode-chat`, `jetbrains-chat` = local clients). Adds the exported pure
helper `isCloudCodingAgentTask` and applies it in `fetchSessionList`.
`agent_collaborators` is returned to first-party CAPI tokens but not yet
modeled in `@vscode/copilot-api`, so a minimal local type is used.
- Carry the raw `AgentTaskState` across the backend seam and map it directly
to `ChatSessionStatus` in the provider, so `idle` renders as Completed and
`waiting_for_user` as NeedsInput instead of collapsing to InProgress.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: guard malformed slugs and add status fallback
- isCloudCodingAgentTask: use a `typeof c.slug === 'string'` guard so null /
non-string slugs in the untyped server payload can't reach `Set.has`.
- taskStateToChatSessionStatus: add a `default` branch returning InProgress so
an unknown/forward-compat task state can't yield an invalid `undefined`
status. Added tests for both.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: drop diagnostics with missing range at the language diagnostics boundary
Other extensions can publish vscode.Diagnostic entries whose `range` is
undefined (violating the non-nullable `range: Range` type via an `any` cast).
These reach copilot verbatim through `vscode.languages.getDiagnostics()` and
crash the many consumers that dereference `diagnostic.range` - notably the
`LintErrors.getData` telemetry path that scans every extension's diagnostics
via `getAllDiagnostics()`. Sanitize at the boundary service so every consumer
is protected once, and log dropped entries so the producer stays diagnosable.
Fixesmicrosoft/vscode#323148
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: Copilot - Test lint — use strict equality for range null/undefined check
The eqeqeq ESLint rule (configured as 'warn', enforced with --max-warnings=0)
flagged `range != null` in _dropMalformedDiagnostics. Replace the loose
equality with an explicit strict check that preserves the original semantics
of dropping diagnostics whose range is either null or undefined.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Agent Host changes for agents/adhoc-request-sender-mode-extension-55e2bb6f
* Remove unconfigured react-hooks/exhaustive-deps eslint directive
The eslint-disable directive referenced a rule that isn't registered in
this repo's ESLint config, which caused ESLint to error with
"Definition for rule 'react-hooks/exhaustive-deps' was not found" and
failed the Compile & Hygiene and Copilot - Test CI checks.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Coalesce adhoc tag-decoration rescans with requestAnimationFrame
Rescanning the whole editor text on every content change is wasteful for
bursty updates (e.g. a streamed response). Debounce the decoration update
to at most once per animation frame and cancel any pending frame during
cleanup so the callback can't run after the editor is disposed. The
initial scan stays synchronous so tags are highlighted immediately on mount.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR feedback: dispose token source; validate adhoc request JSON
- adhocRequestSender: always dispose the per-send CancellationTokenSource
in the finally block (separate from the current-send guard) so its
cancellation listeners don't leak across repeated Send/Stop cycles.
- simulationMain: validate and normalize the adhoc request JSON before use
so malformed input (missing/null/wrong-typed model/user/system) yields a
focused error message instead of a thrown stack trace.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump Copilot CLI packages to @github/copilot@1.0.64-1 and @github/copilot-sdk@1.0.3
* Resolve Agent Host Copilot CLI through @github/copilot/bin.copilot
* Materialize @github/copilot/sdk from @github/copilot-<platform> in extension postinstall
* Package @github/copilot-<platform>/copilot for Agent Host and linuxmusl
* Exclude Copilot optional native payloads from extension package
* Scan @github/copilot-*/copilot for Linux package dependencies
* Tighten Copilot SDK 1.0.64-1 attachment and RPC typings
* Increase Copilot SDK native binary scan test timeout
* Update amd64 deb deps for @github/copilot-linux-x64/copilot
* Update arm64 rpm deps for Copilot package layout
* Update x64 rpm deps for @github/copilot-linux-x64/copilot
* Try to fix windows smoke test
* Try to fix platform runtime files for agent host
* exclude copilot computer.node from agent host packaging
* Another attempt to try to get packaging right
* Should only try to load 1.0.64-1
* Try to fix packaing for windows, macos, deb deps
* Update armhf/arm64 deb and x64 rpm Copilot dependency baselines
* Copilot darwin ripgrep universal merge and arm64 rpm deps
* Restore target Copilot SDK prebuilds for built-in extension packaging
* see if changes to gulpfile.reh.ts would help
* dont mess with formatting
* Launch copilot cli from platform index.js and exclude SEA
Remote smoke tests intermittently fail with "Cannot reconnect. Please reload
the window." The root cause is the remote server process exiting unexpectedly
shortly after a client connects; because the server logs nothing on the way out,
the client reconnects against a freshly spawned server with a new connection
token and hits "Unknown reconnection token (never seen)".
Add best-effort process exit diagnostics in server-main.ts that distinguish a
self-exit (beforeExit), an external kill (signal) and a crash
(uncaughtExceptionMonitor), and log the test resolver child's exit/close signal.
Gated behind the VSCODE_SERVER_EXIT_DIAGNOSTICS env var, which the remote smoke
launcher sets, so it adds no product noise.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR #322438 allowed splitting one model-sent diff-patch into multiple
LineReplacements, breaking the invariant that the Nth shown edit
corresponded to the Nth model patch (progressive ghost-text reveal
already broke it too). As a result, telemetry could no longer attribute
a served edit back to the model patch it came from.
Stamp a 0-based `patchIndex` on each Patch in extractEdits, thread it
through the streamed-edit -> cache -> telemetry pipeline, and emit a new
`sourcePatchIndex` telemetry measurement. All fragments produced from the
same patch (diff splitting or ghost-text early + continuation) share the
index. The field is optional since the edit-window and INSERT response
formats have no patch structure.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removes the '[InlineEditRequestLogContext] outcome transition from ... to ...'
console.warn that polluted the extension host console on benign no-op outcome
self-transitions (e.g. 'skipped' -> 'skipped') during normal NES usage.
Fixes#322547
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* nes: update defaults for current file budgeting
to have budget of 1500 tokens and reuse leftover budget for code above
* nes: pin useLeftoverBudgetFromAbove=false in even-split test
The "context above and below get same # of tokens" test inherits its
options from DEFAULT_OPTIONS.currentFile. Flipping the default
useLeftoverBudgetFromAbove to true made it exercise the donation path,
breaking its premise and inline snapshot. Pin the option to false so the
test keeps validating the even-split behavior its name describes; the
donation behavior is already covered by the dedicated
expandRangeToPageRange tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* nes: file rename
* Add config to split xtab diff patches via per-patch diff
Add InlineEditsXtabSplitPatchOnDiff (boolean, experiment-based, default off).
When enabled, each patch in xtabPatchResponseHandler is line-diffed (removed vs
added lines) using the synchronous DefaultLinesDiffComputer and split into the
minimal set of LineReplacements, leaving re-emitted context lines untouched for
a nicer suggestion shape. Falls back to the single replacement on timeout or a
single-hunk diff.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Validate predicted line for cross-file cursor jumps
The cross-file cursor-jump path in `XtabProvider.handleCrossFilePrediction`
fed the model's predicted line number straight into a synthetic request
without checking it against the target document's line count. When the model
predicted an out-of-bounds line, `CurrentDocument.lineWithCursor()` threw a
`BugIndicatingError` ("cursor is out of bounds") that propagated up through
`getNextEdit` and surfaced as an unhandled error in telemetry.
The same-file path already guards against this (`exceedsDocumentLines`); this
mirrors that guard for the cross-file path, returning `NoSuggestions` and
recording `crossFile:exceedsDocumentLines` instead of throwing.
Fixes#318579
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Decouple metric assertions from call ordering via arrayContaining
- Use closeTo for duration assertion so timing-capture refactors don't break it
- Assert sendToolCallingTelemetry call count before indexing mock.calls
- Switch error-result assertion to toMatchObject for forward compatibility
- Fail loudly when the harness's createInstance receives an unknown ctor
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* External ingest: harden finalize against 412 phase mismatch
Fixes the "Build Codebase Semantic Index" failure for non-GitHub repos
where `/external/code/ingest/finalize` returns HTTP 412 ("request sent
for phase which was not the current phase"). The server only advances to
the finalize phase once it has received every expected document, so a
finalize can fail when the server is still missing documents.
- Retry finalize with backoff (bounded) after a 412, re-polling `/batch`
for documents the server still reports as missing and re-uploading them.
- Stop swallowing per-document upload failures: collect them and fail the
pass with a descriptive error (status + requestId) before finalize, so
the real cause is surfaced instead of a misleading finalize 412. Failed
uploads are no longer counted as uploaded.
- Make a `/document` 404 ("ingest is gone") abort the pass deterministically
rather than relying on a rejection an intermediate `Promise.all` can swallow.
- When finalize keeps returning 412 but the server reports no missing
documents, surface a distinct "likely server-side" error after retries.
Adds an ExternalIngestClient test suite driving the real client through the
ingest HTTP protocol (retry-then-success, re-upload still-missing, exhaustion,
server-side-no-missing-docs, persistent upload failure, and 404 abort).
Refs microsoft/vscode#320915
* Use fake timers for finalize-retry tests; count unique uploaded docShas
- Test suite uses fake timers so finalize-retry backoff doesn't add real wall-clock time
- Record unmapped docSha as a deterministic upload failure instead of throwing (rejection was swallowed by Promise.all)
- updatedFileCount counts unique uploaded docShas across passes instead of summing per-pass attempts
- Add test for the unmapped-docSha failure path
* Fix externalIngest tests failing in CI without a GitHub token
createPlatformServices() wires a static auth service backed by createStaticGitHubTokenProvider(), which throws when no GITHUB_PAT/GITHUB_OAUTH_TOKEN is set (CI). Override IAuthenticationService with a static token so getAuthToken() resolves deterministically. Verified by running the suite with the token env vars unset.
These errors existed on the branch before the OTel work but block the
Copilot - Test (Linux/Windows) CI checks from passing:
- inlineChatIntent.ts: re-narrow request.location2 inside the private
loop method (the assertType in run() does not survive across the
async boundary into _runInlineToolLoop).
- inlineChatIntent.spec.ts: cast mock fields to vitest's Mock type so
.mock and mockImplementation are accessible; annotate callback
parameters that were implicit any; fix PromptRenderer generic arity
(it takes one type parameter, not two).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* nes: update defaults for current file budgeting
to have budget of 1500 tokens and reuse leftover budget for code above
* nes: pin useLeftoverBudgetFromAbove=false in even-split test
The "context above and below get same # of tokens" test inherits its
options from DEFAULT_OPTIONS.currentFile. Flipping the default
useLeftoverBudgetFromAbove to true made it exercise the donation path,
breaking its premise and inline snapshot. Pin the option to false so the
test keeps validating the even-split behavior its name describes; the
donation behavior is already covered by the dedicated
expandRangeToPageRange tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Wrap the bail-out exit-tool invocation inside the invoke_agent
span so its execute_tool span is parented under the root span
(was previously a sibling).
- Add github.copilot.agent.type='builtin' to the root span to
match the standard invoke_agent attribute set.
- Remove now-unused IToolsService dependency from InlineChatIntent.
- Add regression test asserting the exit tool is invoked while
the invoke_agent span is still active.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add in-editor PMF survey pane (POC)
Moves in-product surveys from notification-based flows into an editor
pane, following the same pattern as the issue reporter editor.
- EditorInput + EditorPane architecture (singleton, readonly)
- Segmented control (Q1) styled with --vscode-radio-* tokens
- List-row selection (Q2/Q3) with native radios visually hidden inside
full-width label elements, styled via :has(:checked)
- Responsive container query (collapses 2-col to 1-col at 600px)
- HC/focus-visible support for both segment and list-row patterns
- Success animation with auto-close after 3s
- Telemetry event for survey submission (survey/submit)
- Works in both workbench and sessions/agent window
- Testable via Developer: Open Survey command
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR feedback: accessibility, localization, design tokens
- Gate 'Open Survey' command behind IsDevelopmentContext (dev builds only)
- Localize all user-facing strings (title, description, questions, options)
- Use stable option IDs for telemetry instead of locale-dependent labels
- Replace custom submit button CSS with shared Button widget
- Add aria-hidden on decorative icons (sparkle, checkAll)
- Add role=status + aria-live=polite on success container
- Announce 'Response sent' via status() for screen readers
- Move focus to success container after submit
- Use --vscode-strokeThickness token for border widths
- Snap padding to spacing ramp (7px → 8px)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix responsive layout and accessibility
Responsive:
- Remove broken flex-wrap on segment control (caused 2x2+1 orphan grid)
- At narrow widths, segment stacks vertically (flex-direction: column)
with full-width items and proper border-radius per edge
- Segment labels get min-width: 0 + text-overflow: ellipsis so they
shrink gracefully in horizontal mode without wrapping
- Remove overflow: hidden from segment group (was clipping focus rings)
Accessibility:
- Add role=form + aria-label on the editor pane container
- Increase auto-close timeout to 5s (gives screen readers time to read)
- Add position: relative on focus-visible segments for z-index stacking
- Segment labels get explicit border-radius on first/last (no overflow
hidden needed)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix review findings: focus, URI, error handling, a11y
Engineering:
- Override focus() to move focus to first radio when survey opens
- Make resource URI dynamic (vscode-survey:/{surveyId}) to prevent
collisions across multiple survey definitions
- Guard closeEditor in auto-close timeout with .catch(onUnexpectedError)
Accessibility:
- Add aria-required=true on all radio groups
- Fix HC focus-visible vs checked outline conflict: checked uses 1px
solid contrastActiveBorder, focus-visible uses 2px dashed focusBorder
- Add completion hint ('Answer all questions to submit') with
aria-describedby on the submit button; hides once all answered
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: prevent segment control wrapping with explicit flex-wrap: nowrap
Add position: relative to contain absolutely-positioned radio inputs,
and flex-wrap: nowrap to ensure 5 segment items always stay in a single
row at widths above the 600px container-query breakpoint.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: list selection style, compact spacing, scroll visibility
- Remove one-sided border-radius + left-accent on selected list rows;
use full rectangular border matching VS Code's native list selection
- Reduce row padding (8px→6px), gap (4px→2px), question margin (24→20px)
and submit margin (28→20px) for a more compact layout
- Add 60px bottom padding to ensure the Submit button is always reachable
when scrolling
- Split container queries: segment stacks at 560px, list grid collapses
to single-column at 480px (was 600px for both — too aggressive)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: accessibility help, design tokens, compact styling
- Add SurveyAccessibilityHelp with AccessibleViewProviderId.Survey and
AccessibilityVerbositySettingId.Survey for screen reader discovery
- Use var(--vscode-strokeThickness) for list-option border
- Use var(--vscode-codiconFontSize) + transform: scale(2) for success icon
- Reduce list-option padding to 6px 10px (on spacing ramp)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: track source signal, programmatic command, structured telemetry
- Add 'source' field to SurveyEditorInput so the triggering feature
(completions, panel.agent, agent.codeEdit) is captured with the response
- Register '_workbench.action.openCopilotSurvey' command for the Copilot
extension to open the in-editor survey instead of external URL
- Restructure telemetry: extract pmfScore, primaryBenefit, primaryFriction
as top-level fields for direct Kusto querying (keep JSON blob for
forward-compat)
- Rename question IDs: main-benefit→primary-benefit, blockers→primary-friction
- Add pmfQuestionId to ISurveyDefinition schema
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: pmfScore as numeric 0-4, update extension to open in-editor survey
- pmfScore is now a number (0=not at all, 4=extremely) with
isMeasurement:true for direct Kusto aggregation - no JSON blob
- Update Copilot SurveyService.promptSurvey() to call
'_workbench.action.openCopilotSurvey' command instead of opening
external URL - works in both main workbench and agent window
- Remove unused IAuthenticationService, IEnvService, SURVEY_URI from
SurveyService (no longer needed without external URL)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: sanitize source arg, restore focus, handle singleton re-open
- Validate command source against allowlist (telemetry safety)
- Add runtime guard for dev command in stable builds
- Make SurveyEditorInput.source mutable via updateSource()
- Update existing input's source when singleton is re-opened
- Restore focus to survey pane when closing a11y help
- Await command execution in extension with error handling
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* generalize survey telemetry with telemetryKey mappings
Questions now declare their own telemetry field via telemetryKey and
asMeasurement properties. The pane iterates these at submit time
instead of hardcoding field names.
Telemetry fields:
- score (number): primary measure, option index
- primaryBenefit (string): value driver option ID
- primaryFriction (string): friction point option ID
- programmingExperience (number): experience bracket index
Added Q4: programming experience (5 brackets, 0-4 numeric measure).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The model can stream malformed JSON for tool-call arguments. The language model wrapper threw a bare Error from a fire-and-forget finished callback, producing an unhandled rejection in error telemetry without cleanly aborting the response. Align with the other tool-call consumers (langModelServer, messagesApi) by logging the diagnostic and falling back to empty parameters so the tool call is still surfaced to the consuming extension.
Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com>
Render the memory instructions and context blocks only when the memory
tool is in availableTools, so the prompt and available tools stay in sync.
Fixes#321833
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The off-flag conversation summarization path forced `stream: false` on the
chat request. The response processor is selected by the endpoint's static
`supportsStreaming` capability, not by this flag, so for a streaming Chat
Completions model (e.g. gemini-3-flash) the single non-streamed JSON blob is
still routed through the SSE processor, which fails to parse it and reports a
spurious RESPONSE_CONTAINED_NO_CHOICES failure. Both Full and Simple modes hit
this, so /compact reported failure even though the model returned valid
summaries.
Removing `stream: false` lets the request stream (the safe default for every
endpoint type); `interceptBody` still forces `stream: false` for models that
genuinely don't support streaming.
Fixes#321085
getAvailableTools(): skip virtual-tool grouping for any tool-search-capable endpoint (not just Anthropic). Previously GPT-5.4/5.5 ran virtual-tool grouping AND responses-API client tool search simultaneously, so real MCP tools were hidden behind activate_* groups (or trimmed) and never appeared in the request's tools map - making them searchable via tool_search but not callable.
toolSearchTool: exclude always-available (non-deferred) tools from the tool_search candidate set so the limited result slots only go to tools that actually need loading.
Fixes#317998Fixes#317992
Disable process.report in copilot extension
Override process.report.getReport to return undefined, loaded as the first import in the copilot extension entrypoint. Cherry-picked from #321998 and #322036.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>