Skip to content

Merge to main - #1

Merged
Piyush142 merged 1184 commits into
Piyush142:mainfrom
microsoft:main
Jun 12, 2026
Merged

Piyush142 merged 1184 commits into
Piyush142:mainfrom
microsoft:main

Conversation

@Piyush142

Copy link
Copy Markdown
Owner

No description provided.

lszomoru and others added 30 commits June 10, 2026 05:40
* Bring over the latest version of the protocol

* Phase 1 & Phase 2

* Phase 3

* Phase 4

* Phase 5

* Fix diff information in the sessions list

* Wire-up the resolving the changesets when the session is active

* More fixes following the branch

* Attach the changesets for a materialized session

* Manually fix agent host protocol file

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Fix compilation errors

* Skip/fix some tests

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
…on-text

Update welcome sign-in button label to "Sign in to use GitHub Copilot"
…9003) (#319011)

* fix: guard postToolUse hook against closed response stream (fixes #319003)

When the user cancels a chat request while tools are executing, the
response stream is closed. The postToolUse hook would then attempt to
write warnings via hookProgress to the closed stream, causing an
unhandled 'Response stream has been closed' error.

Add a cancellation token check before executing the postToolUse hook.
If the request is already cancelled, skip the hook entirely since the
stream cannot accept further output.

Co-authored-by: Copilot <[email protected]>

* fix: replace unicode em-dash with ASCII hyphen in comment

The Compile & Hygiene check failed due to a non-ASCII character (U+2014
em-dash) in a code comment. Replace with a standard hyphen.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
chat: custom trajectory compaction model (usePrismCompaction) (#316114)

Route conversation-history compaction (foreground /compact and background auto-compaction) to the dedicated trajectory-compaction CAPI model when chat.conversationCompaction.usePrismCompaction is enabled and the agent model matches chat.conversationCompaction.prismModelFilter. When the flag is off, behavior is unchanged from upstream.

Squashed rebase of PR #316114 onto main. Conflicts resolved by unioning additive changes: combined main's isCAPIEndpoint import with the PR's APIUsage import in agentIntent.ts, and kept both main's longToolCallCachePreservation.* and the PR's conversationCompaction.* nls keys. main's #320273 background-summarization anchor-round fix is preserved (backgroundSummarizer.ts unchanged).

Co-authored-by: Copilot <[email protected]>
Switch from Copilot Proxy to CAPI V3
- A window reload reconnects with a new clientId but an identical tool
  list. The cached SDK session was reused with the dead window's clientId
  baked in, so every later client tool call was stamped with that dead id,
  routed to passive render, and hung forever with nobody to invoke it.
- Introduces a live, shared ActiveClientState so the owning clientId is
  read at tool-call stamp time instead of being frozen at session creation,
  and makes the staleness check restart only on structural tool/plugin
  changes — a clientId-only change no longer needlessly restarts (Copilot)
  or yield-rebinds (Claude) the session.
- Adds a server-side safety net so a client tool call stamped for a client
  that is not connected (including one that disconnected before the call was
  even issued) fails after a grace window rather than hanging, with the
  grace measured from when that client was last seen.
- Lets a completion that races ahead of the SDK tool handler resolve via a
  buffered result, preserving the previous out-of-order tolerance.

Fixes #319641

(Commit message generated by Copilot)
less dependency on activeSession for pickers
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
* OTel visibility in Copilot Chat UI (#47)

* [msrc/1.123] 114763

* Add maxAttributeSizeChars configuration to OpenTelemetry settings

---------

Co-authored-by: Zhichao Li <[email protected]>
(cherry picked from commit 042dc59)
(cherry picked from commit be6ab8b)

* Prompt before connecting to non-loopback remote host:port authorities (#46)

A direct `<host>:<port>` remote authority (no resolver `+` prefix) bypasses
resolver extensions and connects straight to the given server. Since this form
can originate from untrusted sources (e.g. the `remoteAuthority` of a
`.code-workspace` file), a crafted workspace could silently point the window's
extension host backend at an attacker-controlled server.

Centralize a confirmation prompt at the connection point in the renderer:
when resolving a direct authority whose host is not loopback (localhost,
127.0.0.1, ::1), ask the user to confirm before connecting and abort if
declined. Add `isLoopbackHost` helper and tests.

(cherry picked from commit 9505d0f)
(cherry picked from commit 9673132)

* GitHub - improve host parsing (#48)

(cherry picked from commit 4b6e246)
(cherry picked from commit 9fea92e)

* path traversal fix (#50)

* fix path traversal

* fix compilation

(cherry picked from commit 9b31ff8)
(cherry picked from commit a703741)

* Path - improve isEqualOrParent calculation (#49)

(cherry picked from commit 0f1ba1e)
(cherry picked from commit 5927baa)

---------

Co-authored-by: Zhichao Li <[email protected]>
Co-authored-by: Zhichao Li <[email protected]>
Co-authored-by: Alexandru Dima <[email protected]>
Co-authored-by: Ladislau Szomoru <[email protected]>
Co-authored-by: Sandeep Somavarapu <[email protected]>
* Proxy browser requests in remote workspaces

* feedback

* Partial remote proxying

* back to https proxy

* clean

* refactor

* clean

* feedback
Add basic contributing guide for markdown extension
Pick up latest TS version for building VS Code
Fix empty Copilot client tool results

Successful client tool calls now return a non-empty placeholder when they have no text content, while preserving embedded resources for the model.

Fixes #315947

Co-authored-by: Copilot <[email protected]>
# Conflicts:
#	src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts
#	src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts
)

Ctrl/Cmd+1..9 collided between two distinct command families in the agents
window: focusing a session already open in the grid vs opening the Nth session
from the list. On Windows both resolved to Ctrl+1..9, producing inconsistent
behavior (#320552) and Ctrl+9 opening the last session instead of the 9th
(#320553).

- Focus Session in Grid keeps Ctrl/Cmd+1..9 and now treats 9 as the LAST slot,
  matching core's Focus Last Editor Group.
- Open Session from list moves to Alt+1..9 (Win/Linux) and Ctrl+1..9 (macOS,
  WinCtrl) to avoid the collision and Option+digit symbol input on macOS.

Co-authored-by: Copilot <[email protected]>
agentHost: fix orphaned client tool calls after window reload
deepak1556 and others added 29 commits June 12, 2026 14:02
* extensions: migrate auto update setting to on/off values

Migrate `extensions.autoUpdate` from the boolean/enum values (`true`,
`onlyEnabledExtensions`, `false`) to simple `on`/`off` string values:
- `on` replaces the previous `onlyEnabledExtensions` behavior (the
  retired `true` and insiders `delayed` values also map to `on`)
- `off` replaces `false` (and the internal `onlySelectedExtensions`)

Also add a new `extensions.autoUpdateDelay` setting (in hours) to
control the delay before a published update is auto-installed, replacing
the previously hardcoded 2 hour period.

Both settings are policy-enabled for enterprise management.

Co-authored-by: Copilot <[email protected]>

* extensions: address PR review feedback

- Add required enumDescriptions to extensions.autoUpdate policy localization
  (string-enum policies must provide them or export-policy-data fails)
- React to extensions.autoUpdateDelay config changes by rescheduling the
  delayed auto-update check
- Update pluginAutoUpdate doc comment to reflect normalized 'on'/'off' values
- Update user-facing strings/command titles to drop 'All Extensions' since
  'on' now means only enabled extensions are auto-updated
- Stub the delay key in tests

Co-authored-by: Copilot <[email protected]>

* extensions: regenerate policy data for auto update settings

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
…ere is an active subscriber (#321130)

* Ensure that we only refresh the uncommitted changes if there is an active subscriber

* Default to not having any subscribers

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
* style: update font sizes and weights in sidebar and toolbar styles

* style: adopt design tokens for font sizes and weights in various CSS files

* style: adopt design tokens for font sizes, weights, and margins across various CSS files

* style: adopt design tokens for font sizes and weights in agent feedback and host picker styles

---------

Co-authored-by: mrleemurray <[email protected]>
disable the color decorators in the output view
* nes-datagen: add cursor-jump (NCLP) task

Extend nes-datagen with a next-cursor-line prediction task alongside
the existing xtab path. Detects the user's next intentional cursor
move after the request bookmark and emits a training sample with the
production cursor-prediction prompt + the observed jump as the
expected response.

Three sub-modes via --sample-task:
  - cursor-same-file: a jump farther than N lines from cursor at
    request time
  - cursor-cross-file: focus/selection on a different file
  - cursor-both: either of the above

Reuses the production cursor-prediction prompt by capturing it via
the telemetry builder and a no-op fetcher; the cross-file target
line is resolved from a request-time content snapshot + post-request
replay so previously-opened targets get a correct line number
instead of being silently labelled :0.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: replace SAMPLE_TASK_VALUES tuple with a string enum

Convert the string-union + as-const tuple to a proper NesDatagenSampleTask
string enum. CLI surface is  string-enum members keep theunchanged
kebab-case wire values ('xtab', 'cursor-same-file', ...). All consumers
(dispatch, fixtures, response metadata typing) updated to reference enum
members instead of string literals.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: lower default --same-file-jump-min-above to 2

Upward cursor jumps (back to a definition, an import, etc.) are
typically tighter than downward jumps after the user has been
writing. Lower the default threshold to match.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: rename NCLP to cursor-jump throughout

Drop the NCLP abbreviation in favor of the more descriptive
'cursor-jump' name already used in the production xtab provider.
 cursorJumpPromptStep,
 cursorJumpResponseStep), the capture request ids,
and all surrounding doc comments / test descriptions.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: build documentIndexMapping from whole recording

path map from only the
pre-request slice and then re-walked the post-request slice to
backfill any documentEncountered entries that arrived later. Pass the
whole recording into documentIndexMapping instead so the helper sees
every document the user touched in a single pass; the backfill loop is
gone.

splitRecordingAtRequestTime now also returns the full entries array so
both callers can reuse it without re-deriving it from altAction.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: use shared Result type in cursor-jump detectors

Drop the bespoke { ok, value | reason } discriminated union in
detectJump.ts and reuse the existing Result<T, E> from
src/util/common/result. JumpDetectionResult<T> is now just an alias
for Result<T, string>.

.isOk(),
.err) and the spec file accordingly.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: strip raw cursor-jump prompt from emitted telemetry

cursorJumpRawMessages and cursorJumpKeptRange were added to
IStatelessNextEditTelemetry so in-process debug / datagen tooling
could read them back via getStatelessNextEditTelemetry(). However
LlmNESTelemetryBuilder.build() spreads ...this._statelessNextEditTelemetry
into the emitted payload, so those two fields would leak to telemetry
 cursorJumpRawMessages can contain full prompt content (sourcesinks
code), which must never leave the process.

Destructure them out before spreading into the build() payload. They
remain readable via getStatelessNextEditTelemetry() for tooling.

Documented the privacy contract on the IStatelessNextEditTelemetry
field declarations so future edits don't forget.

Addresses copilot-pull-request-reviewer feedback on PR #320113.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: fail cross-file detection when no selection lands on target

detectCrossFileJump previously returned Result.ok with toLine
undefined when only a focused event was seen for the target doc (no
selectionChanged). That left generateCrossFileResponse to drop the
sample later while the detector still reported a successful jump.

Treat focused-without-selectionChanged as a failed detection
('crossFileTargetNoSelection') so callers can skip early, and tighten
ICrossFileJump.toLine to non-undefined now that ok results always
have a usable line number. Removes the dead error path in
generateCrossFileResponse.

Adds a regression test that focused-only triggers the new error.

Addresses copilot-pull-request-reviewer feedback on PR #320113.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: capture cursor-jump prompt via logContext, not telemetry

The datagen pipeline previously stashed the raw cursor-jump prompt and
keptRange on IStatelessNextEditTelemetry so cursorJumpPromptStep.ts could
read them back via LlmNESTelemetryBuilder.getStatelessNextEditTelemetry().
That leaked raw prompts into the telemetry payload (worked around by a
destructure-strip hack in LlmNESTelemetryBuilder.build()) and was
asymmetric with the xtab path, which captures via
InlineEditRequestLogContext.rawMessages.

Move the cursor-jump capture vehicle onto InlineEditRequestLogContext to
match xtab:

- Add cursorJumpRawMessages / cursorJumpKeptRange fields and
  setCursorJumpPrompt(messages, keptRange) to InlineEditRequestLogContext.
- XtabNextCursorPredictor.predictNextCursorPosition now takes a logContext
  parameter and writes to it directly. The xtabProvider callsite passes
  the same logContext it already had in scope.
- cursorJumpPromptStep reads from logContext instead of the telemetry
  builder.
- Remove cursorJumpRawMessages / cursorJumpKeptRange from
  IStatelessNextEditTelemetry, plus the corresponding setter/getter on
  StatelessNextEditTelemetryBuilder and the getter on
  LlmNESTelemetryBuilder.
- Revert the destructure-strip hack in LlmNESTelemetryBuilder.build().

The pre-existing cursorJumpPrompt telemetry field (JSON-stringified, fed
by setCursorJumpPrompt(messages)) is intentional and unchanged.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: cursor-jump ground truth is first user EDIT, not cursor landing

Selection-based detection treated peek, navigation, IDE auto-scroll, and
recursive cursor settling as if they were the user's next intended edit
location. The model's job is to predict where the user will EDIT next, so
key off the first 'changed' event after the request bookmark instead.

Same-file detector:
- Walks for the first 'changed' on the active doc; uses the first edit's
  start offset to compute toLine; applies the linesAbove/linesBelow
  threshold. Bails with editsAnotherFileFirst when a non-active doc is
  edited first (lets the cross-file detector claim the sample in
  cursor-both mode). 'selectionChanged' is no longer consulted, so the
  settle-after-edit filter is gone  it was a workaround for thetoo
  selection-based approach.

Cross-file detector:
- Walks for the first 'changed' on a non-active doc; uses the first
  edit's start offset, resolved against the target doc's snapshot
  just-before applying the event. Drops focused / selectionChanged
  heuristics and the crossFileTargetNoSelection error path (a focused
  event without an edit no longer counts; background peek can't
  pollute the dataset).

buildLineResolver: tightened i <= entryIndex to i < entryIndex so the
resolver returns the pre-edit line when entryIndex is itself a 'changed'
event. The bound is equivalent for the old selectionChanged caller.

Spec: switched ground-truth events from selChanged to changed; added
coverage for first-edit-of-multi-edit, editsAnotherFileFirst, and
active-doc-then-other-doc ordering.

Co-authored-by: Copilot <[email protected]>

* xtab: predictNextCursorPosition takes RequestTracingContext

Every other helper in xtabProvider takes RequestTracingContext (the
{ tracer, logContext, telemetry } bundle). The cursor predictor was the
odd one out, taking the three pieces as separate positional params with
the latter two  that asymmetry made the new logContext-captureoptional
plumbing look more invasive than it is and forced an awkward
?.setCursorJumpPrompt chain at the use site.

Switch the predictor to take RequestTracingContext directly:
- Export RequestTracingContext from xtabProvider so the predictor can
  type-import it (TS-erased to avoid the runtime circular import).
- predictNextCursorPosition signature collapses from 5 params to 3.
- Drop the optional chains; tracing.telemetry / tracing.logContext are
  always present in production and the spec constructs a real bundle.
- Spec adds a createTestTracingContext helper using the cheap
  InlineEditRequestLogContext / StatelessNextEditTelemetryBuilder
  constructors already used by other inlineEdits specs.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: rename splitRecording 'entries' field to 'wholeRecording'

Review feedback: the field on the splitRecordingAtRequestTime return
shape was named 'entries' but in context it carries the whole unsplit
recording (i.e. before slicing into prior/after parts). 'wholeRecording'
matches the comment at the consumer (documentIndexMapping callsite).

Co-authored-by: Copilot <[email protected]>

* nes-datagen: inline JumpDetectionResult<T> as Result<T, string>

Review feedback: the one-line alias was used in exactly two places in
the same file and gave nothing over the underlying Result type.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: discriminated union for sample task + jump metadata

Review feedback: ISampleMetadata had 'task' + an optional 'jump' field
with toFilePath also optional. That let xtab samples accidentally carry
a jump and let cursor-cross-file samples omit toFilePath. Replace with
a discriminated union on task:

- xtab: no jump
- cursorSameFile: jump with fromLine/toLine/distance
- cursorCrossFile: jump with required toFilePath

assembleSample now takes a single SampleClassification arg, removing
the parallel task/jump parameters that callers had to keep in sync.

cursorJumpResponseStep is split into ISameFileGeneratedResponse and
ICrossFileGeneratedResponse so the generator return types map cleanly
to the union variants without a non-null assertion at the assembly
site.

DetectedJump no longer needs an assistantTask hint: the pipeline
constructs the classification directly from the response shape.

Co-authored-by: Copilot <[email protected]>

* fix dup import

* nes-datagen: address round-4 review feedback on pipeline.ts

Five review threads on pipeline. all addressed in-place.ts

- modelResponse: cursor samples were emitting an empty string for the
  expected response. Populate it with the assistant content (which IS
  the expected output) so downstream tooling has the gold label.

- Promise.all unbounded throws: wrap the limiter callback body in
  try/catch so an unexpected exception from generateCursorPromptFromRecording
  becomes a recorded per-row error instead of aborting the whole batch
  via Promise.all's first-rejection semantics.

- Inline import for OffsetRange: replace the inline import('...').OffsetRange
  type expression with a regular top-of-file import.

- Duplicated config-override block: both pipelines applied the same
  applyConfigFile + four setConfig debounce/cache disables. Extract
  into applyBatchModeConfig(configService, configs) and call from both.

- runInputPipeline parallelism + memory: add a doc comment clarifying
  that this is the single-process entry point, that cursor-jump tasks
  also benefit from runInputPipelineParallel (--sample-task is
  propagated to workers), and that loadAndParseInput is in-memory by
  design (sized per worker; use --parallelism > 1 for large inputs).
  Full architectural unification of the parallel and non-parallel
  paths is intentionally left as a follow- the surface area isup
  large and out of scope for this PR.

Co-authored-by: Copilot <[email protected]>

* nes-datagen: add e2e tests for cursor-jump pipeline

Mirrors the existing xtab pipeline.e2e.spec.ts: drives two fixture rows
(a same-file jump and a cross-file jump) through the full
`runInputPipeline` for each `sampleTask` mode (cursor-same-file,
cursor-cross-file, cursor-both) and asserts on the JSONL output.

Coverage:
- only the matching row is emitted per mode; both rows are emitted in
  cursor-both
- emitted samples carry strategy=next-cursor-line-prediction and the
  correct discriminated `task` field (cursor-same-file / cursor-cross-file)
- assistant message targets the jumped-to line / file
- metadata.modelResponse mirrors the assistant content (the round-4 fix)
- --row-offset is reflected in metadata.rowIndex

Test fixtures are constructed in
`fixtures/cursorJumpFixtureData.ts` with synthesized recordings: an
explicit no-op edit + selectionChanged before the bookmark so the
cursor-prediction path's recent-edit gating is satisfied, then a
single post-request `changed` event the detector picks up.
The cursor pipeline needs a prompting strategy whose response handler
tolerates an empty stream — use `xtabUnifiedModel` in a dedicated
`cursorJumpConfig.json` (the existing patchBased02 config crashes on
empty output, which is acceptable in production but breaks the
prompt-only capture path).

Co-authored-by: Copilot <[email protected]>

* Strengthen cursor-jump e2e assertions

Replace fuzzy matchers (toMatch(/25/), arrayContaining for tasks) with
exact assertions on assistant content, metadata.task, and metadata.jump.
In cursor-both, locate samples by filePath so a row→classification swap
would now be caught instead of passing.

Co-authored-by: Copilot <[email protected]>

* Make cursor-jump e2e helper accept partial nesDatagen overrides

Helper previously took Partial<RunPipelineOptions>; if a caller passed
`nesDatagen`, the spread fully replaced the default block and the
configured path. Now the helper accepts a partial nesDatagen overlay
and merges field-by-field, so the row-offset test only specifies the
two fields it actually changes and there are no non-null assertions.

Co-authored-by: Copilot <[email protected]>

* Add within-threshold cursor-jump negative fixture

Scenario C: cursor on line 10, post-request edit on line 12 (only 2
lines below). Default threshold is ±5 lines, so neither the same-file
nor the cross-file generator should emit a sample for this row.

Asserted in cursor-both via a dedicated 'does not emit a sample for
the within-threshold row' test, and implicitly in cursor-same-file /
cursor-cross-file (their existing count==1 assertions would fail if
the threshold guard regressed).

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Ulugbek Abdullaev <[email protected]>
…ows (#319595)

* nes: send periodic enhanced telemetry with overlapping recording windows

Adds ContinuousEnhancedTelemetrySender which periodically ships a fixed-length
slice (5 min) of DebugRecorder activity as an enhanced GH telemetry event,
reusing the existing 'copilot-nes/provideInlineEdit' channel and tagging events
with 'continuous: true' so the backend can route them.

Adjacent slices are guaranteed to overlap by >= 30 s. With tick cadence
INTERVAL = WINDOW - OVERLAP - HARD_CAP and a (idle, hard_cap) wait that mirrors
the suggestion-anchored TelemetrySender, the slice always ends at a 'stable'
moment so we don't capture mid-keystroke state. Slices with no actual edits are
skipped.

- DebugRecorder gains getLogInRange(from, to), with framing fast-forwarded so
  the emitted setContent reflects the document state at the slice start.
- New experiment-gated setting chat.advanced.nes.continuousEnhancedTelemetry.enabled
  (default off).
- Wired into InlineEditProviderFeature alongside TelemetrySender.

Co-authored-by: Copilot <[email protected]>

* nes: address PR review feedback

- Fix config key mismatch: TS used 'chat.advanced.nes...' but package.json
  exposed 'chat.nes...', so user/experiment config was never read. Align the
  TS key with the package.json key.
- Use DebugRecorder.getTimestamp() instead of Date.now() for the window end
  so edits whose recorded instant was bumped past Date.now() for total
  ordering aren't dropped at the boundary.
- Drop unused 'at' parameter from the insertEdit test helper and clean up
  the call sites that were still passing a redundant timestamp.

Co-authored-by: Copilot <[email protected]>

* nes: drop config gate for continuous enhanced telemetry

Per PR feedback: the existing GH enhanced-telemetry user controls are
sufficient gating; no need for a dedicated setting.

Removes:
- chat.nes.continuousEnhancedTelemetry.enabled setting (package.json,
  package.nls.json, ConfigKey).
- IConfigurationService + IExperimentationService dependencies from the
  sender; the loop now runs unconditionally for the sender's lifetime.
- Two tests that exercised the config toggle.

Co-authored-by: Copilot <[email protected]>

* nes: clarify continuous telemetry semantics + drop misnamed field

Subagent review findings:

- Drop `activeDocumentRepository` for continuous events: a 5-min slice spans
  many docs over time, so there's no meaningful 'active' document. The full
  workspace repo set is reported via `repositories` already.
- Rename `MAX_ENTRIES_BYTES` -> `MAX_ENTRIES_CHARS` (truth in advertising:
  it's `string.length` / UTF-16 code units, matching the existing suggestion-
  anchored recording cap).
- Class-level doc: clarify that the overlap guarantee assumes timely scheduler
  execution; extension-host stalls / machine sleep / skipped empty slices can
  produce gaps. Treat `windowStart`/`windowEnd` as authoritative; don't infer
  contiguity from `sequenceNumber + 1`.
- Doc that `sessionId` is per-sender-lifetime, and that the sender can be
  recreated within one extension session when `InlineEditProviderFeature`'s
  autorun reruns.

Co-authored-by: Copilot <[email protected]>

* nes: don't bump docVersion on selectionChanged in DebugRecorder

Per PR review: `selectionChanged` entries have no `v` field in the schema
(workspaceLog.ts:64), and production `WorkspaceRecorder` only bumps version
on real document content changes via VS Code's model version. The replayer
consumes `changed.v` directly when applying edits.

Previously, `DebugRecorder` synthesized `v` and bumped it on every recorded
event including selections, which produced phantom gaps in the `changed`
version sequence (e.g. 2, 4, 5 instead of 2, 3, 4) that don't match what a
real recording would contain.

Fixed in both `getDocumentLog` and `getDocumentLogInRange`. Snapshot test
updated; added a focused regression test asserting consecutive `changed`
entries get consecutive `v` values regardless of interleaved selection
changes.

Co-authored-by: Copilot <[email protected]>

* nes: drop caller reference from DebugRecorder.getLogInRange jsdoc

Per PR review: low-level method docs shouldn't reference specific
callers — they easily go stale.

Co-authored-by: Copilot <[email protected]>

* nes: clamp slice framing times + dedup upstream-remote helper

Two PR review threads:

1. Slice framing times made misleading. `getDocumentLogInRange` was
   emitting `documentEncountered.time = creationTime` and
   `setContent.time = baseValueTime`, both of which can pre-date the
   requested `[fromTimeMs, toTimeMs]` window (a doc may have been open
   for hours). Now framing times are clamped up to `fromTimeMs` so the
   slice's per-event `time` contract holds. Documented the invariant
   and added a coverage test asserting every emitted time falls in
   range; updated the fast-forward test's expectation accordingly.

2. Upstream-remote extraction was copy-pasted in three places (twice in
   `nextEditProviderTelemetry.ts`, once in the new sender). Extracted
   to `getUpstreamRemote(repository)` in `platform/git/common/utils.ts`
   and reused everywhere. Behaviour preserved.

Co-authored-by: Copilot <[email protected]>

* nes: extract NES_GH_TELEMETRY_EVENT_NAME constant

Per PR review: the literal 'copilot-nes/provideInlineEdit' was hardcoded
in three call sites in nextEditProviderTelemetry.ts plus the new continuous
sender. Extract into a named export from nextEditProviderTelemetry.ts (the
file that already owns the event) and import it from the continuous sender
so the relationship is explicit. Behaviour unchanged.

Tests intentionally still use the literal string since they assert on the
wire-level event name.

Co-authored-by: Copilot <[email protected]>

* nes: revert clamp of framing times in getDocumentLogInRange

The clamp I added in b1d795c was wrong on three counts:

1. **Sort ambiguity**: clamping multiple docs' framing to `fromTimeMs`
   creates ties in the sortTime used by the cross-doc merge sort in
   `getLogInRange`. Ordering then depends on insertion order (i.e. map
   iteration order) instead of real time. Stable sort still preserves
   the per-doc framing-before-edits invariant, but the result becomes
   load-bearing on insertion order in a way the old code wasn't.
2. **Inconsistency with production**: `WorkspaceRecorder`
   (workspaceRecorder.ts:254) emits `documentEncountered`/`setContent`/
   `opened` with their actual timestamps, never clamped to a window.
   The DebugRecorder slice should match that semantic.
3. **Worse for stitching**: with clamping, the same logical
   `documentEncountered` event gets a different time in each
   overlapping slice (fromTimeMs of that slice) — harder to dedup than
   the stable true creationTime.

Revert the clamp; document that framing carries true creation/base-value
times even when they pre-date `fromTimeMs`, and that consumers should
treat any entry with `time < fromTimeMs` as framing. Drop the
out-of-range test, restore the original setContent.time expectation in
the fast-forward test.

Co-authored-by: Copilot <[email protected]>

* nes: harden continuous telemetry loop against subagent-found issues

Subagent review (rounds: code-review HIGH + rubber-duck #2,#3,#8) found:

1. **Unhandled throw in _sendNow kills the loop forever.** RunOnceScheduler's
   runner has no try/catch, so an exception from JSON.stringify or the
   telemetry service would propagate out and never let reschedule() run.
   Fix: try/finally around _sendNow() so reschedule() always fires.
   Added regression test.

2. **cleanUpHistory() in getDocumentLogInRange races with fromTimeMs.**
   Cleanup uses getNow() - 5min as its cutoff. Between the caller computing
   windowEnd and the per-doc cleanup running, getNow() can advance enough
   that earliestTime > fromTimeMs, causing an edit at the leading edge of
   the requested range to be rotated into baseValue and dropped from the
   emitted slice. Fix: don't call cleanUpHistory() in this getter at all —
   the fast-forward loop already handles any base state, and the per-edit
   cleanup in handleEdit keeps memory bounded.

3. **Disposed idleStores accumulate in loopStore.** Calling idleStore.dispose()
   doesn't remove it from the parent's tracking Set, so dead inner stores
   leak one per ~4 min for the sender's lifetime. Fix: loopStore.delete(idleStore)
   instead.

4. **_sendNow() duration not in overlap math.** Added a doc caveat — the
   JSON.stringify cost is added to inter-send spacing but is well under 1 %
   of the 30 s overlap budget in practice. No code change.

5. **No test for doc opened after toTimeMs.** Added one.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
fix: guard against missing voiceWsUrl, remove from OSS product.json

The voiceWsUrl should only be set in the proprietary product.json
(Insiders/Stable builds). When missing, log an error instead of
attempting to connect with an empty URL.

Co-authored-by: Copilot <[email protected]>
)

The file-write redirection guard already blocks tilde (~) expansion but did not account for Windows environment-variable expansion (e.g. %APPDATA%\file.txt, %HOME%/file.txt). Such paths are not classified as absolute by posix.isAbsolute or win32.isAbsolute, so they could be auto-approved and write outside the expected workspace scope without confirmation.

Adds % to the redirection guard and regression tests for bash and pwsh.

Co-authored-by: Megan Rogge <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: meganrogge <[email protected]>
* agents: add exp settings for default agent selection

* Honor chat.editor.defaultProvider when opening new chat editors

Resolve the configured default session type for the New Chat Editor
actions instead of hardcoding a local session.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Sandeep Somavarapu <[email protected]>
…21141)

* sessions: track preferred session type when no explicit user pick

The session type picker now distinguishes an explicit user pick from the
active session's type. The stored preference is written only when the user
explicitly picks a non-default type, and is cleared when the user re-selects
the default (first) type. New chat creation reads the user pick when present,
otherwise falls back to the preferred (first) session type for the folder and
keeps tracking it as the folder's session-type list changes.

Co-authored-by: Copilot <[email protected]>

* fix name

* sessions: address review feedback on session type preference

- Keep the original storage key (sessions.lastSelectedSessionType) to avoid
  resetting existing users' persisted preference.
- Persist the explicit selection regardless of whether the visible pick
  changed (it may reflect the active session): picking the default clears the
  stored preference, any other pick stores it; only fire onDidSelectSessionType
  when the visible pick actually changes.

Co-authored-by: Copilot <[email protected]>

* fix name

---------

Co-authored-by: Copilot <[email protected]>
…1154)

When the resolved default shell (e.g. zsh) is not installed on the
system, the Copilot terminal tool fails with 'Path to shell executable
does not exist'. This adds a validation step in getCopilotProfile that
checks whether the resolved shell binary exists on disk and falls back
to /bin/bash or /bin/sh when it doesn't.

Fixes #319302

Co-authored-by: Copilot <[email protected]>
* Add best practices instructions file

Co-authored-by: Copilot <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
* Add isBYOK signal to distinguish CAPI vs BYOK models

Plumb an explicit isBYOK flag end-to-end (proposed chatProvider API ->
core ILanguageModelChatMetadata -> ext host conversion), set it at the
BYOK provider chokepoint (AbstractLanguageModelChatProvider), and
consolidate BYOK/Copilot selection helpers in chatSelectedModel.ts used
by runSubagentTool and the quota notification.

* fix test

* PR
* Add hygiene rule to prevent js files

* CCR feedback
* build: share product pipeline configuration

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* build: rename TSA product pipeline

* Revert "build: share product pipeline configuration (#320187)"

This reverts commit 79cbede.

* Reapply "build: share product pipeline configuration (#320187)"

This reverts commit c2e2ff0.

* Updating template for TSAA

* Updating template for TSAA

* build: keep product pipeline unchanged

* Updating template path for TSA

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
* AgentHost - add per-provider enable settings for Claude/Codex

Adds two settings that gate provider registration in the agent host
process, independent of the SDK availability check that was the only
gate before:

- chat.agentHost.claudeAgent.enabled (default: true)
- chat.agentHost.codexAgent.enabled  (default: false)

The agent host's `chat.agentHost.*` namespace already had:
- `chat.agentHost.enabled` — master switch for spawning the host
- `chat.agentHost.claudeAgent.sdkRoot` / `chat.agentHost.codexAgent.sdkRoot`
  — dev-only path overrides for the SDK
- `chat.agentHost.codexAgent.codexHome` / `binaryArgs` — Codex runtime knobs

Provider registration in `agentHostMain.ts` / `agentHostServerMain.ts`
was previously gated only on `agentSdkDownloader.isAvailable(...)`,
which checks whether the SDK is reachable (dev override env var or a
`product.agentSdks.<pkg>` entry). The new settings compose with that
gate as `enabled && isAvailable`, giving users a way to suppress
Claude/Codex even when the SDK ships.

Wired through both starters (`electronAgentHostStarter.ts`,
`nodeAgentHostStarter.ts`) via a new field on `IAgentSdkStarterSettings`
and forwarded to the child process as
`VSCODE_AGENT_HOST_{CLAUDE,CODEX}_AGENT_ENABLED` env vars. The host
reads them through a shared `isAgentEnabled()` helper that defaults
to `true` for Claude and `false` for Codex when the env var is absent
(matches the setting defaults).

Note: this is independent of `chat.agents.claude.preferAgentHost` and
`chat.editor.claude.preferAgentHost`, which decide whether the
workbench surfaces the agent host's Claude provider vs. the GitHub
Copilot Chat extension's. The new settings control whether the agent
host advertises the provider at all.

Verified end-to-end with all four enable/disable combinations in the
Agents window picker.

* Address Copilot review: clarify isAgentEnabled doc + add tests

- JSDoc on `isAgentEnabled` now matches the implementation: lists all
  recognized values (`'true'`/`'1'` enable, `'false'`/`'0'` disable, anything
  else falls through to the default) instead of implying only `'false'`
  disables.
- New table-driven test suite covering undefined / empty / whitespace
  fallback to default, case-insensitive `'true'`/`'TRUE'`/`'false'`/`'FALSE'`,
  trimmed values, numeric `'1'`/`'0'`, and unrecognized values falling back.
…ity (#321191)

Resolved resources were always stamped with FilePermission.Readonly in
stat(), so real files opened read-only even though the provider advertises
FileReadWrite and implements writeFile. Drop the spurious flag for real
resources (keeping it only for the synthetic root and the virtual
session-db / git-blob schemes).

Also surface the canonical-path information the AHP resourceResolve already
returns by advertising the FileRealpath capability and implementing
realpath(), which re-encodes the resolved canonical URI back into provider
space.

Co-authored-by: Copilot <[email protected]>
…itor

Add setting to open changed chat files in an editor instead of a diff
@Piyush142
Piyush142 merged commit cb29916 into Piyush142:main Jun 12, 2026
10 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.