-
Notifications
You must be signed in to change notification settings - Fork 181
Resolve merge conflict in pull request 185 #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Resolved conflicts in ModSidebar.tsx: Keep admin route handling logic - Resolved conflicts in AgentSetupPage.tsx: Combine admin mode functionality with i18n support - Resolved conflicts in NetworkInfoCard.tsx: Keep useMemo import with i18n support
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR resolves a merge conflict from pull request 185 and implements a comprehensive admin dashboard feature for the OpenAgents Studio application. The changes introduce admin-only routes, authentication mechanisms, and management interfaces for network administration.
Key Changes
- Admin dashboard with dedicated routes, authentication, and UI components
- Separation of admin-only features (LLM_LOGS and SERVICE_AGENTS) from regular user access
- Admin login flow integrated into the agent setup page with password-based authentication
- New admin-specific pages for transport configuration, connection guides, and network management
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| studio/src/utils/moduleUtils.ts | Removed LLM_LOGS and SERVICE_AGENTS from always-visible routes, making them admin-only |
| studio/src/types/plugins.ts | Added ADMIN enum value for admin plugin |
| studio/src/styles/firebase.css | Added admin login button styles |
| studio/src/router/RouteGuard.tsx | Added special handling for admin routes to bypass standard route checks |
| studio/src/pages/profile/components/NetworkInfoCard.tsx | Added uptime display with 3 decimal formatting |
| studio/src/pages/admin/TransportConfig.tsx | New component for managing network transport configurations (HTTP, gRPC, WebSocket) |
| studio/src/pages/admin/ConnectionGuide.tsx | New component providing connection examples for different clients and protocols |
| studio/src/pages/admin/AdminSidebar.tsx | Dedicated admin sidebar navigation component |
| studio/src/pages/admin/AdminMainPage.tsx | Main routing component for admin pages |
| studio/src/pages/admin/AdminDashboard.tsx | Admin dashboard with network statistics and quick actions |
| studio/src/pages/AgentSetupPage.tsx | Enhanced with admin login mode, separate from regular group selection |
| studio/src/pages/AdminLoginPage.tsx | Dedicated admin login page component |
| studio/src/config/routeConfig.ts | Added admin routes and Shield icon, made LLM_LOGS and SERVICE_AGENTS non-visible |
| studio/src/components/layout/SidebarContent.tsx | Added AdminSidebar routing |
| studio/src/components/layout/RootLayout.tsx | Hide ModSidebar on admin routes |
| studio/src/components/layout/ModSidebar.tsx | Dynamic admin route visibility based on user permissions |
| studio/src/components/auth/LoginView.tsx | Added admin login button with group configuration detection |
| studio/src/components/auth/AdminRouteGuard.tsx | New guard component to protect admin routes |
| examples/workspace_test.yaml | Updated admin group configuration with corrected password hash |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {/* Debug info - remove in production */} | ||
| {process.env.NODE_ENV === 'development' && ( | ||
| <div style={{ fontSize: '10px', color: 'gray', marginTop: '10px' }}> | ||
| Debug: showAdminButton={String(showAdminButton)}, isLoadingGroupConfig={String(isLoadingGroupConfig)} | ||
| </div> | ||
| )} |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug information is being rendered in the DOM. The comment says "remove in production" but this debug div should be removed entirely rather than conditionally shown based on NODE_ENV.
| {/* Debug info - remove in production */} | |
| {process.env.NODE_ENV === 'development' && ( | |
| <div style={{ fontSize: '10px', color: 'gray', marginTop: '10px' }}> | |
| Debug: showAdminButton={String(showAdminButton)}, isLoadingGroupConfig={String(isLoadingGroupConfig)} | |
| </div> | |
| )} |
| } | ||
|
|
||
| // TODO: Call API to update transport status | ||
| toast.info(`Transport ${action} requested (not implemented yet)`); |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toast message says "not implemented yet" but should provide more context about what action was requested. Consider including the transport type or action details in the message.
| toast.info(`Transport ${action} requested (not implemented yet)`); | |
| toast.info(`${transport.type.toUpperCase()} transport ${action} requested (not implemented yet)`); |
| if (currentTransport.type === "http") { | ||
| return `from openagents import AgentRunner | ||
| runner = AgentRunner(agent_id="my-agent") | ||
| await runner.async_start(host="${host}", port=${port})`; | ||
| } else if (currentTransport.type === "grpc") { | ||
| return `from openagents import AgentRunner | ||
| runner = AgentRunner(agent_id="my-agent") | ||
| await runner.async_start(host="${host}", port=${port})`; | ||
| } else { | ||
| return `from openagents import AgentRunner | ||
| runner = AgentRunner(agent_id="my-agent") | ||
| await runner.async_start(host="${host}", port=${port})`; | ||
| } | ||
| }; | ||
|
|
||
| // Generate Python code example with authentication | ||
| const generatePythonCodeWithAuth = (): string => { | ||
| if (!currentTransport) return ""; | ||
|
|
||
| const host = currentTransport.host === "0.0.0.0" ? "localhost" : currentTransport.host; | ||
| const port = currentTransport.port; | ||
| const group = data.groups.length > 0 ? data.groups[0] : "default"; | ||
|
|
||
| return `from openagents import AgentRunner | ||
| from openagents.utils.password_utils import hash_password | ||
| runner = AgentRunner( | ||
| agent_id="my-agent", | ||
| agent_group="${group}", | ||
| password="your_password_here" | ||
| ) | ||
| await runner.async_start(host="${host}", port=${port})`; | ||
| }; | ||
|
|
||
| // Generate LangChain integration code | ||
| const generateLangChainCode = (): string => { | ||
| if (!currentTransport) return ""; | ||
|
|
||
| const host = currentTransport.host === "0.0.0.0" ? "localhost" : currentTransport.host; | ||
| const port = currentTransport.port; | ||
|
|
||
| return `from langchain.agents import initialize_agent | ||
| from openagents.langchain import OpenAgentsTool | ||
| # Create OpenAgents tool | ||
| openagents_tool = OpenAgentsTool( | ||
| host="${host}", | ||
| port=${port}, | ||
| agent_id="my-agent" | ||
| ) | ||
| # Initialize agent with tool | ||
| agent = initialize_agent( | ||
| tools=[openagents_tool], | ||
| llm=llm, | ||
| agent="zero-shot-react-description" | ||
| )`; | ||
| }; |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code duplication in transport-specific code generation functions. The functions generatePythonCode, generatePythonCodeWithAuth, generateLangChainCode, etc., have similar structure with repeated host/port extraction logic. Consider extracting common logic into a helper function.
| getSavedAgentNameForNetwork, | ||
| saveAgentNameForNetwork, | ||
| } from "@/utils/cookies"; | ||
| } from "@/utils/cookies" |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon at the end of the import statement. The file uses semicolons consistently throughout, but this import is missing one.
| } from "@/utils/cookies" | |
| } from "@/utils/cookies"; |
| name: string | ||
| description?: string | ||
| has_password: boolean | ||
| agent_count?: number | ||
| metadata?: Record<string, any> |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent semicolon usage in interface properties. The file has removed semicolons from interface properties starting at line 20, but this is inconsistent with JavaScript/TypeScript conventions and the rest of the file which uses semicolons.
| name: string | |
| description?: string | |
| has_password: boolean | |
| agent_count?: number | |
| metadata?: Record<string, any> | |
| name: string; | |
| description?: string; | |
| has_password: boolean; | |
| agent_count?: number; | |
| metadata?: Record<string, any>; |
| event_name: "mod:openagents.mods.communication.simple_messaging", | ||
| source_id: agentName || "admin", | ||
| destination_id: "agent:broadcast", | ||
| payload: { | ||
| text: broadcastMessage.trim(), | ||
| type: "broadcast", | ||
| }, | ||
| }); |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadcasting messages without proper authorization checks. The broadcast functionality sends messages to all agents but only checks if the connector exists, not if the current user has admin privileges. This could allow unauthorized message broadcasting.
| uptimeSeconds !== undefined && uptimeSeconds !== null | ||
| ? `${Number(uptimeSeconds).toFixed(3)}s` | ||
| : "N/A"; | ||
| console.log("uptime", uptime); |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug console.log statements should be removed from production code. Consider removing these console.log statements or wrapping them in a development-only check.
| console.log("uptime", uptime); | |
| if (process.env.NODE_ENV === "development") { | |
| console.log("uptime", uptime); | |
| } |
| const { | ||
| selectedNetwork, | ||
| setAgentName, | ||
| clearAgentName, |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable clearAgentName.
| clearAgentName, |
| selectedNetwork, | ||
| setAgentName, | ||
| clearAgentName, | ||
| clearNetwork, |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable clearNetwork.
| clearNetwork, |
| useHttps: network.useHttps, | ||
| } | ||
| ); | ||
| console.log("response",response) |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid automated semicolon insertion (98% of all statements in the enclosing function have an explicit semicolon).
| console.log("response",response) | |
| console.log("response",response); |
No description provided.