Ensure committing the parent VS Code theme preview prevents later walkthrough teardown from uninstalling the imported theme extension.
Fixes#314052
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
agents: introduce isEmbeddedApp and parentAppName environment properties
- Add isEmbeddedApp property to IEnvironmentService (optional, defaults false)
- Add memoized parentAppNameShort and parentAppNameLong to IEnvironmentService
- Compute parent app display names from isEmbeddedApp flag and product quality
- Set isEmbeddedApp in NativeEnvironmentService from process.isEmbeddedApp
- Thread isEmbeddedApp through INativeWindowConfiguration to renderer
- Use environmentService.parentAppNameShort in welcome theme step button label
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix#312813: Use DI-aware PromptRenderer in sendInvokedToolTelemetry
Use PromptRenderer.create() instead of raw BasePromptRenderer so that
@IPromptEndpoint is properly injected when rendering images.
Regression: sendInvokedToolTelemetry was the only code path constructing
PrimitiveToolResult via raw BasePromptRenderer, causing this.endpoint to be
undefined when onImage() reads this.endpoint.supportsVision.
Changes:
- Updated sendInvokedToolTelemetry to take (instantiationService, endpoint, ...)
- Updated both callers to pass instantiationService and endpoint
- Added unit test for image content rendering without crash
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback: preserve Infinity token budget and fix test
- Override endpoint.modelMaxPromptTokens to Infinity in sendInvokedToolTelemetry
to match prior behavior and avoid truncation of tool results when counting tokens
- Fix unit test: sendInvokedToolTelemetry is fire-and-forget (returns undefined),
so test should verify it doesn't throw rather than expecting a resolved promise
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix test failure: disable image uploads in sendInvokedToolTelemetry test
The test was triggering image upload auth requirements in onImage().
Disable EnableChatImageUpload in test config to avoid auth errors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agents: show per-turn model in agent-host session history
Surface the model used for each response in agent-host chat sessions, like
extension-host Copilot CLI sessions do.
AHP already reports the model on each turn via Turn.usage?.model. The
workbench-side adapter (turnsToHistory) was ignoring this and stamping a
single session-level modelId on every request, with no per-response model
detail.
Refactor turnsToHistory to take a TurnModelLookup (id + display name
resolution) instead of a single modelId. AgentHostSessionHandler builds
the lookup using ILanguageModelsService and the session-type prefix, with
fallback to the session-level summary model when a turn has no usage.
Response history items now carry the display name in 'details', which
flows through to the per-response footer in the chat UI.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add integrated history-loading test for per-turn model display
Covers the active-turn restoration path through provideChatSessionContent
with a mix of completed turns (with/without usage.model) and an in-flight
activeTurn falling back to the session-level model.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: use URI helpers for subagent sessions
Refactor subagent URI handling to preserve URI objects through parsing and eviction checks instead of repeatedly stringifying and reparsing session resources. Keep state-manager lookups at string boundaries while using URI ancestry checks for subagent subscriber eviction.\n\nAdd regression coverage for path-shape preservation and nested subagent subscribers pinning ancestor sessions.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: fix live sync-subagent streaming routing
Subagent text, reasoning, and tool events were routing to the parent
session during live streaming because the session used single global
part IDs and relied on deprecated data.parentToolCallId.
- Track per-subagent markdown/reasoning part IDs in Maps keyed by
parentToolCallId so parent and subagent text never share a part.
- Populate agentId -> toolCallId map from subagent.started events;
use event-level agentId for routing instead of deprecated field.
- Drop events with an unmapped agentId with a warning log rather than
silently routing them to the parent session.
- Add regression tests for markdown delta, reasoning delta, and tool
completion routing in subagent sessions.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: fix nested subagent routing for depth > 1
Both `onClientToolCallComplete` and `getSessionMessages` in copilotAgent.ts resolved the backing SDK session entry with a single `parseSubagentSessionUri` call, producing an intermediate subagent URI (e.g. `copilot:/root/subagent/tc1`) that is never a key in `_sessions`. This caused client-tool completions and message restores for depth-2+ subagents to be silently dropped.
Similarly, `_maybeEvictIdleSession` in agentService.ts targeted only the immediate parent when a nested subagent URI unsubscribed, leaving the root session's state cached in the state manager indefinitely (no one ever called eviction on it).
Fix both by walking the full subagent ancestry to the root before resolving the session entry or eviction target. Covered by new regression tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: skip slash command expansion in agent host sessions
Agent host sessions support prompt/skill slash commands natively, so
the CLI-friendly markdown reference ("Use the skill located at ...")
should not be appended. Wire a `shouldExpandPromptSlashCommand`
callback through `NewChatInputWidget` and have both the new-session
and new-chat-in-session panes opt out when the target provider matches
`ANY_AGENT_HOST_PROVIDER_RE`. Copilot CLI and other providers are
unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: base slash expansion on active session, not picker
_send() targets the current active session, which can lag behind the
workspace picker selection while trust approval or session-type
discovery is in flight. Read providerId from the active session so the
expansion decision matches the session that actually receives the
request.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the diagnostic warning for untitled-style chat session resources now that it is no longer needed. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* NES cursor jump: respect first model with tag CursorJump from /models
* extract cursor-jump model name selection into a method with hardcoded default
* comment cursor-jump model name selection priority