fix(agent-selector): read agents from active-directory config store
AgentSelector used useAgentsStore which is only warm after a chat session loads, so the todo send dialog opened from the project context panel showed an empty agent list. Prefer useConfigStore.agents (the same source ModelControls uses in chat) with useAgentsStore as fallback, and load both on mount when neither is populated. Also set the primary-mode filter on the scheduled task editor agent selector to keep its options consistent with the other flows.
This commit is contained in:
@@ -12,6 +12,7 @@ import { toast } from '@/components/ui';
|
||||
import { RiAddLine, RiCloseLine, RiCalendarLine, RiArrowLeftSLine, RiArrowRightSLine, RiArrowDownSLine } from '@remixicon/react';
|
||||
import { ModelSelector } from '@/components/sections/agents/ModelSelector';
|
||||
import { AgentSelector } from '@/components/sections/commands/AgentSelector';
|
||||
import { isPrimaryMode } from '@/components/chat/mobileControlsUtils';
|
||||
import { CommandAutocomplete, type CommandAutocompleteHandle } from '@/components/chat/CommandAutocomplete';
|
||||
import { FileMentionAutocomplete, type FileMentionHandle } from '@/components/chat/FileMentionAutocomplete';
|
||||
import { useConfigStore } from '@/stores/useConfigStore';
|
||||
@@ -1308,6 +1309,7 @@ export function ScheduledTaskEditorDialog(props: {
|
||||
<FieldLabel>Agent</FieldLabel>
|
||||
<AgentSelector
|
||||
agentName={draft.execution.agent}
|
||||
filter={(agent) => isPrimaryMode(agent.mode)}
|
||||
onChange={(agent) => setDraft((prev) => ({
|
||||
...prev,
|
||||
execution: {
|
||||
|
||||
Reference in New Issue
Block a user