Skip to content

[pull] main from microsoft:main#1300

Merged
pull[bot] merged 21 commits into
code:mainfrom
microsoft:main
May 27, 2026
Merged

[pull] main from microsoft:main#1300
pull[bot] merged 21 commits into
code:mainfrom
microsoft:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 27, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

benibenj and others added 21 commits May 27, 2026 00:34
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
…essions Grid refactor (#318447)

- IsNewChatSessionContext is now set to true while a pending new session
  exists (created but not yet sent). Previously the Sessions Grid refactor
  made _handleActiveSessionContextKeys set it to 'session === undefined',
  which was false for pending sessions, hiding the isolation/branch pickers
  on the new-session page.

- Clear IsNewChatSessionContext to false in sendNewChatRequest when the
  first request is sent (matching the old behaviour where opening a session
  cleared the flag).

- Sync the loading spinner's initial visibility right after its DOM element
  is created in render(). The autorun that toggles the spinner fires in the
  constructor before render() creates the DOM element, so the initial
  loading=true state was silently dropped on window reload.

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

* Relax event sync cadence and filter delta events

* minor update

* update retry timer

* update ratelimit handling cadence

* feedback update
Fix telemetry validation issue in sessionsTelemetryReporter
* agentHost: surface steering messages as their own user turn

When a user sent a steering message mid-turn, the Copilot agent host folded the SDK's response into the in-flight turn instead of showing the steering as a separate user message in the chat UI. The pending steering bubble silently disappeared and the assistant's reply appeared as a continuation of the original turn.

Buffer accepted steering messages and, when the SDK echoes them back through a `user.message` event (matched by content, skipping synthetic `source != 'user'` injections), promote the steering to its own protocol turn: dispatch `SessionTurnComplete` for the in-flight turn, then `SessionTurnStarted` with the steering's userMessage and `queuedMessageId` so the reducer atomically clears the pending entry. `_turnId` is updated so subsequent SDK deltas land in the new turn. Cleanup paths (abort, dispose) drain any unflipped buffer entries via `steering_consumed` so the chat UI bubble still clears.

Fixes #318265

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

* address PR review feedback

- Skip setTurnEventId for synthetic user.message injections (source != 'user') so the DB doesn't pin a turn boundary to a non-user-visible event id.

- Promote the steering turn BEFORE recording the SDK event id, so history.truncate / sessions.fork target the new steering turn rather than the preempted one.

- _beginSteeringTurn now uses resetTurnState() to also reset the usage counter and subagent agentId map (previously bled across the preempt).

- Update _pendingSteeringFlips / _takeMatchingPendingSteering JSDoc to match the user.message-driven implementation.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update xterm.js to 6.1.0-beta.220

* Stop the weirdness with cpu-features on package-lock.json
* fix cutoff chat requests

* address comments
…file monitoring (#318284)

* feat: Introduce ChangesetFileMonitorCoordinator for session-specific file monitoring

- Added ChangesetFileMonitorCoordinator to manage file monitoring for changesets.
- Integrated ChangesetFileMonitorCoordinator into ChangesetSessionCoordinator.
- Updated ChangesetSessionCoordinator to handle session restoration, materialization, and disposal with file monitoring.
- Implemented IAgentHostFileMonitorService to provide file monitoring capabilities.
- Created AgentHostFileMonitorService to manage file watching with debounce and exclusion options.
- Added tests for ChangesetSessionCoordinator and AgentHostFileMonitorService to ensure correct functionality.

* refactor: encapsulate file monitor acquisition in a dedicated function

* docs: enhance documentation for ChangesetFileMonitorCoordinator lifecycle and monitoring behavior

* Potential fix for pull request finding

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

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Replaces base64 data URL with a Blob + URL.createObjectURL so the JPEG screenshot bytes are not simultaneously retained as a VSBuffer, a ~1.33x base64 JS string, and a parsed CSS data URL. The object URL is revoked when the screenshot is replaced or the editor is disposed.
Use preferredHome instead of defaultFilePath so the save dialog opens
in the user's home directory rather than the current workspace.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: simplify authentication change handling in CopilotCLIModels

* Add testes

* Fix tests

* 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>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Make session sync flush params exp controllable

* Feedback update

* Fix for test
The `chat.agentHost.*` settings were only registered in
`chat.shared.contribution.ts` (renderer). The desktop main process reads
`chat.agentHost.enabled` in `app.ts` to decide whether to spawn the
agent host, and the electron-main and remote-server agent host starters
read `chat.agentHost.claudeAgent.path` plus the six `chat.agentHost.otel.*`
settings to populate env vars on the spawned process. Without a
registration in those processes, every `getValue()` call returned
`undefined` and the declared defaults were silently ignored.

This change introduces two platform-level contribution files and wires
each one only where it's consumed:

- `agentHost.config.contribution.ts` — registers `chat.agentHost.enabled`.
  Side-effect-imported by `electronAgentHostStarter.ts` so the main
  process picks it up transitively from `app.ts`. The remote server does
  **not** consume this key (it spawns the agent host based on
  `--agent-host-port` / `--agent-host-path` CLI args), so the server's
  registry intentionally stays empty for it — an accidental future read
  will fail loudly instead of silently picking up a workbench default.

- `agentHostStarter.config.contribution.ts` — registers the seven
  starter-consumed settings (`claudeAgent.path` + 6 `otel.*`).
  Side-effect-imported by both starters (`electronAgentHostStarter.ts`
  and `nodeAgentHostStarter.ts`) so the registration travels with the
  consumer and is discoverable from either end.

Both contribution files are also side-effect-imported from
`chat.shared.contribution.ts` so the renderer still sees all keys in
the settings UI. The three renderer-only keys (`ipcLogging`,
`ahpJsonl`, `customTerminalTool`) stay inline in
`chat.shared.contribution.ts` — they have no consumers outside the
renderer, so registering them elsewhere would only pollute those
processes' registries.

Verified the agent host process itself does not read `chat.agentHost.*`
via the workbench `IConfigurationService`: the starters translate
settings into env vars (`buildAgentHostOTelEnv`,
`VSCODE_AGENT_HOST_CLAUDE_SDK_PATH`) and the agent host's own
root/session config service handles runtime knobs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tern (#318488)

* launch: simple file dialog, monaco-paste helper, parallel session pattern

Surfaced while running a bug bash over the Agents window terminal tool —
the launch skill needed three improvements before subagents could drive
multiple Code OSS instances cleanly.

1. launch.sh now forces `files.simpleDialog.enable: true` in the launched
   profile. Native macOS file dialogs cannot be driven via @playwright/cli
   over CDP/SSH; the simple (quick-input style) dialog can. Without this,
   the new-session workspace picker's `Select...` button is a dead end
   for automation on a fresh slim-copied UDD.

2. New scripts/monaco-paste.sh helper inserts text into the focused
   Code OSS chat-input Monaco editor by dispatching a synthetic
   ClipboardEvent('paste') with a DataTransfer payload. Avoids pbcopy's
   system-wide NSPasteboard collision (which fights any other process
   touching the clipboard), supports unicode/emoji/backticks/quotes/
   newlines, and waits two requestAnimationFrames before read-back
   because Monaco updates its view-line DOM asynchronously after paste.
   Honors `--session NAME` arg or `$PW_SESSION` env. Verified across
   20+ pastes including all the awkward characters and parallel
   multi-instance runs.

3. SKILL.md updated to:
   - document the new simpleDialog default
   - recommend monaco-paste.sh as the primary typing path; keeps per-key
     `press` and `pbcopy` as fallbacks with the pasteboard-collision
     caveat called out explicitly
   - make `-s=$PW_SESSION` the default convention on every
     @playwright/cli example so the skill's per-instance isolation
     extends to the Playwright-driving layer. Without `-s=`, parallel
     shells share the implicit "default" session daemon and the most-
     recently-attached CDP wins for every subsequent command
   - add a "Parallel multi-instance pattern" subsection showing the
     full attach/paste/cleanup loop with per-session names
   - note that PLAYWRIGHT_CLI_SESSION env var works for `open`-style
     workflows but interacts poorly with `attach --cdp=` due to a
     playwright-core bug (cli-client/session.ts:142-143) — explicit
     `-s=` works in all modes

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

* Address PR review feedback

Five inline comments from the Copilot reviewer on #318488, all addressed:

- launch.sh: replace the regex-strip-then-JSON.parse settings overlay
  with a data-preserving text-based insert. The previous version could
  silently drop user settings on parse failure and would incorrectly
  strip `//` inside string values (e.g. URLs). The new version:
    * detects when the key is already present (any value) and updates
      its value via a targeted regex on the value slot only;
    * otherwise inserts the key before the last `}`, preserving all
      comments and formatting;
    * fails loudly (non-zero exit) if the file is structurally bad
      rather than silently overwriting with `{}`;
    * is idempotent (T6: byte-identical when key is already `true`).
  Verified across 7 scenarios incl. JSONC comments + URLs containing
  `//` + malformed input.

- monaco-paste.sh: detect platform and pick `Meta+a` (macOS) or
  `Control+a` (Linux/Windows) for the clear-before-paste select-all,
  so the default (non-`--append`) path actually clears the editor on
  non-mac.

- monaco-paste.sh: validate node + jq up-front in addition to npx, so
  missing tools fail with a clear actionable message and exit 2 rather
  than crashing later.

- monaco-paste.sh: header docs now correctly list the three exit codes
  (0 success, 1 paste/eval failure, 2 argument/tooling error) and the
  required tools on PATH.

- monaco-paste.sh: fix `set -u` unbound-variable error when no
  PW_SESSION/--session is set — `"${PW_ARGS[@]}"` on an empty array
  trips set -u, so use the `${PW_ARGS[@]+"${PW_ARGS[@]}"}` idiom at
  every call site.

- SKILL.md: fix "Macros-Mach-ports" → "macOS Mach-ports" typo.

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

---------

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

Streaming the agent host's worktree announcement
("Created isolated worktree for branch `xyz`") briefly rendered a bare
opening backtick because `fillInIncompleteTokens` was not closing the
codespan during progressive rendering. The progressive word renderer in
`chatWordCounter` deliberately excludes backticks from word characters,
so the intermediate state at the end of a streamed chunk is exactly
"…for branch \`xyz" — which is precisely what
`fillInIncompleteTokensOnce` is supposed to patch up.

Two issues conspired:

1. `ChatContentMarkdownRenderer` wraps `supportHtml` markdown in
   `<body>...</body>` so dompurify does not strip leading comments.
   That makes the lexer emit
   `[html('<body>'), paragraph(…`xyz), space, html('</body>')]`, so
   `tokens.at(-1)` is `html`, not `paragraph`, and the
   codespan / list fix-ups never run.

2. The agent host paths were unconditionally setting
   `supportHtml: true` on streamed markdown deltas. The
   "supportHtml is load bearing" comment is now stale: PR #318053
   replaced the old `AgentHostEditingSession` (which emitted bare
   ` ```` ` fences as `markdownContent`) with a dedicated
   `'externalEdit'` progress part, so model deltas have nothing to
   accidentally merge into.

Fixes:

- `fillInIncompleteTokensOnce` now walks past trailing `space` and
  `html` tokens to find the last paragraph/list, then preserves those
  trailing tokens around the patched-up node. Heading branch is
  intentionally left alone.
- Drop `supportHtml: true` (and the stale comment) from both the live
  streaming sink in `agentHostSessionHandler` and the history rebuild
  in `stateToProgressAdapter`. Drop the now-unused `options` parameter
  from `rawMarkdownToString`.

Tests:

- New token-level regression in `markdownRenderer.test.ts` exercises
  the `<body>…</body>`-wrapped + bare-backtick scenario.
- New end-to-end test in `chatMarkdownRenderer.test.ts` runs through
  the full render pipeline (with `supportHtml: true` and
  `fillInIncompleteTokens: true`) and asserts a `<code>` element is
  produced with no leftover bare backtick.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators May 27, 2026
@pull pull Bot added the ⤵️ pull label May 27, 2026
@pull pull Bot merged commit 2e9dc7f into code:main May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants