Skip to content

Commit c6748eb

Browse files
committed
fix: preserve legacy changeset defaults
1 parent b97aebc commit c6748eb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎patches/copilot-agenthost-session-changes.diff‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
import { supportsAgentHostArtifactRemoval } from '../../../../../../platform/agentHost/common/meta/agentHostArtifactRemovalMeta.js';
1212
import { observableFromSubscription } from '../../../../../../platform/agentHost/common/state/agentSubscription.js';
1313
import { Changeset, ChangesetState, ChangesetStatus, ChatOriginKind, ChatState, DEFAULT_CHAT_ID, getSessionChatResource, getSessionRelatedPullRequestUrls, isSubagentChatUri, parseChatUri, readSessionFolderGitHubState, readSessionGitHubState, SessionState, SessionSummaryMeta, StateComponents } from '../../../../../../platform/agentHost/common/state/sessionState.js';
14-
@@ -571,12 +572,13 @@
14+
@@ -571,12 +572,14 @@
1515
const session = sessionState.read(reader);
1616
const resolvedCatalogue = resolveChatChangesetCatalogue(chat.toString(), chatState.read(reader)?.changesets, session?.changesets, session?.defaultChat);
1717
const selectableEntries = resolvedCatalogue?.filter(({ changeset }) => !changeset.uriTemplate.includes('{'));
1818
- const selectedChangeset = selectDefaultChangeset(selectableEntries?.map(({ changeset }) => changeset), currentResolution.defaultChangesetKind);
19-
+ const defaultChangesetKind = currentResolution.defaultChangesetKind ?? (session?.config?.values[SessionConfigKey.Isolation] === 'worktree' ? ChangesetKind.Branch : ChangesetKind.Session);
19+
+ const isolation = session?.config?.values[SessionConfigKey.Isolation];
20+
+ const defaultChangesetKind = currentResolution.defaultChangesetKind ?? (isolation === 'folder' ? ChangesetKind.Session : isolation === 'worktree' ? ChangesetKind.Branch : undefined);
2021
+ const selectedChangeset = selectDefaultChangeset(selectableEntries?.map(({ changeset }) => changeset), defaultChangesetKind);
2122
const selectedEntry = selectableEntries?.find(({ changeset }) => changeset === selectedChangeset);
2223
return resolveAgentHostChangeset(

0 commit comments

Comments
 (0)