Skip to content

feat: add multi-agent support to dashboard frontend#5

Open
ttupper92618 wants to merge 1 commit into
mainfrom
feat/multi-agent-frontend
Open

feat: add multi-agent support to dashboard frontend#5
ttupper92618 wants to merge 1 commit into
mainfrom
feat/multi-agent-frontend

Conversation

@ttupper92618

Copy link
Copy Markdown
Contributor

Summary

  • AgentSelector component: dropdown in sidebar that fetches tenants/agents and lets users switch between agents (persisted via redux-persist)
  • uiSlice: adds selectedAgentId to persisted Redux state
  • dashboardApi.ts: parameterizes all 28 foxmemory RTK Query endpoints with optional agentId; adds getTenants and getAgents endpoints; scopes cache tags by agentId
  • FoxMemorySection, FoxMemoryAgentsView, FoxMemoryGraphView, ModelConfigSection: accept agentId prop, pass to RTK Query hooks and mutation calls
  • Sidebar: accepts children prop for rendering AgentSelector

When no agent is selected, all queries fall back to global (legacy) behavior.

Companion to #4 (backend proxy support).

Test plan

  • yarn typecheck:web passes (only pre-existing shadows warning)
  • AgentSelector renders in sidebar, shows agents from foxmemory-store
  • Selecting an agent re-fetches all foxmemory data scoped to that agent
  • "Default (all)" option returns to global view
  • Selected agent persists across page refreshes (redux-persist)
  • Graph explorer search mutations include agentId

🤖 Generated with Claude Code

- uiSlice: adds selectedAgentId to persisted Redux state
- types.ts: adds TenantRecord and AgentRecord interfaces
- dashboardApi.ts: parameterizes all foxmemory RTK Query endpoints with
  optional agentId; adds getTenants and getAgents endpoints; scopes cache
  tags by agentId
- AgentSelector: new component — dropdown that fetches tenants/agents and
  lets users switch between agents (persisted via redux-persist)
- App.tsx: renders AgentSelector in sidebar, passes selectedAgentId to
  FoxMemorySection and ModelConfigSection
- FoxMemorySection, FoxMemoryAgentsView, FoxMemoryGraphView,
  ModelConfigSection: accept agentId prop, pass to RTK Query hooks and
  mutation calls
- Sidebar: accepts children prop for rendering AgentSelector

When no agent is selected, all queries fall back to global (legacy)
behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 547a0ac2d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +44 to +45
if (agents.length === 0) {
return (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clear stale agent selection when no agents are returned

When agents.length === 0, this branch replaces the selector with static text and never calls onAgentChange(null). Since selectedAgentId is persisted and used to scope FoxMemory requests, a previously selected (now deleted/inaccessible) agent can leave the app permanently querying with an invalid agentId, and the user has no UI path back to Default (all) because the dropdown is hidden in this state.

Useful? React with 👍 / 👎.

Comment on lines +97 to 101
const effectiveAgentId = agentId ?? undefined;
const { data, isLoading } = useGetFoxmemoryGraphDataQuery(effectiveAgentId);
const [searchGraph, { data: richData, isLoading: richLoading, reset: resetRich }] = useSearchFoxmemoryGraphMutation();
const [searchMemories, { data: memoriesData, isLoading: memoriesLoading, reset: resetMemories }] = useSearchFoxmemoryMemoriesMutation();
const [selectedNode, setSelectedNode] = useState<FoxmemoryGraphNode | null>(null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset graph detail state when switching agents

This component now changes graph queries by agentId, but it keeps local selection/search state across agent switches. If a user changes agents while a node is selected, the details panel can continue showing richData/memory results from the previous agent until manually cleared, which mixes data scopes and presents stale relationships for the new graph context.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant