Commit Graph

22676 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
João Moreno 8efe757281 cleanup collaborators list (#321369) 2026-06-21 18:33:46 +00: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
Lee Murray aa5ab3bb13 Merge pull request #322108 from microsoft/revert-320953-mrleemurray/update-2026-theme-syntax
Revert "Update 2026 theme colors"
2026-06-19 19:02:24 +01:00
Alexandru Dima 37e7e85b10 Optimize node_modules caching for CI & PR checks (#322074)
* CI: speed up node_modules cache with zstd + shared scripts

Switch the Linux/macOS node_modules cache from single-threaded gzip
(tar -czf) to multi-threaded zstd. The "Create node_modules archive"
step was spending ~5min of single-core gzip on a multi-GB tree on every
cache miss; zstd -T0 uses all cores and decompresses much faster, so
cache-hit jobs benefit too. Windows stays on 7-Zip (already threaded).

Extract the archive/extract commands into shared per-platform scripts
under .github/workflows/node_modules_cache/ (cache.sh / cache.ps1, each
dispatching on an archive|extract argument) so the format and flags live
in one place instead of being duplicated across ~8 workflows. Bump
build/.cachesalt to invalidate existing gzip caches.

Also remove the obsolete extensions/copilot CI workflows
(copilot-setup-steps.yml, ensure-node-modules-cache.yml, pr.yml) and the
unused build/listBuildCacheFiles.js, and drop their now-stale entries
(plus lit-html and signals-core) from .eslint-allowed-javascript-files.

* ci: seed copilot node_modules cache on main and rename cache keys

Add copilot-linux and copilot-windows jobs to pr-node-modules.yml so the
copilot node_modules cache is populated on main. Rename the copilot cache
keys to copilot-node_modules-linux / copilot-node_modules-windows in pr.yml.

* ci: extract node_modules cache into composite actions

Factor the repeated node_modules cache plumbing into two local composite
actions, restore-node-modules and save-node-modules, and migrate all
workflows that used the cache.sh/cache.ps1 archive flow (pr, pr-node-modules,
pr-{linux,darwin,win32}-test, copilot-setup-steps, component-fixtures,
css-order-scan).

- restore-node-modules computes the key, restores the cache, optionally
  extracts on a hit, and exports the resolved key via $GITHUB_ENV.
- save-node-modules archives node_modules and saves it to the cache, reusing
  the key exported by restore so callers don't repeat the prefix.
- Bespoke install steps stay in the workflows, so per-job env/secrets never
  cross the action boundary.
- Only seed the cache on branch pushes (component-fixtures skips PRs, whose
  caches aren't shared).

* save the node_modules cache for now to test it

* ci: fix node_modules cache save dropping the archive

cache.sh wrote its archive as cache.tzst, but actions/cache reserves that
name for its own tarball and passes --exclude cache.tzst, so our archive was
excluded and an empty (~200 B) cache was saved on Linux/macOS. Rename the
archive to node-modules.tzst and bump build/.cachesalt to invalidate the
broken cache entries.

* empty commit

* Remove again saving to the node modules cache from PR steps
2026-06-19 17:21:43 +02:00
Lee Murray 77f8b67c2c Revert "Update 2026 theme colors" 2026-06-19 16:02:52 +01:00
Don Jayamanne a0c54ca2e9 Update GitHub Copilot and SDK versions to 1.0.64-0 in package and package-lock files (#322020)
* Update GitHub Copilot and SDK versions to 1.0.64-0 in package and package-lock files

* Increase timeout for CopilotAgent tests to 30 seconds
2026-06-19 16:35:16 +02:00
Christof Marti 446f2ce00a Use prod endpoints for testing telemetry (#322065) 2026-06-19 07:17:25 -07:00
Lee Murray 52869e8a77 Update scrollbar and minimap slider colors for improved visibility (#322071)
update scrollbar and minimap slider colors for improved visibility in light and dark themes

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
2026-06-19 14:48:20 +02: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
Michelle Ma de50424611 update Light 2026 hover color 2026-06-18 11:09:59 -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
Zhichao Li ce05188185 OTel: remove obsolete workspace trust metadata 2026-06-17 17:01:35 -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
dependabot[bot] babc391ad1 Bump markdown-it from 12.3.2 to 14.2.0 in /extensions/extension-editing (#321710)
Bumps [markdown-it](https://github.com/markdown-it/markdown-it) from 12.3.2 to 14.2.0.
- [Changelog](https://github.com/markdown-it/markdown-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/markdown-it/markdown-it/compare/12.3.2...14.2.0)

---
updated-dependencies:
- dependency-name: markdown-it
  dependency-version: 14.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-17 09:04:21 -07: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
dependabot[bot] 103f723cc0 Bump form-data from 3.0.4 to 3.0.5 in /extensions/github-authentication (#321696)
Bumps [form-data](https://github.com/form-data/form-data) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/form-data/form-data/releases)
- [Changelog](https://github.com/form-data/form-data/blob/master/CHANGELOG.md)
- [Commits](https://github.com/form-data/form-data/compare/v3.0.4...v3.0.5)

---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 3.0.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-17 08:57:24 -07: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