Fix local agent deselection
This commit is contained in:
1 parent
bd2463e0c3
commit
e8dc0b465e
4 files changed
+59
-7
No files matched your search
@@ -71,6 +71,19 @@ function childEnv(): NodeJS.ProcessEnv {
|
||||
|
||||
export type LocalAgentId = 'claude' | 'codex' | 'hermes';
|
||||
|
||||
/** Apply an authoritative bulk selection; single-agent connects remain additive. */
|
||||
export function syncLocalAgentSelection<T>(
|
||||
connected: Map<string, T>,
|
||||
selectedIds: string[],
|
||||
replace: boolean,
|
||||
): void {
|
||||
if (!replace) return;
|
||||
const selected = new Set(selectedIds);
|
||||
for (const id of connected.keys()) {
|
||||
if (!selected.has(id)) connected.delete(id);
|
||||
}
|
||||
}
|
||||
|
||||
interface AgentSpec {
|
||||
id: LocalAgentId;
|
||||
label: string;
|
||||
|
||||
Reference in new issue
Block a user