[pull] main from microsoft:main#1442
Merged
Merged
Conversation
* Claude: resume cross-window sessions from disk on first send
Repro: open a Claude session in window A, then in window B (or after
an agent-host restart) send a message to that session.
Before: sendMessage hit the 'session not in _sessions and not
provisional' branch and threw 'Cannot send to unknown session: <id>',
because materialize was only ever reachable via the createSession
provisional path.
After: that branch routes through new _resumeSession(sessionId, uri),
which mirrors CopilotAgent._resumeSession — reads workingDirectory
from sdkService.getSessionInfo, model + permissionMode from the
metadata overlay, synthesises an IClaudeMaterializeProvisional, and
calls materializer.materialize(..., 'resume') so the SDK reloads the
existing transcript instead of minting a fresh sessionId.
ClaudeMaterializer.materialize gains an optional startMode parameter
('fresh' | 'resume', default 'fresh') that selects Options.sessionId
vs Options.resume in _buildOptions. The existing fresh-startup call
sites are unchanged.
Tests: existing 'disposing a provisional session never calls SDK
startup' assertion still passes — the new error wording 'Cannot
resume unknown session' still matches /unknown session/i, and
_resumeSession throws before startup when the fake SDK has no
session record.
* Test: cross-window Claude session resume + missing-SDK-record
Two unit tests for the _resumeSession path added in the previous
commit:
1. Disk-only happy path: stage an entry in sdk.sessionList that was
never createSession'd on this agent, call sendMessage on its URI,
and pin that the SDK is started with Options.resume = sessionId
(not Options.sessionId), the materialize event fires with the
right cwd, and the session lands in _sessions.
2. Failure path: sdk.sessionList is empty, sendMessage on an unknown
URI throws /unknown session/i and does NOT spawn the SDK
subprocess (startupCallCount stays 0).
* Claude resume: resolve git project from cwd, mirror createSession
_resumeSession was passing project: undefined into both the
provisional record and the materialize event. The fresh-session path
in createSession resolves project metadata from the workingDirectory
via projectFromCopilotContext + IAgentHostGitService; resume should
do the same so the materialize event consumers see the same project
shape regardless of which window opened the session.
Best-effort: a resolution failure (no repo, git CLI missing) downgrades
to undefined rather than blocking the resume.
* Claude: don't clobber resumed permissionMode on turn 2
Copilot PR review on cross-window resume PR caught a real regression:
the materialized-session branch in sendMessage was unconditionally
calling:
session.setPermissionMode(_readSessionPermissionMode(uri) ?? 'default')
before yielding every non-first turn. For a session resurfaced via
_resumeSession, AgentService never registers the per-session schema
(that side-effect only fires for createSession-spawned sessions), so
_readSessionPermissionMode returns undefined and the fallback
silently downgrades a plan-mode session to default mid-conversation.
Fix: only forward setPermissionMode when the live config carries a
defined value. The session's seeded bijective state (set via
seedBijectiveState at resume time) stays authoritative when there is
no live override.
Test: stage the per-session DB with claude.permissionMode='plan',
resume, send two turns, assert no 'default' ever lands at the SDK
(recordedModes stays ['plan']). createTestContext gains an optional
{ database } override so the test can pre-populate the overlay
without rebuilding the service collection inline.
Comments out the registration of WorktreeCreatedTaskDispatcher and removes its import to work around a bug. This is a stopgap until the underlying issue can be investigated and fixed. - Comments out the registerWorkbenchContribution2 call for WorktreeCreatedTaskDispatcher - Removes the now-unused import (Commit message generated by Copilot)
fix: focus input on widget click outside textarea and action bar
* fix: enhance request validation for CopilotCLI session type * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* provideChatSessionCustomizations for sessionResource * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * update * update * fix fixtures * update * update * AgentCustomizationItemProvider: remember _sessionCustomizations per session * update * update --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
feat: add new compact codicons for enhanced UI elements Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
…ts (#317256) * fix: update changeset labels and descriptions to reflect branch changes * Update tests * feat: implement per-turn changeset recompute logic and associated tests * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * updates * Refactor comments in agentService tests to clarify handling of git state in transient sessions * Improve teardown logic in sessionDiffs integration test to handle Windows file locks --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…to reveal the newly forked session instead of the SessionManagementService reacting to it (#317279) Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )