fix(team): preserve explicit launch defaults
This commit is contained in:
parent
499eca9eef
commit
01b8161f41
4 changed files with 69 additions and 19 deletions
|
|
@ -1,27 +1,27 @@
|
|||
{
|
||||
"version": "0.0.14",
|
||||
"sourceRef": "v0.0.14",
|
||||
"version": "0.0.15",
|
||||
"sourceRef": "v0.0.15",
|
||||
"sourceRepository": "777genius/agent_teams_orchestrator",
|
||||
"releaseRepository": "777genius/claude_agent_teams_ui",
|
||||
"releaseTag": "v1.2.0",
|
||||
"assets": {
|
||||
"darwin-arm64": {
|
||||
"file": "agent-teams-runtime-darwin-arm64-v0.0.14.tar.gz",
|
||||
"file": "agent-teams-runtime-darwin-arm64-v0.0.15.tar.gz",
|
||||
"archiveKind": "tar.gz",
|
||||
"binaryName": "claude-multimodel"
|
||||
},
|
||||
"darwin-x64": {
|
||||
"file": "agent-teams-runtime-darwin-x64-v0.0.14.tar.gz",
|
||||
"file": "agent-teams-runtime-darwin-x64-v0.0.15.tar.gz",
|
||||
"archiveKind": "tar.gz",
|
||||
"binaryName": "claude-multimodel"
|
||||
},
|
||||
"linux-x64": {
|
||||
"file": "agent-teams-runtime-linux-x64-v0.0.14.tar.gz",
|
||||
"file": "agent-teams-runtime-linux-x64-v0.0.15.tar.gz",
|
||||
"archiveKind": "tar.gz",
|
||||
"binaryName": "claude-multimodel"
|
||||
},
|
||||
"win32-x64": {
|
||||
"file": "agent-teams-runtime-win32-x64-v0.0.14.zip",
|
||||
"file": "agent-teams-runtime-win32-x64-v0.0.15.zip",
|
||||
"archiveKind": "zip",
|
||||
"binaryName": "claude-multimodel.exe"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1893,13 +1893,15 @@ async function handleLaunchTeam(
|
|||
|
||||
const resolvedProviderId = explicitProviderId ?? savedRequest.providerId ?? providerId;
|
||||
const effortValidation = parseOptionalTeamEffort(
|
||||
payload.effort ?? savedRequest.effort,
|
||||
Object.hasOwn(payload, 'effort') ? payload.effort : savedRequest.effort,
|
||||
resolvedProviderId
|
||||
);
|
||||
if (!effortValidation.valid) {
|
||||
return { success: false, error: effortValidation.error };
|
||||
}
|
||||
const fastModeValidation = parseOptionalTeamFastMode(payload.fastMode ?? savedRequest.fastMode);
|
||||
const fastModeValidation = parseOptionalTeamFastMode(
|
||||
Object.hasOwn(payload, 'fastMode') ? payload.fastMode : savedRequest.fastMode
|
||||
);
|
||||
if (!fastModeValidation.valid) {
|
||||
return { success: false, error: fastModeValidation.error };
|
||||
}
|
||||
|
|
@ -1963,20 +1965,16 @@ async function handleLaunchTeam(
|
|||
if (!launchProviderBackendValidation.valid) {
|
||||
return { success: false, error: launchProviderBackendValidation.error };
|
||||
}
|
||||
const rawLaunchEffort =
|
||||
payload.effort ??
|
||||
persistedMeta?.effort ??
|
||||
persistedMeta?.launchIdentity?.selectedEffort ??
|
||||
undefined;
|
||||
const rawLaunchEffort = Object.hasOwn(payload, 'effort')
|
||||
? payload.effort
|
||||
: (persistedMeta?.effort ?? persistedMeta?.launchIdentity?.selectedEffort ?? undefined);
|
||||
const effortValidation = parseOptionalTeamEffort(rawLaunchEffort, launchProviderId);
|
||||
if (!effortValidation.valid) {
|
||||
return { success: false, error: effortValidation.error };
|
||||
}
|
||||
const rawLaunchFastMode =
|
||||
payload.fastMode ??
|
||||
persistedMeta?.fastMode ??
|
||||
persistedMeta?.launchIdentity?.selectedFastMode ??
|
||||
undefined;
|
||||
const rawLaunchFastMode = Object.hasOwn(payload, 'fastMode')
|
||||
? payload.fastMode
|
||||
: (persistedMeta?.fastMode ?? persistedMeta?.launchIdentity?.selectedFastMode ?? undefined);
|
||||
const fastModeValidation = parseOptionalTeamFastMode(rawLaunchFastMode);
|
||||
if (!fastModeValidation.valid) {
|
||||
return { success: false, error: fastModeValidation.error };
|
||||
|
|
|
|||
|
|
@ -1677,7 +1677,7 @@ export const CreateTeamDialog = ({
|
|||
}
|
||||
}}
|
||||
>
|
||||
<DialogContent className="max-w-3xl">
|
||||
<DialogContent className="max-w-[52rem]">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-sm">{initialData ? 'Copy Team' : 'Create Team'}</DialogTitle>
|
||||
<DialogDescription className="text-xs">
|
||||
|
|
|
|||
|
|
@ -3063,6 +3063,58 @@ describe('ipc teams handlers', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it('treats explicit default effort in launch payload as clearing persisted lead effort', async () => {
|
||||
const claudeRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'ipc-launch-default-effort-'));
|
||||
setClaudeBasePathOverride(claudeRoot);
|
||||
try {
|
||||
const teamDir = path.join(claudeRoot, 'teams', 'anthropic-team');
|
||||
fs.mkdirSync(teamDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(teamDir, 'config.json'), JSON.stringify({ teamName: 'anthropic-team' }));
|
||||
fs.writeFileSync(
|
||||
path.join(teamDir, 'team.meta.json'),
|
||||
JSON.stringify({
|
||||
version: 1,
|
||||
displayName: 'Anthropic Team',
|
||||
cwd: '/Users/test/project',
|
||||
providerId: 'anthropic',
|
||||
model: 'claude-opus-4-6[1m]',
|
||||
effort: 'low',
|
||||
fastMode: 'on',
|
||||
launchIdentity: {
|
||||
selectedModel: 'claude-opus-4-6[1m]',
|
||||
selectedEffort: 'low',
|
||||
selectedFastMode: 'on',
|
||||
},
|
||||
createdAt: Date.now(),
|
||||
})
|
||||
);
|
||||
|
||||
const handler = handlers.get(TEAM_LAUNCH)!;
|
||||
const result = (await handler({ sender: { send: vi.fn() } } as never, {
|
||||
teamName: 'anthropic-team',
|
||||
cwd: os.tmpdir(),
|
||||
providerId: 'anthropic',
|
||||
model: 'claude-opus-4-6[1m]',
|
||||
effort: undefined,
|
||||
fastMode: 'inherit',
|
||||
})) as { success: boolean };
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
expect(provisioningService.launchTeam).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
teamName: 'anthropic-team',
|
||||
providerId: 'anthropic',
|
||||
model: 'claude-opus-4-6[1m]',
|
||||
effort: undefined,
|
||||
fastMode: 'inherit',
|
||||
}),
|
||||
expect.any(Function)
|
||||
);
|
||||
} finally {
|
||||
fs.rmSync(claudeRoot, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('handleReplaceMembers accepts members: []', async () => {
|
||||
const handler = handlers.get(TEAM_REPLACE_MEMBERS)!;
|
||||
const result = (await handler({} as never, 'my-team', {
|
||||
|
|
|
|||
Loading…
Reference in a new issue