Commit Graph

4400 Commits

Author SHA1 Message Date
Zhichao Li b16421d711 Merge branch 'main' into zhichli/otelmonitor 2026-06-21 23:44:59 -07:00
Harald Kirschner 918dfc4372 Add in-editor PMF survey pane (POC) (#322192)
* 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>
2026-06-21 18:12:40 -07:00
vs-code-engineering[bot] cb128cbeff fix: tolerate invalid tool-call JSON in language model wrapper (fixes #322123) (#322127)
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>
2026-06-21 08:52:11 +00:00
Bhavya U db0cabd800 Gate memoryInstructions on the memory tool being enabled (#322250)
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>
2026-06-20 20:53:25 -07:00
Bhavya U bcf17876c3 Fix /compact failing on streaming models (Gemini): don't force stream:false (#322255)
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
2026-06-20 20:53:22 -07:00
Bhavya U 2e52a6b834 Update model capabilities (#322237)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-21 00:21:22 +00:00
Bhavya U d778afd715 Fix tool_search for GPT models; scope tool_search to deferred tools (#322235)
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 #317998
Fixes #317992
2026-06-20 22:44:38 +02:00
Alexandru Dima 4a6e32fc1f copilot: disable process.report in copilot extension (#322178)
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>
2026-06-19 17:08:10 -07:00
Vijay Upadya 4e116aaf70 Gemini: Fix tool-call validation for Gemini flattened argument keys (#322165)
* Gemini: Fix tool-call validation for Gemini flattened argument keys

* Feedback updates
2026-06-20 01:47:03 +02:00
Julia Kasper 89b8d6d16a Enable persistent CoT for GPT-5.4 and GPT-5.5 (#322161)
Add GPT-5.4 and GPT-5.5 to the Responses API persistent chain-of-thought model-family gate while preserving the existing supported-family condition.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-19 22:17:44 +00:00
Paul c8940a8eb5 Propagate quota snapshots from copilot SDK (#322162) 2026-06-19 15:14:17 -07:00
vs-code-engineering[bot] 3d575eec6f fix: re-check cancellation after postToolUse hook to avoid closed-stream write (fixes #321951) (#321959)
fix: re-check cancellation after postToolUse hook to avoid closed stream write (fixes #321951)

The postToolUse hook can run for a long time because it spawns external,
user-configured commands. If the chat request is cancelled while the hook
runs, the response stream is closed by the time the hook resolves, and
writing hook progress to it throws an unhandled "Response stream has been
closed" error.

The prior fix (cdf17eb2, #319011) only checked cancellation before invoking
the hook, leaving the cancellation-during-hook window open. Re-check the
cancellation token in executePostToolUseHook after the await and skip result
processing when cancelled, since a cancelled turn never consumes the result.

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>
2026-06-19 21:32:24 +00:00
Christof Marti 446f2ce00a Use prod endpoints for testing telemetry (#322065) 2026-06-19 07:17:25 -07:00
Martin Aeschlimann b955ea3bd5 fix Custom Instructions agent log title (#321739) 2026-06-19 11:36:43 +00:00
Paul e3badb65a8 Model hover redesign based on feedback (#322003) 2026-06-19 06:00:52 +00:00
Benjamin Christopher Simmonds 8abc0d6b02 chat: remove the chat.editMode.hidden setting (#321993)
Edit mode is now hidden for everyone, so the chat.editMode.hidden
setting and its DeprecatedEditModeHidden policy are no longer needed.
This removes the setting registration, policy, exported policy data
entry, and the settings layout reference. The custom Edit mode file in
the built-in Copilot extension (and its provider registration) is
removed as well. The mode picker no longer special-cases a custom
`edit` mode by name for its icon or built-in grouping; the legacy
built-in Edit mode (shown when agent mode is disabled by policy) keeps
its own icon.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-18 14:10:45 -07:00
Zhichao Li 1b90a114aa Merge remote-tracking branch 'origin/main' into zhichli/otelmonitor 2026-06-18 14:00:51 -07:00
Logan Ramos bb215ba65e Fix cost calc + context size compaction (#321980)
* Fix cost calc + context size compaction

* Address comments
2026-06-18 13:05:55 -07:00
Zhichao Li eab37bae1e OTel: align agents status hover 2026-06-18 11:05:45 -07:00
Zhichao Li 334c30150b OTel: refine monitoring status copy 2026-06-18 10:25:06 -07:00
Dirk Bäumer 19afd815d6 Fix long line rendering for grep style output (#321938)
* Fix long line problem

* WIP

* Revert tag style to original code.
2026-06-18 08:28:58 -07:00
Ulugbek Abdullaev effc60ba22 Allow chat-lib embedders to supply the tokenizer implementation (#321920)
* Allow chat-lib embedders to supply the tokenizer implementation

Embedders of @vscode/chat-lib that already have the cl100k/o200k BPE
dictionaries in memory currently load up to three copies per process
(~100 MB per encoder per copy). Open both tokenizer code paths to a
host-supplied implementation:

- INESProviderOptions gains tokenizerProvider, following the existing
  optional service override pattern (languageDiagnosticsService etc.).
- The completions-core tokenizer module gains
  setExternalTokenizerProvider(), checked by getTokenizer(), and
  initializeTokenizers becomes a lazy thenable so the dictionary load
  starts on first await (ghostText already awaits it per request)
  rather than at module evaluation - giving hosts a chance to register
  a provider before any load happens. Without a provider the only
  change is load timing.

Fixes #321098

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

* Address review: harden the external tokenizer provider hook

- setExternalTokenizerProvider throws on re-registration or after the
  built-in load has started, freezing the load strategy.
- The initializeTokenizers gate never rejects (matching the built-in
  best-effort contract); external loads are single-flight and a failed
  attempt clears the memo so a later await can retry.
- getTokenizer keeps its never-throws contract: a throwing provider
  falls back to the module's existing fallback chain.
- Use ?? instead of || for the tokenizerProvider option fallback.

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

* Fix tokenizer tests racing the now-lazy dictionary load

The cl100k/o200k mocha suites captured getTokenizer() at suite
definition time, which only worked because the eager IIFE had loaded
the dictionaries by then; with lazy init they captured the approximate
fallback (24 failures on the Copilot test job). Fetch the tokenizer in
suiteSetup after awaiting initializeTokenizers instead. getTokenizer()
also kicks the lazy load on a miss now, so production callers that
never await still converge on exact tokenization.

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

* Make the completions tokenizer override a factory option

Replace the process-global registration race with a factory option.
`setExternalTokenizerProvider` no longer throws (first-wins, never crashes
host init), and `createInlineCompletionsProvider` installs the provider
synchronously before any tokenization, so there is no ordering contract for
embedders to get right.

Add `IInlineCompletionsProviderOptions.tokenizerProvider` and export
`ExternalTokenizerProvider` / `Tokenizer` / `TokenizerName` from the chat-lib
public surface so embedders can actually implement and pass the option.

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

* Replace lazy-thenable initializeTokenizers with ensureTokenizersLoaded()

The exported `initializeTokenizers` was a hand-rolled fake Promise (an object
with then/catch/finally + a `Symbol.toStringTag` spoof, cast `as Promise<void>`)
that re-invoked `loadTokenizers()` on every settle and lied to `instanceof
Promise`. Replace it with a plain `ensureTokenizersLoaded()` function that
returns the real promise from `loadTokenizers()`.

Behavior is unchanged: the load still starts lazily on first call (so an
embedding host can install an external provider first), is single-flighted, and
never rejects. Update the one prod awaiter (ghostText) and the test call sites.

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

* Reword getTokenizer fire-and-forget comment

The comment claimed callers that never call ensureTokenizersLoaded() "still
converge on exact tokenization", which overstates the guarantee: when the
dictionary load fails, the approximate tokenizer fallback persists. Clarify
that exact tokenization is reached on a later call only once the load succeeds.

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

* Add unit tests for the external tokenizer provider

The host-overridable tokenizer path (setExternalTokenizerProvider, the
ensureTokenizersLoaded single-flight gate, and the never-throws getTokenizer
fallback) had no coverage. Add a "Tokenizer Test Suite - external provider"
suite with a fake provider covering delegation, concurrent single-flight,
fallback-on-throw, resolve-and-retry on load failure, and first-wins
registration.

Because the completions tokenizer is process-global, add a test-only
resetTokenizersForTest() that restores the module's initial state, called in
the suite's setup and teardown so it does not leak into the other suites that
share the mocha process.

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

* Fix chat-lib extraction by re-exporting tokenizer symbols locally

The chat-lib extractor (extractChatLib.ts) rewrites `import ... from` module
specifiers to point at the bundled `_internal/` tree, but it does not rewrite
`export ... from` re-export specifiers. The tokenizer re-exports in
chatLibMain.ts used `export { TokenizerName } from '...tokenization'`, whose
deep relative path was left untouched in the extracted main.ts and no longer
resolved — breaking `npm run extract-chat-lib` with TS2307 and failing the
chat-lib tests job on all three platforms.

Follow the convention already used everywhere else in this entry point (e.g.
the service re-exports just above): import the symbols at the top, where the
extractor does rewrite the path, and re-export the local bindings without a
`from` clause.

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

---------

Co-authored-by: Mason Chen <jiec@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-18 15:28:15 +00:00
Christof Marti 16eed499d6 Include telemetry level in diagnostics (#321931) 2026-06-18 15:23:25 +00:00
Christof Marti 447b53ad32 Remove unused telemetry URLs, add note when proxySupport is not set to default (#321904) 2026-06-18 10:37:28 +00:00
Alex Ross 193b1196d8 Add a second turn to the chat smoke tests (#319942)
* Reduce duplicate code

* Add a second turn to the chat smoke tests

* Fix tests

* "fix" sandbox test

* Make things work

* Get tests passing

* CCR feedback

* Simplify diff

* Undo chatView.ts changes

* Missing Claude warm up
2026-06-18 12:22:13 +02:00
Zhichao Li 25d12d1117 OTel: compact dashboard capture copy 2026-06-17 17:17:04 -07:00
Carl Brochu 46c7255039 Add SKU to enhance GH telemetry events (#321046)
* Add SKU to enhanced/restricted GH telemetry events

The sendEnhancedGHTelemetryEvent and sendEnhancedGHTelemetryErrorEvent
methods were not enriching events with the SKU field from the copilot
token, unlike sendGHTelemetryEvent which already did this.

This caused ~90% of copilot-chat telemetry events (engine.messages,
engine.messages.length, provideInlineEdit, etc.) to have null SKU in
the restricted telemetry pipeline.

Fixes microsoft/vscode-internalbacklog#7962

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

* Refactor: extract _addSku helper, only set sku when defined

Address PR feedback:
- Extract duplicated SKU logic into private _addSku method
- Only add sku property when token SKU is present (omit when undefined)

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

---------

Co-authored-by: Carl Brochu <carlbrochu@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-17 17:10:13 -07:00
Zhichao Li 0e40a7d7fd OTel: clarify dashboard capture status 2026-06-17 17:09:22 -07:00
Osvaldo Ortega d8716e0178 Instrument Cloud Agent backend v1/v2 rollout behind an experiment (#321818)
* Instrument Cloud Agent backend v1/v2 rollout

Put the `chat.cloudAgentBackend.version` toggle (v1 = Jobs API, v2 = Task
API) behind an experiment so the rollout can be ramped and rolled back
remotely via ExP, and add an arm-tagged telemetry surface so the two
backends emit identical funnel and guardrail signals for apples-to-apples
monitoring.

Previously v1 was partly instrumented and v2 emitted nothing, making any
A/B comparison impossible. A shared `ICloudBackendInstrumentation` is now
injected into both backends and stamps every event with `backendVersion`,
covering session creation, activation, follow-up, and per-operation
errors, plus matching OTel metrics. v2's silent catch sites now report
through it, and `TaskApiError` carries the HTTP status for error
classification. Legacy v1 backend events are consolidated into the shared
surface and kept for dashboard continuity.

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

* Rename "arm" to "backend version" in cloud telemetry comments

"arm" is A/B-experiment jargon not used elsewhere in the codebase. Swap it
for "backend version" in comments, docstrings, and GDPR comment text to
match the existing `backendVersion` / v1 / v2 vocabulary. Comment-only
change; no identifiers or behavior affected.

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

* Address cloud backend rollout PR review comments

- Move backend_version attribute to the canonical github.copilot.* namespace
- Derive numeric HTTP status inside operationFailed so the status measurement is populated
- Carry HTTP status on v1 (Jobs API) invalid-job errors via JobsApiError so v1 create failures classify by status
- Only emit cloud pr_ready.count for v1 (Task API activation is a first turn, not a PR)
- Add unit tests for the new cloud metrics
- Document the new cloud operation/error metrics and backend_version attribute

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

* Fix TaskApiBackend construction in fetchSessionList specs

Three fetchSessionList test cases constructed TaskApiBackend without the
required instrumentation argument, failing the CI typecheck (TS2554).

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-17 16:41:16 -07:00
Zhichao Li e9d51371d7 OTel: address monitoring UI review feedback 2026-06-17 16:17:12 -07:00
Logan Ramos b4605859a5 Display session cost + persist context widget (#321803)
* Display session cost + persist context widget

* fix tests + comments
2026-06-17 23:03:22 +00:00
Zhichao Li 86f34172fd OTel: keep status pill in Agents Window 2026-06-17 15:26:37 -07:00
Megan Rogge f1339a4faf Revert "Add stream-stall telemetry to Anthropic Messages streaming (#321432)" (#321842)
Revert "Add idle watchdog + telemetry to Anthropic Messages streaming (#32143…"

This reverts commit f8574878be.
2026-06-17 22:02:28 +00:00
Ulugbek Abdullaev 5bcc8d9c64 nes: patch: implement fast yield line with cursor (#321841)
* nes: refactor: simplify patch repsonse handler

* nes: refactor: simpler name for response handler

* nes: remove unused Log kind for duplicate additions mode

* refactor(xtab): simplify XtabPatchResponseHandler

- Convert static class to namespace for better autocomplete ergonomics
- Extract duplicate-additions policy into applyDuplicatePolicy() returning
  an EditDecision discriminated union, flattening the main loop
- Remove DuplicateAdditionsMode.Log (already absent from enum)
- Remove onDuplicateRemoved callback (never used in production) along with
  OnDuplicateRemovedCallback and DuplicateAdditionRemovalSummary types
- Minor cleanups: explicit boolean return on Patch.addLine, remove
  redundant else/if branches in extractEdits

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

* nes: patch: implement fast yield line with cursor

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-17 23:55:02 +02:00
Zhichao Li 9c43c5ad35 OTel: remove broadcast pill from chat UI and agents window; keep only dashboard row
Per dogfood feedback, the always-on broadcast pill in the chat input toolbar caused accidental clicks and added UI noise for a setting that is neither time-sensitive nor frequently toggled. OTel status remains discoverable via the Copilot icon chat status dashboard.
2026-06-17 14:42:41 -07:00
Zhichao Li 9e06afd3a3 OTel: drop modal/banner, restrict to user scope, surface in chat status dashboard
- Remove workspace+folder configurability of OTel settings (scope: application)
  for both the Copilot extension settings and the agent-host OTel settings.
  Settings are now user-only and policy-deliverable.
- Drop the workspace-trust capability gate, the captureContent disclosure
  modal, and the yellow chat-input banner.
- Collapse the chat-input pill to a single broadcast indicator ($(broadcast))
  shown whenever OTel is on; remove the statusCapturing command.
- Surface OTel state in the Copilot chat status dashboard as a single row
  with the endpoint and an inline [Manage] command link.
2026-06-17 14:42:39 -07:00
Megan Rogge f8574878be Add idle watchdog + telemetry to Anthropic Messages streaming (#321432) (#321671)
The Anthropic Messages streaming body can return 200 with headers and then
hang mid-stream with no further chunk and no error, leaving the for-await
loop pending indefinitely. Add a 120s idle watchdog that resets on each
chunk, emits a messagesApi.streamIdleTimeout telemetry event when it trips
(so the stall is observable in the wild), rejects the iterator, and cancels
the underlying reader so the stream settles instead of hanging.
2026-06-17 16:16:08 +00:00
Logan Ramos ed2883930a Fix rendering of cache write pricing (#321756)
* Fix rendering of cache write pricing

* Fix hover

* Address comments
2026-06-17 16:00:23 +00:00
Ulugbek Abdullaev 68ea2959a6 nes: feat: migrate allowImportChanges into model configuration (#321755)
* nes: feat: migrate allowImportChanges into model configuration

Move the team-internal, experiment-based `chat.advanced.inlineEdits.allowImportChanges`
setting onto `ModelConfiguration` as an optional `allowImportChanges` field so the value
travels with the selected model config (fetched / exp-config / local / hard-coded).

XtabProvider.filterEdit now takes the value from `modelServiceConfig.allowImportChanges`
(undefined treated as None, preserving prior default) instead of reading the standalone
setting, which is removed.

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

* nes: patchBased02WithRecentLineNumbers and patchBased02WithoutRecentLineNumbers should hardcode allowImportChanges

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-17 15:44:38 +00:00
Christof Marti 0dde08b004 Fix Linux sandboxing (#317981) 2026-06-17 15:20:56 +02:00
dependabot[bot] bf2b215f3b Bump esbuild, @vitest/coverage-v8, tsx, vite, vite-plugin-wasm and vitest in /extensions/copilot (#321235)
* Bump esbuild, @vitest/coverage-v8, tsx, vite, vite-plugin-wasm and vitest
2026-06-16 21:20:21 -07:00
Osvaldo Ortega 7dd4002e0f chatSessions: scope cloud agent (v2) repo task list to the current user (#321706)
* chatSessions: scope cloud agent (v2) repo task list to the current user

The Task API (v2) repo-scoped endpoint (agents/repos/{owner}/{repo}/tasks)
returns every collaborator's tasks by default, so the cloud sessions view in a
repo workspace showed sessions not created by the current user. This mirrors how
github.com/copilot/agents only narrows to your own tasks when an author filter
is applied.

Pass the authenticated user's id as the creator_id query param on the
repo-scoped list, matching the web behavior. The scalar form is honored by the
server. The global agents/tasks path is already user-scoped, so it is left
untouched. If the current user id can't be resolved, listing falls back to
unfiltered.

- Add creator_id to ListTasksOptions
- Resolve the current user id via IOctoKitService.getCurrentAuthedUser() in
  TaskApiBackend.fetchSessionList
- Add id to IOctoKitUser (already returned by GET /user)

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

* comment

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-17 03:07:55 +00:00
Paul cb3e67df04 Unify reasoning effort strings for agent host (#321674) 2026-06-16 23:41:29 +00:00
Martin Aeschlimann 83535b58f9 Move ComputeAutomaticInstructions to extension (#314402)
* Move ComputeAutomaticInstructions to extension

* Potential fix for pull request finding

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

* update missing fullReferenceName

* update

* update

* update

* update

* update

* Remove ComputeAutomaticInstructions migration plan document

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+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>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+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>

* Potential fix for pull request finding

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

* update

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-16 19:51:49 +00:00
Vijay Upadya 28709d2a30 Detect telemetry exp setting change and switch dynamically (#321652)
* Detect telemetry exp setting change and switch dynamically

* comment update
2026-06-16 12:40:50 -07:00
Benjamin Christopher Simmonds 4eec9fd9ee telemetry: send X-VSCode-WindowKind exp filter from Copilot Chat (#321630)
Add X-VSCode-WindowKind exp filter to Copilot Chat

Mirrors the core X-VSCode-WindowKind assignment filter (added in #321572) in the Copilot Chat experimentation setup so experiments can target the editor vs. agents window. Uses the scode.workspace.isAgentSessionsWorkspace proposed API to determine the window kind.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-16 11:40:32 -07:00
Dirk Bäumer 1e1a9a7af1 Optimize grep output and enhance configuration (#321601)
* Optimize grep output

* WIP

* Fix algorithm to honor maxResults

* Add output format to telemetry

* Improve boolean check
2026-06-16 23:35:07 +10:00
Ulugbek Abdullaev 878724842f nes: add fetchResult to enhanced telemetry to disambiguate empty model response vs missing model response (#321433)
* nes: add fetchResult to enhanced telemetry to disambiguate empty model responses

The restricted/enhanced 'copilot-nes/provideInlineEdit' event already carries 'modelResponse', but 'eventPropertiesToSimpleObject' drops falsy property values (including the empty string) before the event reaches the wire. That makes a successful but empty model response (e.g. the diff-patch model emitting "" to mean "no edit") indistinguishable from cancellations, fetch failures, and no-fetch paths in the copilot_v0_next_edit_suggestion_restricted_code_snippet table.

Add 'fetchResult' (the underlying ChatFetchResponseType, e.g. 'success' / 'canceled' / 'failed' / ...). Decode:

  fetchResult = 'success' AND modelResponse IS NULL  -> model responded with the empty string
  fetchResult = 'canceled' / 'failed' / ...          -> specific failure kind
  fetchResult IS NULL                                -> no fetch (e.g. cache hit; check isFromCache measurement)

The field reuses the existing 'fetchResult' vocabulary already documented in the standard event's GDPR catalog, so no new naming is introduced.

Refs https://github.com/microsoft/vscode-copilot-issues/issues/443

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

* nes: address Copilot review feedback for fetchResult telemetry

Use the strongly-typed FetchResultWithStats.fetchResult value in enhanced telemetry and update tests to assert the on-wire payload via eventPropertiesToSimpleObject.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com>
2026-06-16 16:33:19 +05:00
Paul 906e926db0 Add support for unified model customization picker (#321026) 2026-06-16 00:31:25 +00:00
Osvaldo Ortega 7f0b0dea6c Cloud agent: Create/Open pull request toolbar actions for settled tasks (#321520)
* Cloud agent: Create/Open pull request toolbar actions for settled tasks

Adds chat-input toolbar actions for v2 (Task API) cloud agent sessions:
- "Create pull request" for a settled, PR-less task; the backend resolves the
  repo from the task (html_url, falling back to a GitHub repo-by-id lookup) and
  creates the PR, then re-applies the toolbar gates in place.
- "Open pull request" (icon-only) once the task has a PR, opening it in the
  browser; resolves both task- and PR-keyed session resources.

Also: compare-based changed files for settled PR-less tasks, reactive gate
re-evaluation on task settle / PR creation, and resolver-path telemetry.
Core: icon-only rendering for the open-PR action in the session changes toolbar.

* Address review: fix create-PR response test shape, stale wording, telemetry name

- Test FakeTaskApiClient now returns the real AgentTaskCreatePullRequestResponse
  shape ({ id, number, repository_id }) instead of the stale { pull_request }.
- Reword the no-reflect warning and create-handler doc that wrongly implied a
  refresh (the handler updates the toolbar gates in place).
- Rename the resolver telemetry event back to copilotcloud.pullArtifactResolve.
- Drop the 'browser-open glyph' wording now that the open-PR icon is git-pull-request.
2026-06-16 00:17:12 +00:00