Commit Graph

155969 Commits

Author SHA1 Message Date
yemohyleyemohyle ffc280ded2 Yemohyle/add to telemetry (#311837)
* add last asst messages logs

* add last asst messages logs ...

* add last asst messages logs ....

* add last asst messages logs .....

* add assistant messages added logs

* ...

* add tokens info

* add parentHeaderrequestId value to subagent telemetry

* remove debug logging

* Apply suggestion from @Copilot

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

* suggested change

* extra verification

* revert suggested change

* remove debug logs

* add cashed tokens to Legasy SSE path

---------

Co-authored-by: Yevhen Mohylevskyy <yevhenmohylevskyy@Yevhens-MacBook-Pro-2.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-28 17:59:04 +00:00
Hawk Ticehurst 47b95823d2 sessions: use strong foreground for session titles (#313031)
* sessions: use strong foreground for session titles

Update the sessions sidebar list so session titles use the new strongForeground token, including the in-progress shimmer state, while preserving archived and selection styling.

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

* sessions: apply strong foreground to archived session titles too

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

* sessions: restore dark theme shimmer contrast

Use descriptionForeground for the in-progress session title shimmer stop in dark themes so the animation remains visible against strongForeground text.

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

* sessions: preserve shimmer text masking

Use a background-image override for the dark theme shimmer stop so the existing text clipping and animation remain intact.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-28 13:43:15 -04:00
Lee Murray f962640c26 Agents: Fix editor background and border styles for agents panel (#313028)
fix: update editor background and border styles for agents panel

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
2026-04-28 10:41:37 -07:00
Megan Rogge 2725549712 Focus search input on section selection for keyboard parity (#312871) 2026-04-28 13:34:46 -04:00
Connor Peet 81e19a693f Merge pull request #313032 from microsoft/connor4312/cli-ahp-management
cli: implement client AHP control functionality
2026-04-28 09:59:48 -07:00
Connor Peet ed85ff7a6c comments and more deps 2026-04-28 08:56:30 -07:00
Connor Peet e78dfbd537 agentHost: fix other cases of client-provided tools getting stuck (#312942)
* agentHost: fix other cases of client-provided tools getting stuck

* comments and ci
2026-04-28 08:52:37 -07:00
Connor Peet 3317944fde Merge remote-tracking branch 'origin/main' into connor4312/cli-ahp-management 2026-04-28 08:35:16 -07:00
Henning Dieterichs 6b2fbaf804 Fixes component explorer lockfile 2026-04-28 17:18:52 +02:00
vs-code-engineering[bot] 573fb625e3 [cherry-pick] Multifile Diff Editor - fix error on initial reveal (#313023)
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
2026-04-28 08:18:39 -07:00
Connor Peet 2c36ddb55e cli: implement client AHP control functionality 2026-04-28 08:10:51 -07:00
Zhichao Li 757e7d3724 Merge pull request #312929 from zhichli/zhichli/mcp-traceparent-sep414
MCP: forward W3C traceparent to servers via _meta (SEP-414)
2026-04-28 07:56:36 -07:00
Johannes Rieken a7bcda727c feat: enhance inline chat functionality with additional services and mock implementations (#313017)
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 14:14:46 +00:00
Robo c11c069d62 fix: restrict entitlements used for helper.app (#312734) 2026-04-28 13:12:27 +00:00
Lee Murray 13e84c2d2d Agents: Fix padding for editor action items (#313006)
fix(editorPart.css): adjust padding for editor action items

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
2026-04-28 15:01:04 +02:00
Lee Murray f9c47b12d6 Agents: Enable tab shrinking in narrow viewports for better accessibility (#313004)
editor: enable tab shrinking in narrow viewports for better accessibility of close button

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
2026-04-28 15:00:52 +02:00
Lee Murray 4f2f275a95 Agents: Enhance account menu UI and chat status tooltip (#313001)
* feat: add color theme selection to account menu and adjust UI padding

* style: enhance chat status tooltip appearance and layout

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 11:06:09 +00:00
Lee Murray 8d97209dc2 Add strongForeground color for enhanced text legibility (#312993)
* Add strongForeground color for enhanced text legibility

* Update src/vs/platform/theme/common/colors/baseColors.ts

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

---------

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-28 10:46:46 +00:00
Lee Murray d3b2cc9844 Merge pull request #312984 from microsoft/mrleemurray/open-in-agents-update
Refactor titlebar action handling and improve CSS legibility for "Open in Agents" widget
2026-04-28 11:37:33 +01:00
Johannes Rieken 389fcc7541 inlineChat: make status placeholder registration a singleton (#312975)
* inlineChat: make status placeholder registration a singleton

The actionViewItemService.register() call for the StatusPlaceholder
was done per InlineChatZoneWidget instance. Since the service throws
on duplicate (menuId, commandId) registrations, having two zone widgets
(e.g. in side-by-side editors) would crash.

Fix: single process-lifetime registration that dispatches to the correct
widget instance via DOM containment at render time.

Fixes #312792

* defer DOM lookup to rAF since render() runs before DOM attachment
2026-04-28 10:37:06 +00:00
Ladislau Szomoru ceb044c5c5 Engineering - improve scheduled release check (#312983) 2026-04-28 09:22:49 +00:00
Ladislau Szomoru 0360932721 Agents - more GitHub REST API cleanup (#312978)
* Agents - deprecate old code

* Rename request2 to request

* More cleanup
2026-04-28 09:08:16 +00:00
mrleemurray 3b7bb5c284 Refactor OpenInAgentsAction to support macOS and Windows for sibling app launch
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 10:01:34 +01:00
mrleemurray 5d68d6ad88 Remove opacity from "Open in Agents" icon filter for improved legibility 2026-04-28 09:55:41 +01:00
mrleemurray 559812e7a9 Refactor titlebar action handling and improve CSS legibility for "Open in Agents" widget 2026-04-28 09:47:15 +01:00
Justin Chen ba3d653b01 fix placeholder not showing up + inline chat progress border (#312979) 2026-04-28 08:41:06 +00:00
Johannes Rieken 7c6d456ec3 profiling: replace v8-inspect-profiler with chrome-remote-interface (#312974)
* profiling: replace v8-inspect-profiler with chrome-remote-interface

Convert src/vs/base/node/profiling.ts from pasted JS+DTS into a
proper TypeScript module. Replace the v8-inspect-profiler dependency
with chrome-remote-interface and update all import sites.

* Update src/vs/base/node/profiling.ts

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

* Update src/vs/base/node/profiling.ts

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

* ccr

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-28 10:40:22 +02:00
Tyler James Leonhardt ffadbb00d0 Clean up some parameters and stuff in Claude (#312946)
* Clean up some parameters and stuff in Claude

Just some debt.

* fix tests
2026-04-27 22:46:50 -07:00
vs-code-engineering[bot] 243897eed0 [cherry-pick] Update GitHub Copilot dependency to version 1.0.38 (#312954)
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
2026-04-28 02:50:26 +00:00
Justin Chen 25b6fc9ae7 enable progress border in insiders + reduce motion (#312878)
* enable progress border in insiders + reduce motion

* some cleanup

* address comments
2026-04-28 02:40:34 +00:00
Paul b712765852 Add support for usage-based billing (#312892) 2026-04-28 02:37:05 +00:00
vs-code-engineering[bot] 6c2bbf7682 [cherry-pick] OSS tool: update third-party notices (v1.118.0) (#312952)
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
2026-04-28 01:40:04 +00:00
Vijay Upadya 00680fde6d Add GDPR tag to capi.assignmentcontext (#312933)
Co-authored-by: Copilot <copilot@github.com>
2026-04-27 17:54:53 -07:00
Zhichao Li d1f9c7f16a Merge pull request #312938 from zhichli/zhichli/otel-ttfc-genai-semconv
otel: support gen_ai.response.time_to_first_chunk in sqlite store
2026-04-27 17:54:42 -07:00
Osvaldo Ortega b48d6739c4 Agents web: Mobile host picker dropdown improvements (#312934)
* feat: replace host picker context menu with mobile-native bottom sheet on phone layout

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/c0ced124-328e-43c3-a95c-34c56f55a84d

Co-authored-by: osortega <48293249+osortega@users.noreply.github.com>

* fix: guard bottom sheet dismiss against double-invocation and stop event propagation from sheet

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/c0ced124-328e-43c3-a95c-34c56f55a84d

Co-authored-by: osortega <48293249+osortega@users.noreply.github.com>

* refactor: extract mobile host picker into MobileHostFilterActionViewItem

Move the bottom sheet UI from an inline phone-layout branch in the
desktop HostFilterActionViewItem into a proper mobile subclass in
browser/parts/mobile/, following the established mobile architecture:

- Create MobileHostFilterActionViewItem extending the desktop class,
  overriding _showMenu() to show a bottom sheet instead of a context menu
- Remove IsPhoneLayoutContext branching from the desktop component
- Move bottom sheet CSS from hostFilter.css to mobileChatShell.css
- Update hostFilter.contribution.ts to instantiate the mobile variant
  for the MobileTitleBarCenter menu registration
- Add Mobile Component Architecture rules to sessions.instructions.md

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

* fix: replace bottom sheet with dropdown anchored below trigger

The bottom sheet slid up from the bottom of the screen, far from the
picker trigger at the top, and had a transparent background. Replace
with a dropdown panel that:

- Anchors directly below the trigger element
- Has a solid background with border and shadow
- Animates in/out with a subtle fade + slide from above
- Uses 44px min-height items for touch targets
- Transparent backdrop for dismiss-on-tap without visual overlay

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

* fix: improve mobile host picker dropdown design

- Use agentsChatInput background color to match the chat input
- Add font-weight: normal to prevent bold text in items
- Add Gesture.addTarget + TouchEventType.Tap on each item button
  so taps register on iOS/touch devices (CLICK alone is unreliable)

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

* refactor: move host picker dropdown CSS to own component file

- Create media/hostPickerDropdown.css in mobile parts folder
- Move all host picker styles from mobileChatShell.css to dedicated component file
- Add CSS import in mobileHostFilterActionViewItem.ts
- Document CSS organization pattern in sessions.instructions.md

This follows the same pattern as regular VS Code parts where each component
owns its CSS in a media/ subfolder. Keeps mobileChatShell.css focused on
shell-level phone layout styles only.

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

* fix: use defined CSS theme variables for host picker dropdown

Replace undefined fallback variables with proper agentsChatInput theme tokens:
- background: var(--vscode-agentsChatInput-background)
- foreground: var(--vscode-agentsChatInput-foreground)
- border: var(--vscode-agentsChatInput-border)

These variables are registered in src/vs/sessions/common/theme.ts and
properly available in all themes.

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

* fix: use globally available CSS theme variables for host picker

Replace agentsChatInput variables (only available in .agent-sessions-workbench scope)
with globally available input and foreground variables since the backdrop is
rendered directly on body, outside the workbench scope.

- background: var(--vscode-input-background)
- foreground: var(--vscode-foreground)
- border: var(--vscode-input-border)

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

* fix: use inline styles from theme service for host picker

CSS variables aren't available in the body scope where the dropdown is rendered.
Instead, fetch theme colors via IThemeService and apply them as inline styles:

- Get theme colors at dropdown creation time
- Set backgroundColor, borderColor, foregroundColor via style attribute
- Apply hoverBackgroundColor and linkColor via event listeners
- Remove all CSS variable references

This ensures colors work in vscode.dev and all environments where CSS variables
may not be injected.

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

* fix: remove unused focusBorderColor variable

The focus border styling is handled by the CSS :focus-visible rule,
so the TypeScript variable is not needed.

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

* fix: render dropdown inside workbench container for CSS variables

The dropdown was appended to document.body, which is outside the
.monaco-workbench element where --vscode-* CSS custom properties
are defined. This caused all theme variables to be undefined.

Fix: query for the .monaco-workbench container and append the
backdrop there instead. This restores CSS variable inheritance
and moves all color declarations back to the CSS file where
they belong.

Also reverts the IThemeService inline-styles approach — colors
are now purely in hostPickerDropdown.css using standard CSS
variables.

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

* fix: center host picker dropdown and remove status text

1. Center the dropdown horizontally on screen using left: 50% +
   translateX(-50%) instead of anchoring to the trigger's left edge.
2. Remove the 'connecting…' / 'disconnected' status text from dropdown
   items — the titlebar connection icon already conveys this info, and
   the status text was causing the dropdown to extend beyond screen.
3. Clean up unused AgentHostFilterConnectionStatus import and status CSS.

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

* fix: include translateX(-50%) in dropdown animation keyframes

The entrance/exit animations were overriding the centering transform
during playback, causing the dropdown to appear right-aligned then
jump to center when the animation ended.

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

* fix: remove stray closing brace in mobileChatShell.css

Leftover from extracting host picker CSS into its own file.

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

* fix: address PR review comments

1. Fix dismiss race condition: guard the timeout callback so it only
   clears the dropdown if it still owns the current store, and register
   the timeout for disposal when the dropdown is reopened early.

2. Use correct ARIA pattern: switch from listbox/option to menu/menuitemradio
   which better matches the single-select interaction pattern.

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

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-28 00:24:51 +00:00
Zhichao Li b804497dc2 Support OTel GenAI gen_ai.response.time_to_first_chunk attribute
The CLI runtime is migrating from the vendor-prefixed
github.copilot.time_to_first_chunk attribute to the OTel GenAI
semconv attribute gen_ai.response.time_to_first_chunk. Both encode
TTFT in seconds. The sqlite store's _ttftMs() now reads either
name (preferring the new one) so we keep populating ttft_ms before,
during, and after the runtime rollout.

Adds two unit tests: one for the new attribute alone, one verifying
the new attribute wins when both are present.

Refs:
  https://github.com/open-telemetry/semantic-conventions/pull/3607
  https://github.com/github/copilot-agent-runtime/pull/6949
2026-04-27 16:57:25 -07:00
Connor Peet 1e23c4c7e0 agentHost: dismiss question widget on other clients when answered (#312919)
When a question (input request) is answered on one client in a multi-client
AgentHost session, the question carousel now disappears on all other clients
and shows the actual answers instead of 'Skipped'.

- Use the protocol input request id as the carousel's resolveId so the
  chat input widget can be targeted for cleanup by key.
- Track per-entry whether completion came from shared state vs local UI.
- Listen on onWillApplyAction for SessionInputCompleted to capture answers
  before the reducer removes the input request from state (the reducer
  deletes the request entirely, so answers are only on the action payload).
- Convert protocol SessionInputAnswer records back to carousel-display
  format so the summary renders 'Q: ... / A: ...' instead of 'Skipped'.
- Guard cleanup so locally-submitted carousels keep their answer data when
  the server echoes the completion back.
- Clear the matching chat input widget via IChatWidgetService when the
  request disappears from state on passive clients.

Fixes https://github.com/microsoft/vscode/issues/312869

(Commit message generated by Copilot)
2026-04-27 23:39:23 +00:00
Hawk Ticehurst 7ad23fe375 sessions: make gradient shell background default (#312855)
Remove the sessions experimental shell gradient toggle and always apply the shell gradient styling for the sessions workbench.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 19:37:55 -04:00
vs-code-engineering[bot] 6312899db6 Update endgame notebook milestones to 1.119.0 (#312683)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-27 23:35:47 +00:00
Pierce Boggan 0b4fc3e2ad Fix Copilot CLI /remote session prompt handling (#312874)
* Fix Copilot CLI remote session prompts

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

* Fix user_query sanitization

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

* Fix remote ask-user session cleanup

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

* Fix Copilot Linux lint failure

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

* Fix remote ask-user answer sync

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-27 17:35:14 -06:00
Zhichao Li a106aa680d Address PR feedback: preserve trace flags/state, plumb inbound $invokeTool
- TraceContext now carries optional traceFlags + traceState (W3C); the real
  OTel impl populates them so the built traceparent reflects the upstream
  sampling decision instead of hardcoding '01'.
- toolsService: build traceparent with the actual flag, forward tracestate.
- extHostLanguageModelTools.$invokeTool: deliver traceparent/tracestate to
  extension-implemented tools for symmetry with outbound $invokeTool.
- Reword toolsService comment so it matches the unconditional behavior.
2026-04-27 16:33:54 -07:00
vs-code-engineering[bot] 776a341e97 [cherry-pick] OSS tool: update third-party notices (v1.117.0) (#311698)
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
2026-04-27 16:32:52 -07:00
Zhichao Li 1810e63dd1 Forward W3C traceparent to MCP servers via _meta (SEP-414)
Plumb the active execute_tool span's W3C traceparent through
LanguageModelToolInvocationOptions and IMcpToolCallContext, then inject
it into the JSON-RPC tools/call payload's _meta so MCP server-side spans
can be parented to the client trace.

Refs #302301
2026-04-27 16:22:28 -07:00
Bhavya U 0910f0dea3 Enable tool search for Claude Opus 4.6/4.7 1M context models (#312913) 2026-04-27 22:43:36 +00:00
Vijay Upadya 09d54a6849 Add /chronicle:reindex command to rebuild local session index from JS… (#312905)
* Add /chronicle:reindex command to rebuild local session index from JSONL logs

Co-authored-by: Copilot <copilot@github.com>

* Address feedback

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-27 15:34:04 -07:00
Zhichao Li 51e531ab6f Merge pull request #310878 from microsoft/zhichli/claudeOtel
Add OTel tracing for Claude agent sessions
2026-04-27 15:31:12 -07:00
Osvaldo Ortega bb4ad20185 Add account indicator to mobile titlebar in agents workbench (#312437)
* Add account indicator to mobile titlebar in agents workbench

The mobile titlebar now shows a contextual right slot:
- Welcome / new session screen: [☰] [title] [account]
- In a chat session: [☰] [title] [+]

The account indicator mirrors the desktop titlebar account widget:
- Shows GitHub avatar when signed in, codicon fallback otherwise
- Displays dot badge for quota warnings/errors
- Tapping opens a panel with account info, copilot status dashboard,
  and sign-in/sign-out actions
- Touch-friendly: 44px minimum touch targets, touch-action: manipulation

Also extracts the AccountMenu MenuId to Menus.AccountMenu for sharing
between the desktop and mobile implementations.

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

* Fix account panel immediately dismissing on mobile tap

The hover service registers a document-level mousedown listener for
sticky hovers that dismisses the hover when clicking outside it. On
mobile, the mousedown fires in the same event cycle as the click that
opens the panel, so the hover was created and then immediately
dismissed.

Defer the showInstantHover call to the next animation frame so the
mousedown event has completed before the sticky listener is registered.

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

* Use DOM overlay for mobile account panel instead of hover service

The hover service's sticky mousedown/mouseout handling doesn't work
reliably on mobile touch devices. Replace it with a simple DOM overlay
pattern: a full-screen backdrop that catches taps to dismiss, with the
panel absolutely positioned below the top bar.

This is more appropriate for mobile UX — touch interactions work
natively without fighting the desktop hover infrastructure.

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

* Fix account panel styling by appending inside workbench container

The panel was appended to document.body, outside the
.agent-sessions-workbench container, so none of the existing
.sessions-account-titlebar-panel-* CSS selectors matched.

Append the backdrop and panel inside the workbench container so
the desktop panel styles (header, actions, dashboard, separators)
apply correctly on mobile.

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

* Redesign mobile account panel as full-screen bottom sheet

Replace the desktop-style dropdown with a native mobile bottom sheet:

- Full-screen sheet with header (title + close button)
- Profile section with large avatar + name + provider
- Copilot status dashboard when signed in
- Large touch-friendly action rows (52px height, 16px font)
  with icons for Sign In/Out and Settings
- Proper safe area insets for notched devices
- Scrollable content area with overscroll containment
- All new CSS classes (mobile-account-sheet-*) purpose-built
  for mobile — no reuse of desktop hover panel styles

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

* Fix scopeListOrRequest is not iterable in signIn

When product.json defaultChatAgent.providerScopes is empty,
scopes[0] evaluates to undefined. The spread in createSession
then fails with is not iterable. Default to an empty array.

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

* Add OAuth callback support to sessions web dev server

The sessions dev server was missing two things needed for GitHub
OAuth sign-in to work:

1. A /callback route serving the OAuth redirect page (callback.html)
   that writes the auth code to localStorage
2. A urlCallbackProvider passed to the workbench create() options
   that polls localStorage for the auth code and delivers it back
   to the GitHub authentication extension

Without these, the OAuth flow would complete on GitHub's side but
the auth code was never delivered back to the workbench.

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

* Revert "Add OAuth callback support to sessions web dev server"

This reverts commit 4034dd5b0b8add4e94e47c38c08ee0fcb22ffcfe.

* Fix web walkthrough auth scope mismatch and token expiry

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

* Use product config scopes for walkthrough sign-in instead of hardcoded

The previous fix used defaultAccountService.signIn() which blocks on
the init barrier — the DefaultAccountProvider may not be set yet when
the walkthrough runs on first launch.

Instead, keep using authenticationService.createSession() directly
(which doesn't depend on the provider lifecycle) but read the scopes
from productService.defaultChatAgent.providerScopes[0] instead of
hardcoding ['repo', 'user:email', 'read:user']. This ensures the
session has the 'workflow' scope that the account provider needs
while avoiding the provider initialization race.

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

* Add fallback scopes when product config is unavailable

If productService.defaultChatAgent.providerScopes is undefined (e.g.
in vscode-dev web context where product config may not include it),
fall back to the full scope set including workflow. Without this, an
empty scopes array would create a session that the tunnel discovery
code cannot find (it filters for user:email).

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

* Listen to auth session changes directly for mobile account indicator

The mobile account indicator relied solely on
defaultAccountService.onDidChangeDefaultAccount, which depends on
the DefaultAccountProvider completing its async initialization
(extension registration, entitlement resolution). On mobile web,
the walkthrough sign-in creates the session before the provider
is fully initialized, so the event is missed.

Also listen to authenticationService.onDidChangeSessions to pick up
new GitHub sessions immediately when they're created, regardless of
the DefaultAccountProvider lifecycle.

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

* Fix account indicator showing Sign In after walkthrough on localhost

Two fixes for the mobile account indicator not reflecting auth state
after the walkthrough completes:

1. Fall back to reading GitHub sessions directly from
   IAuthenticationService when DefaultAccountService returns null.
   This covers the window between session creation (walkthrough) and
   DefaultAccountProvider initialization (extension registration).

2. When we have an account name from auth sessions but entitlement is
   still Unknown (not yet resolved), treat it as Unresolved rather
   than Unknown. This prevents getAccountTitleBarState() from
   returning 'Agents Signed Out' when the user is actually signed in
   but the entitlement service hasn't caught up yet.

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

* Hide Copilot setup dashboard in mobile account sheet when unresolved

The ChatStatusDashboard shows 'Set up Copilot to use AI features'
when the entitlement is Unknown or Available (new user). This setup
flow doesn't apply in the agents app which has its own walkthrough.

Only show the dashboard when entitlements have fully resolved to a
known plan (Free, Pro, etc). When still resolving, the profile
section already shows the account name which is sufficient.

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

* Apply same auth state fixes to desktop TitleBarAccountWidget

The desktop account widget had the same issue as the mobile one:
after walkthrough sign-in, it showed 'Agents Signed Out' because
the DefaultAccountProvider hadn't initialized yet.

Apply the same three fixes from the mobile indicator:
1. Listen to authenticationService.onDidChangeSessions directly
2. Fall back to reading GitHub sessions when defaultAccountService
   returns null
3. Override Unknown -> Unresolved when an account name is present
   to prevent showing signed-out state during entitlement resolution

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

* Add INFO-level logging to DefaultAccountProvider for debugging

Upgrade key log messages from debug to info level to trace the
account resolution flow in the browser console:
- Session count and matching results in findMatchingProviderSession
- Account name and scopes when sessions are found
- Final account state after initialization completes

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

* Use console.log for DefaultAccount debug logging

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

* Accept any session when providerScopes is empty

On vscode.dev the product config may not include providerScopes,
resulting in an empty allScopes array. The scope matching loop
never executes, so no sessions match even though valid sessions
exist. When no scopes are configured, accept any available session.

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

* Hide 'Use AI Features' button when AI features are disabled

When users disable AI features via chat.disableAIFeatures, the account
section in the Agents window should not show the 'Set up Copilot to use
AI features' button. This change checks sentiment.hidden in addition to
the other disabled states to properly hide this UI element.

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

* Hide Copilot setup dashboard in desktop account panel when unresolved

Same fix as the mobile account sheet — don't show the
ChatStatusDashboard when entitlement is Unknown or Available,
as it renders a 'Set up Copilot to use AI features' prompt
that doesn't apply in the agents app.

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

* Update

* Clean up

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
2026-04-27 15:09:33 -07:00
Bhavya U d025ee4199 fix: handle BudgetExceededError after background compaction re-render (#312901)
* fix: handle BudgetExceededError after background compaction re-render

When the initial render throws BudgetExceededError and a completed
background compaction is applied, the re-render was unprotected. If
the compacted prompt still exceeds the budget (e.g. many MCP tools
consuming token space, or cache breakpoints preventing pruning), the
BudgetExceededError propagated uncaught and crashed the chat with
'No lowest priority node found'.

Now the re-render is wrapped in a try-catch that falls back to
renderWithoutSummarization (full budget, no cache breakpoints) on
BudgetExceededError, with telemetry outcome 'appliedButReRenderFailed'
to track how often this path is hit.

Fixes #311407

* fix: update telemetry for background compaction outcomes and re-render handling
2026-04-27 14:31:29 -07:00
vs-code-engineering[bot] d10a07d0f2 Update distro commit (main) (#312865) 2026-04-27 14:28:48 -07:00
Justin Chen d88ce17d58 fix forking not working in claude + agents (#312906) 2026-04-27 21:25:33 +00:00