* feat: add getFinalResponse method to IResponse and implement CopyFinalResponseAction
* feat: add context key for response view model in ChatListWidget
* Unify agentHost server-side dispatch: remove IProtocolSideEffectHandler
Eliminate the IProtocolSideEffectHandler interface and make
ProtocolServerHandler talk to IAgentService directly. This removes
the duplicate adapter layer between the WebSocket protocol server
and the real service implementation.
Changes:
- ProtocolServerHandler now takes IAgentService + SessionStateManager +
IProtocolServerConfig instead of IProtocolSideEffectHandler
- Deleted ~40-line inline adapter in agentHostMain.ts
- agentHostServerMain.ts now uses AgentService instead of manually
wiring SessionStateManager + AgentSideEffects
- Removed implements IProtocolSideEffectHandler from AgentSideEffects
- Removed dead methods from AgentSideEffects that were only needed
by the deleted interface (handleCreateSession, handleDisposeSession,
handleListSessions, handleGetResourceMetadata, handleAuthenticate,
getDefaultDirectory)
- Type conversions (URI<->string, IAgentSessionMetadata<->ISessionSummary)
now happen at the protocol boundary in ProtocolServerHandler
- Fixed dispatchAction double-dispatch: WS path previously dispatched
to stateManager AND called handleAction (which dispatched again)
- Extension methods (getResourceMetadata, authenticate, etc.) now call
IAgentService directly instead of untyped fallbacks
(Written by Copilot)
* comments
Co-authored-by: Copilot <copilot@github.com>
* Simplify further
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
* Use URI for workingDirectory across agent host layer
- Change IAgentCreateSessionConfig.workingDirectory and
IAgentSessionMetadata.workingDirectory from string to URI
- Convert file paths to URI at SDK boundary (CopilotAgent)
- Convert protocol strings to agenthost:// URIs at protocol client boundary
- Convert agenthost:// URIs back to file:// at protocol client on outgoing
- Update resolveWorkingDirectory callback to return URI
- Use extUriBiasedIgnorePathCase.isEqualOrParent for path containment
- Use generateUuid() instead of crypto.randomUUID()
- Add CopilotAgentSession tests and SessionWrapperFactory pattern
- Register all event subscription disposables properly
(Written by Copilot)
* Tweak
* Fix test
* refactor: remove unused import and update session status check in SessionsManagementService
* refactor: remove public getGitHubContext method and change its visibility to private in SessionsManagementService
* refactor: remove getGitHubContextForSession method and its fallback logic in SessionsManagementService
* refactor: replace pullRequest with gitHubInfo in session data structures and related logic
* refactor: rename ISessionGitHubInfo to IGitHubInfo and update references across session data structures
* refactor: update GitHub info structure to encapsulate pull request details
* refactor: update session management to utilize gitHubInfo for pull request details
* refactor: simplify file URI resolution in CodeReviewService and remove unused method from SessionsManagementService
* refactor: remove unused getSessionRepositoryUri method and related logic from SessionsManagementService
* refactor: update session type constants to use string literals in sessionTypes and sessionsManagementService
* refactor: update pull request handling to utilize gitHubInfo in ChangesViewPane
* refactor: replace AgentSessionProviders with session type constants across sessions layer
Replace direct imports of AgentSessionProviders enum from the workbench
agent sessions layer with CopilotCLISessionType/CopilotCloudSessionType
constants from the sessions layer's own sessionTypes module.
Simplify workspaceFolderManagement to use session workspace data instead
of provider-specific branching. Remove fileTreeView component.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: remove agent sessions dependencies from changes and mode picker
- changesTitleBarWidget: use ISessionsManagementService instead of
IAgentSessionsService for session lookup and change events
- changesView: use sessionManagementService.onDidChangeSessions signal
- modePicker: replace AgentSessionProviders with CopilotCLISessionType
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: add missing gitHubInfo to mock session in codeReviewService tests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix compilation
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: streamline session management in SessionsTitleBarWidget and add Show Sessions Picker action
* feat: add Show Sessions Picker action and refactor session actions
* feat: enhance session visibility by including active session in filtered list
* fix: ensure active session is included in filtered list by matching sessionId
* fix: use sessionId instead of URI toString for picked state comparison
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: reuse SessionItemContextMenuId for title bar context menu
Use the same menu ID and context key overlays as the sessions list
view instead of hardcoding actions, ensuring consistency.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Enable test/test-integration scripts to take file.test.ts arguments
The agent likes to use them this way, when it doesn't read the skill
Co-authored-by: Copilot <copilot@github.com>
* And this
* Fixes
* update
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
* Rename sandbox setting to chat.agent.sandbox (#303421)
Rename the top-level sandbox setting from `chat.tools.terminal.sandbox.enabled`
to `chat.agent.sandbox` to reflect that sandboxing is a general agent concept,
not terminal-specific.
- Update setting ID value to `chat.agent.sandbox`
- Update description to be more general
- Deprecate old `chat.tools.terminal.sandbox.enabled` setting
- Update telemetry event name
Fixes#303421
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* updating terminal sandbox to agent sandbox
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* updating tests
* sandbox dependencies check for linux
* sandbox dependencies check for linux
* review comment
* Injecting sandboxhelperservice for web
The terminalEditorActive context key was being incorrectly set to false
when a terminal in the panel received focus, even though the active
editor was still a terminal editor. This happened because
TerminalService listened to onDidChangeActiveInstance and set the key
based on the active terminal instance's location rather than whether the
active editor is a terminal editor.
Remove the duplicate terminalEditorActive management from
TerminalService since TerminalEditorService already correctly manages
this context key via onDidActiveEditorChange, which checks whether the
active editor is a TerminalEditorInput.
Closes#182979
* refactor: update session cache to use IChatData and simplify session handling
* feat: add setTitle and setStatus methods to CopilotCLISession and RemoteNewSession
* feat: implement chat ID replacement and handling for session updates
* refactor: remove chat ID replacement logic and related methods from session management
* refactor: streamline session handling by removing resource swap logic and enhancing session cache management
* feat: implement session commit event and related interfaces for chat sessions
* refactor: enhance session management by implementing cache wait logic for committed sessions
* refactor: improve chat session handling by adding immediate group model updates for new chats
* refactor: simplify chat handling by removing immediate group model updates for temporary chats
* refactor: enhance Copilot session handling by adding resource management and improving session cache updates
* refactor: streamline resource handling in CopilotCLISession and RemoteNewSession classes
* refactor: add support for session replacement events in session management
* refactor: add internal documentation for session replacement events in sessions provider
* refactor: improve session replacement handling by using async/await for better readability
* refactor: simplify session replacement handling by removing unnecessary asynchronous wrapper and improving cache management
* refactor: enhance session management by updating active session on provider session replacement
* refactor: update session replacement event properties for clarity
* refactor: add updateWorkspace method to CopilotCLISession and RemoteNewSession for improved workspace management
* refactor: inline replace session event type and fix session cache update
- Remove IChatReplaceSessionEvent interface, inline the type as
{ from: IChatData; to: IChatData } in provider and service interfaces
- Restore setActiveSession call in sendRequest after provider returns
- Fix _refreshSessionCache to properly narrow existing cache entries
by instanceof (AgentSessionAdapter vs temp sessions) for update calls
- Restore _currentNewSession guard in removal loop to prevent firing
removed event for the in-flight temp session
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: restore setActiveSession call after sendRequest completes
After awaiting sendRequest (which resolves with the committed session), explicitly call setActiveSession so the committed session is always set as active. The onDidReplaceSession handler also sets it, but having it here as well ensures correctness when the handler fires before the group model is updated.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: sync temp session data from agent session and guard active session replacement
Update CopilotCLISession.update() to propagate workspace, title, status, updatedAt, changes, and description from the agent session. Add mutable description and changes observables. Restore instanceof guard in removal loop to prevent premature cleanup of temp sessions. Only replace active session in onDidReplaceSession when the replaced session was actually active.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: dispose temp session and fire removal event on commit/error
Dispose the CopilotCLISession/RemoteNewSession temp session and emit
an onDidChangeSessions removal delta when the temp is replaced by the
committed adapter or when an error occurs. This prevents disposable
leaks and lets consumers (e.g. SessionsManagementService) clean up
group-model/cache state for the removed chat.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add argument parsing, suite filtering, and grep support to integration test scripts
- Add --run, --runGlob, --grep, --suite, and --help argument parsing
- --suite selects extension host test suites (comma-separated, glob patterns)
- --grep forwards test name filter to all runners via MOCHA_GREP env var
- Validate --suite filter matches at least one known suite
- Add MOCHA_GREP support to testrunner.js, CSS and HTML test runners
- Seed user settings to suppress dock bounce notifications
- Always apply *.integrationTest.js glob for node.js tests
- Add integration-tests skill documentation
* Address Copilot review feedback
- Quote cd $ROOT, rm -rf $VSCODEUSERDATADIR, rmdir %VSCODEUSERDATADIR%
- Quote --runGlob pattern to prevent premature glob expansion
- Use GREP_ARGS array for safe grep forwarding in .sh
- Use conditional call with proper quoting for grep in .bat
- Deduplicate suite list into KNOWN_SUITES variable
- Remove unused EXTRA_ARGS and ARGS variables from .bat
* Fix Windows CI: remove unnecessary enabledelayedexpansion
The original script used plain 'setlocal'. Adding 'enabledelayedexpansion'
may affect path resolution behavior on Windows CI. Since no delayed
expansion (\!var\!) syntax is used, revert to the original 'setlocal'.
* Fix Windows CI: capture %~dp0 before call :label corrupts it
In Windows batch, 'call :label' can change what %~dp0 resolves to.
Our should_run_suite subroutine uses 'call :should_run_suite', which
caused %~dp0 to resolve to the wrong directory for extension paths
that appear after the subroutine call. Capture the script directory
once at startup into %SCRIPT_DIR% and use it everywhere.