- remove dead singlePaneEditorTitleAuxiliaryBarOrder const + void stmt
- remove unused ICommandService dependency from the base layout controller
(and its now-dead test-harness stub)
- update SINGLE_PANE_SCENARIOS.md + desktopSessionLayoutController.md for the
merged controller, transition-triggered R1, and the Toggle Details command
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge the single-pane detail/tab controllers into the layout controller,
add a dedicated Toggle Details command, refine R1 (transition-triggered
editor hide), default a created session to the Changes editor with the
detail closed, reveal the docked editor part for created sessions, and
remove the docked reveal-sync suppression mechanism.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Share startup session caching across local and remote agent hosts
Hoist the session-summary persistence layer from RemoteAgentHostSessionsProvider
into BaseAgentHostSessionsProvider so the local agent host also shows its
sessions immediately on Agents-window startup, before the in-process agent host
has started and the first listSessions() round-trip returns.
- Base now owns serialize/deserialize, _metaByRawId/_cacheDirty bookkeeping, and
_loadCachedSessions()/_persistCache(), gated behind an explicit
_enableSessionCachePersistence(storageKey) opt-in that subclasses call at the
end of their constructor (once identity fields needed by createAdapter are set).
- A _shouldTrackSessionCacheChanges() hook preserves the remote provider's
offline (_unpublished) gate.
- Remote provider drops the migrated code and just supplies its per-authority
key; local provider supplies the fixed key localAgentHost.cachedSessions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: link file references in responses
Teach Copilot Agent Host models to emit absolute-path Markdown links and resolve them at render time so streaming responses retain native link labels and remote filesystem routing.
Fixes#315183
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: link folder references in responses
Extend the Agent Host response-formatting prompt so existing workspace folders are linked consistently alongside files and symbols.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: refine workspace link instructions
Clarify folder and symbol link examples in the Agent Host response-formatting prompt.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Track tool calls that remain blocked for five minutes and report when they later complete, including blocker and tool source metadata.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Support line range syntax in Quick Open file paths
Extend the Quick Open file path syntax to accept a line range using a
hyphen (e.g. 'file.txt:20-40' or 'file.txt:20:3-40:5'). Pressing Enter
opens the file with the range selected. This mirrors the existing
markdown document link range syntax.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Preserve line/column range when terminal links fall back to Quick Open
The TerminalSearchLinkOpener reconstructs the search text from the parsed
link suffix but only re-emitted the start row/column, dropping any
rowEnd/colEnd. As a result, clicking a terminal link with a range (e.g.
'lines 20-40') fell back to Quick Open with only the start line. Emit the
range end using Quick Open's syntax so the range is selected.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Revert "Preserve line/column range when terminal links fall back to Quick Open"
This reverts commit 128a00ceac.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The streaming-markdown repair logic completed emphasis and codespans before
links, so an incomplete link nested in bold (e.g. `- **[text](file:///pa`)
had its `**` closed first and the link target was left broken, rendering as
raw text. The link-target detection also only matched `[` at start-of-line or
after whitespace, missing links that follow an emphasis marker.
Complete an incomplete link target before emphasis/codespan (the link is the
innermost unfinished construct), and allow `[` to follow `*`, `_`, or `~` in
hasLinkTextAndStartOfLinkTarget. This fixes bold/italic/strikethrough links in
paragraphs and lists.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add tailored tool-call rendering for built-in SDK tools
The agent host's copilotToolDisplay only emitted tailored invocation /
past-tense messages for a handful of tools; the rest (read_agent,
write_agent, list_agents, store_memory, web_search, etc.) fell back to
the generic "Using {tool}" / "Used {tool}" rendering in the client.
Give every built-in Copilot SDK tool a natural verb phrase:
- Agent coordination tools surface the target agent id, e.g.
"Reading agent math-helper" / "Wrote to agent math-helper".
- Arg-bearing tools surface their key argument (query, title, subject,
pattern, path).
- No-arg tools use a shared verb-phrase table instead of the generic
fallback.
- Register the previously-unhandled send_inbox and context_board
built-in tools.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Scope agent tool rendering to read/write/list agents; simplify generic fallback
Add tailored invocation/past-tense messages for the agent-coordination
tools we care about (read_agent, write_agent, list_agents) alongside the
existing task tool, and drop the broader set of built-in SDK tool cases
that were mostly unused and noisy.
Change the generic tool fallback from `Used "Tool Name"` to just the
display name for both the Copilot and Claude tool renderers.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Render tailored invocation message for agent-coordination tools
The list/read/write agent tools are auto-approved client tools that skip
the permission flow, so their invocation previously rendered the generic
"Running {displayName}…" fallback while completion showed the correct
past-tense message. Auto-ready just these tools so they surface a tailored
message, and collapse each to a single (past-tense) phrase since they are
fast.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Guard agent_id against non-string tool args
Address Copilot review feedback: agent_id is parsed from untrusted JSON,
so a truthy non-string value (e.g. 123) would pass the presence check and
throw inside appendEscapedMarkdownInlineCode. Extract a getAgentId helper
that only returns a non-empty string, and fall back to the generic phrase
otherwise.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Simplify
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the Claude agent's transport mode flips from native to proxy at
runtime (via a `claudeUseCopilotProxy` root-config change) and it has no
live proxy handle, proactively emit the AHP `auth/required` notification
so the connected client re-authenticates GitHub Copilot — instead of only
failing the next command lazily with `AHP_AUTH_REQUIRED`.
- IAgent gains an optional `onDidRequireAuth` event; AgentHostStateManager
gains `emitAuthRequired` (mirrors `emitProgress`), fired on the root
channel and forwarded to clients over the existing notification path.
- AgentSideEffects wires the agent event to the state manager.
- ClaudeAgent fires it on the native→proxy flip when no proxy handle
exists, and hardens `authenticate()` so an unchanged token still starts
the proxy when no live handle is present (closes a re-auth deadlock).
- Adds unit tests for the flip-emit and hardening behaviors.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* sessions: keep visible sessions subscribed so subagent chats stay live
Fixes the "Open Subagent" pill sometimes not resolving/opening until the
session is switched away and back.
A subagent is added to the parent session's chat catalog by the agent
host spontaneously (no client action), so it only reaches `cached.chats`
while the provider's session-state subscription is alive. That
subscription was governed by a 30s idle timer that only client-initiated
actions/queries refresh — client chat creations explicitly call
`_keepSessionStateAlive`, but a host-spawned subagent has no such hook.
Passively watching a long delegation could therefore let the timer
release the state listener mid-view, dropping the subagent's `chatAdded`;
the inline pill (rendered from the separately-subscribed chat content)
still showed but couldn't resolve to a tab until a re-subscribe.
Pin the state subscription of every on-screen session (driven by
`ISessionsService.visibleSessions`) so host-driven catalog changes keep
flowing while the session is visible; the idle timer still governs
off-screen sessions so the host can evict their restored state.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: address CCR feedback on visible-session pin
- Compare session resources with `isEqual` instead of `toString()`.
- Shorten the regression test's inline comment to a concise note.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: drive Open Subagent pill spinner from the subagent's own status
The inline "Open Subagent" pill showed a static icon while its subagent
was still running: its spinner was driven purely by the parent
`.chat-subagent-part`'s `chat-thinking-active` class, which reflects the
spawning tool call. That tool call completes as soon as the subagent is
dispatched, so the class (and the spinner) stopped early while the worker
kept running — even though the running-subagents chip above the composer
correctly showed it as active.
Toggle a `chat-subagent-running` class on the pill from the resolved
subagent chat's own `SessionStatus.InProgress` status (reusing the
`findSubagentChat` autorun that already resolves the title), and drive the
spinner/open-icon swap from it; keep `chat-thinking-active` as a CSS
fallback. Now the pill and the chip reflect the same live status.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: stub visibleSessions in the remote provider test (fix CI)
The visible-session pin autorun reads `ISessionsService.visibleSessions`
in the base provider constructor. The remote provider test's
`ISessionsService` mock only stubbed `activeSession`, so constructing the
provider threw. Stub `visibleSessions` there too, matching the local
provider test harness.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Grid/sizing: persist the logical editor width (excluding the docked panel) so the Sessions Part no longer shrinks by the panel width on every reload; clamp the stored docked width to its minimum and yield to the editor's minimum in narrow windows; keep the editor grid leaf visible when only the docked aux bar toggles.
Editor content inset: recompute on group maximize/restore so a maximized non-right group is not rendered under the docked panel, and re-layout the docked panel after the un-maximize resize.
Controllers: DetailPanelController shows Changes while the editor is maximized (agreeing with the D5 rule) and classifies editor types (file/empty-file -> Files, Changes -> Changes, Browser -> hidden, other -> preserve); the LayoutController no longer auto-reveals the Changes view on editor open in single-pane, so existing sessions keep the 'never auto-open' rule. Docs: fix stale method references in LAYOUT.md.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: single-pane detail-panel layout for the Agents window
Add an experimental `sessions.layout.singlePaneDetailPanel` setting (default off) that docks the detail panel (auxiliary bar) inside the editor part, so a single editor tab bar spans the editor content and the docked panel. Introduces a custom Changes (multi-diff) editor, Files/Browser tabs, and a "+" add-tab menu, with the Changes view and diff-stats split into standard vs single-pane subclasses chosen at startup.
The redesign uses a mode-based architecture: all single-pane parts, editors, serializers, actions and views are registered/gated behind the setting via `IAgentWorkbenchLayoutService.isSinglePaneLayoutEnabled` (the single source of truth), so the standard Agents-window layout is unchanged when the setting is off.
Core editor support: `EditorPart.setContentRightInset` (concrete class, not the public `IEditorPart` interface) insets only right-edge groups so the tab bar stays full-width; a generic `MenuId.EditorTabsBarAddTab` renders a core-owned "+" dropdown at the end of the tab strip.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: address CCR feedback on single-pane layout
- empty-file editor: register a touch Gesture target and handle Tap (iOS) in addition to click, and set `touch-action: manipulation` to avoid the tap delay.
- docked detail panel border: use `var(--vscode-strokeThickness)` instead of a hardcoded 1px.
- drop the internal `[Option A]` design-discussion marker from comments across workbench.ts / style.css / sessionConfig.ts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: fix use-before-init in DetailPanelController
The _activeEditorObs / _auxBarVisibleObs field initializers referenced the constructor-injected _editorService / _layoutService, which run before the parameter properties are assigned (TS2729, caught by tsc in CI but not by the tsgo typechecker). Move their initialization into the constructor body.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: update blocks-ci screenshot hashes
Refresh the committed blocks-ci-screenshots.md to the current CI-rendered image hashes (CodeEditor / InlineChatZoneWidget fixtures). These are bare editor-widget fixtures not affected by this PR's editor-tab changes; the drift is from the screenshot service re-render.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: make SessionChangesService resolvable without the workbench layout service
SessionChangesService is a DI singleton also instantiated in component fixtures / unit tests, which do not register IAgentWorkbenchLayoutService. Read the single-pane setting via IConfigurationService (available everywhere) instead, so resolving ISessionChangesService no longer fails with 'depends on layoutService which is NOT registered'. The layout service remains the single source of truth for contributions that run only in the real Agents window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: re-sync blocks-ci screenshot hashes
Update the committed hashes to the current CI render (the 6 CodeEditor / InlineChatZoneWidget fixtures shifted with the merged upstream editor changes).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the committed hashes to the current CI render (the 6 CodeEditor / InlineChatZoneWidget fixtures shifted with the merged upstream editor changes).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* WIP - initial implementation
* Extract code into a separate widget
* Animate width change
* Remove code that is no needed
* Add throttling to the animation
* Fix Agent Host telemetry gaps (#8209)
- trackEditSurvival: resolve ahp-chat sub-channel URIs to the parent
harness before extracting provider/id (gap #6)
- turnCompleted: add isSubagentSession so subagent activity is
measurable from turn events (gap #4)
- interactiveSessionProviderInvoked: add a harness property derived from
the remote session type so remote AH can be split by harness (gap #2)
- agents/requestSent: fire once per user message (including follow-ups),
add isNewChat, so it works as a per-message counter (gap #5)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Forward host telemetry IDs to local agent host (#8209)
The local agent host process computed machineId/sqmId/devDeviceId live on
every launch, which can diverge from the workbench's persisted, state-backed
identifiers and break per-user telemetry joins. Forward the main process's
already-resolved IDs via env vars and prefer them in the agent host telemetry
service, falling back to live computation when absent (e.g. remote/server AH).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Revert gap #4 (isSubagentSession on turnCompleted) and gap #5 (agents/requestSent)
turnCompleted never fires for subagent sessions (no matching turnStarted),
and after ahp-chat resolution the session is always the parent, so the
isSubagentSession field was always false. The agents/requestSent
session-create-only behavior was by design. Also restores the JSDoc on
parseRemoteAgentHostSessionTypeAuthority.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: restore system notifications within turns
Persist system-initiated notification boundaries and map unmarked SDK notifications back to response parts during history reconstruction. Coordinate boundary writes with replay so restored transcripts match live behavior.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: stream system notifications during active turns
Forward system notification response parts through the live turn observer, while avoiding duplicate progress when reconnecting to an active turn. Remove the unnecessary history/database workaround from the previous commit.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: simplify notification reconnect tracking
Use the active-turn response-part snapshot boundary instead of notification-specific counters when deciding which notifications still need live emission.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: render persistent system notification response parts
Add a native chat response content kind for system notifications so in-turn notifications use the same compact checked-row treatment as system-initiated requests without disappearing when later content arrives.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: restore Copilot system notifications
Use persisted assistant turn boundaries to restore in-turn notifications as response parts and idle wake-up notifications as system-initiated turns.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add a "bang command" feature: in any chat agent, a message starting with
`!` runs as a terminal command (via the existing agent-host terminal/shell
integration) instead of being sent to the model. The host emits a
transcript-only tool-call response for the command.
- Persist host-injected "local turns" (`!command` and `/rename`) so they
survive reload; fork/truncate/rename resolve them to the preceding concrete
SDK turn. Handled uniformly per-chat (default, peer and subagent chats).
- Refactor local command handling into a pluggable `LocalChatCommandRegistry`
with self-contained `AgentHostLocalCommands` dispatcher, extracting the
logic out of `AgentSideEffects`. Add `renameLocalCommand` and
`bangLocalCommand`.
- Extract shared helpers: `shellCommandExecution` (agent-agnostic shell exec
core) and `persistSessionMetadata`.
- Fix peer-chat truncation routing: `truncateSession` now takes the chat URI
and routes peer chats to their own backing session.
- Fix truncate no-op after forking into a second peer chat: `SessionDataService`
keyed every peer chat of a session onto one data dir/DB (chat id lives in the
URI authority, which `AgentSession.id` dropped), so a second fork's
`vacuumInto` failed with "output file already exists" and the forked chat
never inherited its turn event IDs. Key now includes the authority; both fork
copy sites also clear any stale target DB first.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SessionChangesService is a DI singleton also instantiated in component fixtures / unit tests, which do not register IAgentWorkbenchLayoutService. Read the single-pane setting via IConfigurationService (available everywhere) instead, so resolving ISessionChangesService no longer fails with 'depends on layoutService which is NOT registered'. The layout service remains the single source of truth for contributions that run only in the real Agents window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refresh the committed blocks-ci-screenshots.md to the current CI-rendered image hashes (CodeEditor / InlineChatZoneWidget fixtures). These are bare editor-widget fixtures not affected by this PR's editor-tab changes; the drift is from the screenshot service re-render.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skip chat view relayouts while the widget is hidden so dynamic-height rows are not measured against detached or display-none DOM.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the response render cursor, rather than stream word statistics, to detect content that has not yet been displayed. Add regression coverage for initial catch-up behavior.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: add ephemeral running-subagents chip above the chat input
Adds a status chip above the composer that appears only while the
currently-viewed chat has running (or attention-needing) subagents, so a
parallel background fan-out has a glanceable overview the transcript
can't provide once it scrolls.
- Shows "N running" with a spinner; escalates to "N need attention"
(warning color) when any subagent is blocked (SessionStatus.NeedsInput).
- Hidden entirely while idle, so it adds no chrome when nothing is running.
- Clicking opens a menu of the running subagents (attention-needing first,
with the current step surfaced from the chat description); selecting one
reveals its read-only tab.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: name the single running subagent in the status chip
When exactly one subagent is running, the chip now reads
"Running subagent: <title>" with its live progress inline; for more than
one it stays "N subagents running". The subagent title is read reactively
so it updates when the worker is auto-titled.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: drop needs-attention state from running-subagents chip
Show only running (InProgress) subagents. Removes the NeedsInput
"needs attention" escalation, its warning styling, and the attention-first
ordering; the chip is purely a running-workers indicator now.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: make input-part mounting idempotent (CCR feedback)
Key the banner/chip mounting off the desired final order
([subagentsNode, bannersNode, ...]) so `_ensureBannersMounted` is a true
no-op once the DOM has settled, instead of performing two insertBefore
mutations on every doLayout()/resize.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: update changes view file sections
Rename the external session files section to Other Files and align its rows with the main changes list. Update split sizing so CI and file changes cap to their content while Other Files takes remaining space, including a 140px empty file-changes minimum.
Add full Changes view component fixtures for the main split-view states.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: preserve changes view sash size
Fire the tree pane SplitView change event without a preferred size so relayout clamps constraints without forcing the File Changes pane to its maximum.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: mock lifecycle for changes view fixture
Register a no-op ILifecycleService so the full Changes view component fixture can instantiate ViewWelcomeController under the strict fixture instantiation service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The _activeEditorObs / _auxBarVisibleObs field initializers referenced the constructor-injected _editorService / _layoutService, which run before the parameter properties are assigned (TS2729, caught by tsc in CI but not by the tsgo typechecker). Move their initialization into the constructor body.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- empty-file editor: register a touch Gesture target and handle Tap (iOS) in addition to click, and set `touch-action: manipulation` to avoid the tap delay.
- docked detail panel border: use `var(--vscode-strokeThickness)` instead of a hardcoded 1px.
- drop the internal `[Option A]` design-discussion marker from comments across workbench.ts / style.css / sessionConfig.ts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: add setting to show empty default groups (Pinned, Chats) in the sessions list
Add `sessions.list.showEmptyDefaultGroups` (default true) to control whether the
empty Pinned and Chats default groups are shown in the sessions list. When disabled,
the always-visible empty sections are hidden until they contain sessions. The list
re-renders live when the setting changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: set APPLICATION scope on showEmptyDefaultGroups setting
Fixes the unused `ConfigurationScope` import (noUnusedLocals) and aligns the
setting scope with nearby Sessions settings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: use window scope for showEmptyDefaultGroups setting
Remove the APPLICATION scope (defaulting to WINDOW) and drop the now-unused
ConfigurationScope import.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add an experimental `sessions.layout.singlePaneDetailPanel` setting (default off) that docks the detail panel (auxiliary bar) inside the editor part, so a single editor tab bar spans the editor content and the docked panel. Introduces a custom Changes (multi-diff) editor, Files/Browser tabs, and a "+" add-tab menu, with the Changes view and diff-stats split into standard vs single-pane subclasses chosen at startup.
The redesign uses a mode-based architecture: all single-pane parts, editors, serializers, actions and views are registered/gated behind the setting via `IAgentWorkbenchLayoutService.isSinglePaneLayoutEnabled` (the single source of truth), so the standard Agents-window layout is unchanged when the setting is off.
Core editor support: `EditorPart.setContentRightInset` (concrete class, not the public `IEditorPart` interface) insets only right-edge groups so the tab bar stays full-width; a generic `MenuId.EditorTabsBarAddTab` renders a core-owned "+" dropdown at the end of the tab strip.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass the Copilot CLI session label through the Agents Window delete flow into the Git worktree removal confirmation so dirty worktree prompts show which session owns the worktree.\n\nFixes #324220\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Review changes (P1): add overlayPathIntoTree git primitive
Add `IAgentHostGitService.overlayPathIntoTree(base, path, source)` which
builds a new tree equal to `base` with a single repo-relative path replaced
by (or removed to match) the content in `source`, using a throwaway
GIT_INDEX_FILE so the user's real index is untouched.
This is the file-level building block for the upcoming reviewed-ref based
"review changes" feature: mark reviewed = overlay from the working-tree
snapshot; unmark = overlay from the baseline tree.
Includes the `parseSingleLsTreeEntry` helper and real-git integration tests
covering modified, added, and removed paths, plus the non-git no-op case.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Review changes (P2): extract shared Branch Changes baseline resolver
Extract the Branch Changes baseline resolution so the changeset service and
the upcoming review service cannot drift on which baseline they use:
- Add `IAgentHostGitService.resolveBranchBaselineCommit(workingDirectory,
baseBranch?)` which resolves the merge-base commit-ish the Branch Changes
diff is anchored on (origin/<base> preference, HEAD fallback, empty-tree
fallback). `computeSessionFileDiffs` now delegates to the same private
`_resolveBranchMergeBaseCommit` helper -- pure refactor, no behavior change.
- Add the pure `resolveDiffBaseBranchName(persisted, gitState)` helper for the
base-branch-name precedence and use it from the changeset service.
Adds unit tests for both pure helpers and real-git integration tests for
`resolveBranchBaselineCommit`; existing `computeSessionFileDiffs` tests still
pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Review changes (P3): add reviewed-ref review service core
Add `IAgentHostReviewService` and its node implementation, tracking which
files in a session's Branch Changes the user has reviewed as a session-private
synthetic git ref (`refs/agents/<sid>/reviewed`) whose tree snapshots the
reviewed content.
- `markFileReviewed` overlays the file's current working-tree content into the
reviewed tree; `unmarkFileReviewed` resets it to the baseline content. Each
action appends a parent-chained commit (first parent = baseline commit) and
advances the ref; no-op mutations are skipped so the chain doesn't grow.
- `getReviewedPaths` derives review status from git trees: reviewed = Branch
Changes files whose reviewed-tree content matches the working tree. Editing a
reviewed file therefore auto-unreviews it.
- Mutations/reads are serialized per session; the reviewed ref is deleted on
session data disposal. Operations no-op when not in a git work tree (a future
milestone adds the non-git DB fallback).
Also adds the `diffTreePaths` git primitive used to compute review status, and
wires the service into the agent-host node and server entry points. Covered by
real-git integration tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Review changes (P4): wire the review operation handler + provider
Add `AgentHostReviewFileOperationHandler` (mark/unmark, one instance per
direction) and `AgentHostReviewOperationContribution`, advertising the
`mark-as-reviewed` / `mark-as-unreviewed` resource-scoped operations for the
Branch Changes changeset and delegating to `IAgentHostReviewService`.
The handler resolves the session's working directory and base branch (via the
shared `resolveDiffBaseBranchName`) so review status is keyed on the same
baseline the Branch Changes diff uses.
Plumb the review service into `AgentService`'s inner DI (mirroring the
checkpoint service, defaulting to `NULL_REVIEW_SERVICE`) and register the
contribution. Covered by handler unit tests using a fake review service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Review changes (P5): surface per-file review status on the Branch changeset
Populate `ChangesetFile._meta.reviewed` for the Branch Changes changeset so the
client can render reviewed/unreviewed affordances per file:
- Inject `IAgentHostReviewService` into the changeset service and, when
publishing the Branch changeset, look up the reviewed repo-relative paths and
set `_meta.reviewed` per file (keyed by the file id's repo-relative path).
- Extract the base-branch resolution into a shared `_resolveBranchBaseBranch`
helper reused by the diff computation and the review-status lookup.
- After a mark/unmark, the operation handler triggers `refreshBranchChangeset`
so the updated `_meta.reviewed` is republished (the working tree is unchanged
by a review toggle, so no file-watcher event would otherwise fire).
Adds a reusable `createNoopChangesetService` test helper, updates the handler
test to assert the refresh, and threads the new dependency through existing
agent-host test fakes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Review changes (P6): copy the reviewed ref on session fork
Add `IAgentHostReviewService.copyReviewedRef(source, target, workingDirectory)`
which points the forked session's reviewed ref at the same commit as the
source's, so a fork starts with the parent's review progress. No-op when the
source has no reviewed ref or the directory is not a git work tree.
Wire it into the Copilot session-fork path (best-effort, after the forked
session's database is copied), and inject the review service into CopilotAgent.
Covered by a real-git integration test.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* More refactoring/cleanup
* More changes to get things working
* Fix the actions in the toolbar
* Collapse multi-file diff item that is reviewed
* Remove precondition
* Fix tests + pull request feedback
* Fix hygiene
* Skip integration tests for now
* Make the UI snappier
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>