* 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>
editor: enable tab shrinking in narrow viewports for better accessibility of close button
Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
* 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
* 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>
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/3607https://github.com/github/copilot-agent-runtime/pull/6949
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)
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>
- 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.
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
* 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>
* 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