fix(team): preserve worktree isolation in edit snapshots

This commit is contained in:
777genius 2026-04-21 22:47:19 +03:00
parent 708e1c3bf2
commit 94b97c4930
2 changed files with 33 additions and 0 deletions

View file

@ -138,6 +138,7 @@ function normalizeEditableMemberSnapshot(member: {
providerId?: TeamProviderId;
model?: string;
effort?: EffortLevel;
isolation?: 'worktree';
} | null {
if (member.removedAt) {
return null;

View file

@ -208,4 +208,36 @@ describe('getMembersRequiringRuntimeRestart', () => {
expect(refreshed).toBe(base);
});
it('keeps worktree isolation in the edit source snapshot', () => {
const sharedWorkspace = buildEditTeamSourceSnapshot({
name: 'Team A',
description: 'desc',
color: 'blue',
members: [
{
name: 'alice',
role: 'Reviewer',
} as any,
],
});
const isolatedWorkspace = buildEditTeamSourceSnapshot({
name: 'Team A',
description: 'desc',
color: 'blue',
members: [
{
name: 'alice',
role: 'Reviewer',
isolation: 'worktree',
} as any,
],
});
expect(isolatedWorkspace).not.toBe(sharedWorkspace);
expect(JSON.parse(isolatedWorkspace).members[0]).toMatchObject({
isolation: 'worktree',
});
});
});