fix(agents): use isPrimaryMode consistently across all agent pickers (#1713)
* fix(agents): use isPrimaryMode filter for agent picker Fix #1527: agent picker filtered by mode !== 'subagent' which missed agents with unexpected mode values. Now uses isPrimaryMode() which only includes 'primary', 'all', undefined, and null — the semantically correct set of agents that should appear in the picker. * fix(agents): use isPrimaryMode consistently across all agent pickers Updated AgentSelector.tsx to use isPrimaryMode instead of mode !== 'subagent'. Removed duplicate isPrimaryMode definition from useConfigStore.ts and imported the shared helper from mobileControlsUtils. --------- Co-authored-by: Leonid Skorobogatyy <bash@opencode.itc.local>
This commit is contained in:
committed by
GitHub
co-authored by
Leonid Skorobogatyy
parent
ac0f173655
commit
6e68015389
@@ -7,6 +7,7 @@ import { scopeMatches, subscribeToConfigChanges } from "@/lib/configSync";
|
||||
import type { ModelMetadata } from "@/types";
|
||||
import { getSafeStorage } from "./utils/safeStorage";
|
||||
import { filterVisibleAgents } from "./useAgentsStore";
|
||||
import { isPrimaryMode } from "@/components/chat/mobileControlsUtils";
|
||||
import { useSessionUIStore } from "@/sync/session-ui-store";
|
||||
import { useSelectionStore } from "@/sync/selection-store";
|
||||
import { getRegisteredRuntimeAPIs } from "@/contexts/runtimeAPIRegistry";
|
||||
@@ -179,8 +180,6 @@ const parseModelString = (modelString: string): { providerId: string; modelId: s
|
||||
|
||||
const normalizeProviderId = (value: string) => value?.toLowerCase?.() ?? '';
|
||||
|
||||
const isPrimaryMode = (mode?: string) => mode === "primary" || mode === "all" || mode === undefined || mode === null;
|
||||
|
||||
type ProviderModel = Provider["models"][string];
|
||||
type ProviderWithModelList = Omit<Provider, "models"> & { models: ProviderModel[] };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user