* Hide delegation picker for local agent host in Agents app; fix label
- AgentHostContribution now reads IWorkbenchEnvironmentService.isSessionsWindow
and registers the chat session contribution with supportsDelegation: false
in the Agents app, hiding the delegation picker for local agent host
sessions (matches remote agent host behavior). VS Code keeps the picker.
- Fix display label for AgentSessionProviders.AgentHostCopilot from
'Agent Host - Copilot' to 'Agent Host - Copilot CLI' in
getAgentSessionProviderName, which is what the session target picker uses
for known provider types.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: localize label, stub env service in tests
- Localize 'Agent Host - Copilot CLI' provider label like the other
built-in provider labels.
- Stub IWorkbenchEnvironmentService in agentHostChatContribution tests
so AgentHostContribution can be constructed after the new injection.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Revert label localization (it's a product name)
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Show Copilot CLI [Local] in picker for local agent host
Revert hiding the delegation picker for local agent host sessions in the
Agents app. Instead, show the picker (with non-applicable targets
disabled, as the existing DelegationSessionPickerActionItem already
handles) and update the label to match the format used elsewhere:
'Copilot CLI [Local]'.
This removes the IWorkbenchEnvironmentService injection that was added
to gate supportsDelegation, and the corresponding test stub.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Hide delegation picker for local agent host in Agents app
In the Agents window, hide the delegation picker for local agent host
sessions (matches behavior of remote agent host sessions). In VS Code,
keep the picker available so users can hand off to other targets.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Render search/glob tool messages as markdown
The grep/glob invocation and past-tense messages, plus the shell
past-tense message, contain backtick-wrapped values but were being
sent as plain strings. StringOrMarkdown treats plain strings as
literal text, so the backticks rendered as bare characters in the
chat UI. Wrap them in md() so they're rendered as markdown like the
other tool messages.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Append a stable transcript-file hint (path + line-count snapshot) to
every conversation summary, so after compaction the model can read
the uncompacted transcript on disk.
The hint is appended exactly once at summary-creation time and stored
on round.summary / turn metadata. Subsequent renders replay that
string byte-identically, preserving Anthropic prompt cache hits even
as the transcript keeps growing.
Covers all three summarization paths:
- Full / Simple via ConversationHistorySummarizer.summarizeHistory()
- Inline background via agentIntent.ts _startBackgroundSummarization
(flushes the transcript before snapshotting the line count so the
baked count matches the on-disk file)
Shared via new exported helper appendTranscriptHintToSummary.
Replace EventType.MOUSE_DOWN with addDisposableGenericMouseDownListener
for overlay dismissal in runScriptAction, sessionsWalkthrough,
sessionsPolicyBlocked, and sessionsTitleBarWidget. This uses
POINTER_DOWN on iOS where pointer events are available.
Add touch-action: manipulation to picker trigger elements and the
session title bar pill to eliminate the 300ms tap delay on touch devices.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix enterprise BYOK issues: hidden models, disabled button, account carryover
Fix three bugs in the BYOK (Bring Your Own Key) model feature:
1. #309499 - BYOK models hidden by default: Add isUserSelectable: true
to byokKnownModelToAPIInfo() so models appear in the picker on
registration instead of defaulting to hidden.
2. #309492 - Add Models button disabled when BYOK enabled: Call
_updateClientByokEnabledContext() during ContextKeysContribution
initialization so the clientByokEnabled context key is set before
the Language Models view renders.
3. #309501 - BYOK model carries over from individual account: Use a
separate DisposableStore for BYOK provider registrations and clear
them when switching to an account with BYOK disabled, resetting
the registration flag to allow re-registration on next auth change.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Language Models UI not refreshing on group add/remove (#309495)
The Language Models view did not auto-update when:
- Adding a BYOK model with an invalid configuration (error status)
- Removing a BYOK model group
Root cause: _resolveAllLanguageModels only checked model cache changes
to decide whether to fire onDidChangeLanguageModels. When groups were
added/removed but the model set didn't change (e.g., groups with errors
or empty groups), the event never fired and the UI stayed stale.
Fixes:
1. Add _hasGroupStructureChanged to detect group-level changes (count,
names, statuses) independently of model cache changes
2. Add explicit viewModel.refresh() after delete action, matching the
pattern already used by the managementCommand path
3. Await configureLanguageModelsProviderGroup in addModelsForVendor and
refresh the view model after the add flow completes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Restore session config for sessions opened from list
Sessions opened from the chat list (not created in the current window
lifetime) had no `state.config` populated, so the running-session
auto-approve picker rendered nothing. Two fixes:
1. `AgentService.restoreSession` now re-resolves the session config
from the working directory and overlays previously persisted user
values, so `state.config` is set on restore.
2. User-selected config values are now persisted to the per-session DB
(as `configValues` JSON metadata) both when the session is created
and on every `SessionConfigChanged` action, so they survive across
process lifetimes.
The session-mutable subset of `state.config` is also lazily seeded
into the remote/local providers' `_runningSessionConfigs` map via a
reference-counted state subscription, so the picker re-renders once the
snapshot arrives.
Schema is intentionally re-resolved on restore rather than persisted,
so provider schema changes (renamed/removed/changed-enum properties)
are picked up automatically; persisted values that no longer satisfy
the new schema are dropped on the next resolve.
(Written by Copilot)
* Add integration test for session config restore after server restart
Exercises the full create -> change config -> persist -> server restart ->
subscribe -> restored state.config flow at the protocol/WebSocket level.
To enable this:
- `startServer` test helper now accepts a `userDataDir` and `env` so
two server processes in the same test can share a session DB directory.
- `ScriptedMockAgent` reads `VSCODE_AGENT_HOST_MOCK_SEED_SESSIONS`
on construction so the second-phase server can re-seed the in-memory
session list it would otherwise lose across restarts.
(Written by Copilot)
* Address review: extract resolvedConfigsEqual + fix CI typecheck
Extract the shared resolvedConfigsEqual helper into
vs/sessions/common/agentHostSessionsProvider.ts and import it from both
the local and remote agent host session providers (was duplicated).
Fix a typecheck failure in agentService.test.ts where a real URI was
being passed to AgentHostStateManager.removeSession, which takes the
protocol-level URI alias (a string).
Also clarify in the createSession comment why we persist the full
resolved config values rather than only the user input: clients render
the resolved state on restore without having to re-resolve.
(Written by Copilot)
* Try to make multiroot smoke test less flaky
The 'Multiroot > shows results from all folders' smoke test on macOS
browser was failing because openFileQuickAccessAndWait() retries 9 times
in ~160ms with no backoff when it sees 'No matching results'. On a fresh
remote/browser server start, the workspace folders may not have been
attached yet (extension host still starting), so file search legitimately
returns 'No matching results' and all 9 retries fire before the workspace
is ready.
Add an incremental backoff between retries so slow workspace/file-search
initialization on CI has a chance to catch up.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update test/automation/src/quickaccess.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds an `authenticationPending` observable to both the local
(`IAgentHostService`) and remote (`RemoteAgentHostSessionsProvider`)
agent host providers, defaulting to `true` so cached sessions surface
as loading from window-open until the first auth pass settles. The
flag is sticky: once cleared, subsequent background re-auths (account
change, session refresh, server reconnect) do not flicker the UI.
Also unblocks renderer-registered language model providers (such as
the agent host) from waiting on extension host startup: in
`LanguageModelsService._resolveAllLanguageModels`, skip the
`activateByEvent` wait when a provider is already registered. This
removes a 10+ second delay before the agent host model picker
populates.
(Written by Copilot)
The CLI runtime emits `github.copilot.time_to_first_chunk` (seconds) on
chat spans, while the foreground extension uses
`copilot_chat.time_to_first_token` (ms). The SQLite store only checked
the foreground attribute, leaving ttft_ms NULL for CLI background agent
spans.
Add a `_ttftMs()` helper that coalesces both attributes with unit
conversion (seconds → ms) so the denormalized column is always populated.
The _renderWorkspacePicker method returns an IDisposable (the
onDidSelectWorkspace event subscription), but render() was discarding
it, causing a leaked disposable error. Register it on the widget's
disposable store.
Regression from #309895. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update hidden Model B agent prompt for evals
* Refine hidden Model B prompt tag structure
* updating prompt to remove codex string
* main merge
* adding task execution tag
* adding task execution tag
* updating labels
Previously both cache hits and reused in-flight requests (async pending
or speculative) showed the database icon in the NES debug log. This
made it hard to tell whether a result was served from cache or joined
an existing stream.
Add a new \`reusedInFlight\` outcome with a git-merge icon ($(git-merge))
to visually distinguish 'joined an in-flight request' from 'loaded from
cache'. The database icon is preserved for true cache hits via
\`setIsCachedResult\`; reused in-flight requests now go through the new
\`setIsReusedInFlightResult\` method.
* agentHost: make 'new terminal' button open a terminal in the remote by default
Adds a new notion of 'default profile overrides' that the sessions app
uses to set the default terminal profile when a remote session is open.
* build
The CopilotAgent.getDescriptor() displayName was "Copilot" but should be
"Copilot CLI" to match the well-known CopilotCLISessionType label used
elsewhere. The remote agent host sessions provider uses this displayName
to build the session type label shown in the UI.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Only list Copilot SDK sessions that already have Agent Host session data, so sessions created by other Copilot CLI agents are filtered out without creating databases during listing.
(Written by Copilot)
* feat: upload commit-to-version mapping for copilot source maps
During the Copilot CI build, after uploading source maps to CDN, also upload
a small JSON file at sourcemaps/{extensionId}/commits/{commitHash}.json that
maps the VS Code commit hash to the patched extension version.
This enables the vscode-errors deminify service to resolve the correct
extension version for Insider builds, where the version is date-patched
(e.g. 0.44.2026041004) and not derivable from the repo alone.
* fix: use no-cache for commit-version mapping blob
The mapping file could change on pipeline reruns, so use
no-cache instead of long-lived cache headers.
* Move to InputState instead of metadata on sessions
Cleans up more old patterns with new patterns.
Co-authored-by: Copilot <copilot@github.com>
* feedback
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
* Agents tunnels: auto-reconnect with backoff and wake-triggered retry
Tunnel-backed remote agent hosts previously had no auto-reconnect
behavior — on laptop sleep / network drop the tunnel would flip to
Disconnected and stay there until the user manually retried.
This adds a reconnect loop inside TunnelAgentHostContribution:
- Detect Connected→Disconnected transitions for still-cached tunnels
and schedule an immediate reconnect. Only fires when the entry is
explicitly Disconnected — if the entry has been removed (e.g. user
clicked "Remove Remote"), we honour the removal and do not reconnect.
- Exponential backoff on consecutive failures: 1s → 30s cap, up to
10 attempts, then pause.
- Wake-triggered retry: on browser `online` or tab
`visibilitychange` → visible, resume any paused reconnects.
Rate-limited to one resume per 10s so rapid tab toggling can't
hammer a permanently broken endpoint with unbounded attempt bursts.
- Prune all reconnect state when a tunnel is uncached or the
contribution is disposed.
* Review comment
Co-authored-by: Copilot <copilot@github.com>
* Telemetry
Co-authored-by: Copilot <copilot@github.com>
* Clean up
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
* agentHost: fix bugs around message handling
- Fix a bug where a sessions were not restored correctly because they
had in-progress data (that is the move of the `providedSession.isCompleteObs?.get()`)
- Fix a bug where sessions that supported progress streaming would not
have sendable messages if they were already complete (that is the
addition of `this._pendingRequests.deleteAndDispose(model.sessionResource);`)
- Fix a bug in the agent host where we didn't provide `onDidStartServerRequest`
consistently which often prevented multi-client messaging from working
- DRY up some logic and add tests
* comments