-
Notifications
You must be signed in to change notification settings - Fork 480
Feature/letsplot compose integration #507
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,6 +22,7 @@ import cc.unitmesh.agent.subagent.AnalysisAgent | |||||||||
| import cc.unitmesh.agent.subagent.ChartAgent | ||||||||||
| import cc.unitmesh.agent.subagent.ErrorRecoveryAgent | ||||||||||
| import cc.unitmesh.agent.subagent.NanoDSLAgent | ||||||||||
| import cc.unitmesh.agent.subagent.PlotDSLAgent | ||||||||||
| import cc.unitmesh.agent.tool.* | ||||||||||
| import cc.unitmesh.agent.tool.filesystem.DefaultToolFileSystem | ||||||||||
| import cc.unitmesh.agent.tool.filesystem.ToolFileSystem | ||||||||||
|
|
@@ -99,6 +100,7 @@ class CodingAgent( | |||||||||
| private val analysisAgent = AnalysisAgent(llmService, contentThreshold = 15000) | ||||||||||
| private val nanoDSLAgent = NanoDSLAgent(llmService) | ||||||||||
| private val chartAgent = ChartAgent(llmService) | ||||||||||
| private val plotDSLAgent = PlotDSLAgent(llmService) | ||||||||||
| private val mcpToolsInitializer = McpToolsInitializer() | ||||||||||
|
|
||||||||||
| // 执行器 | ||||||||||
|
|
@@ -133,6 +135,14 @@ class CodingAgent( | |||||||||
| toolRegistry.registerTool(chartAgent) | ||||||||||
| subAgentManager.registerSubAgent(chartAgent) | ||||||||||
|
|
||||||||||
| // PlotDSLAgent - only available on JVM/Android (checks isAvailable internally) | ||||||||||
| if (plotDSLAgent.isAvailable) { | ||||||||||
| registerTool(plotDSLAgent) | ||||||||||
| toolRegistry.registerTool(plotDSLAgent) | ||||||||||
| } | ||||||||||
|
|
||||||||||
| subAgentManager.registerSubAgent(plotDSLAgent) | ||||||||||
|
|
||||||||||
| CoroutineScope(SupervisorJob() + Dispatchers.Default).launch { | ||||||||||
| initializeWorkspace(projectPath) | ||||||||||
| } | ||||||||||
|
|
@@ -142,7 +152,8 @@ class CodingAgent( | |||||||||
| input: AgentTask, | ||||||||||
| onProgress: (String) -> Unit | ||||||||||
| ): ToolResult.AgentResult { | ||||||||||
| initializeWorkspace(input.projectPath) | ||||||||||
| // Note: initializeWorkspace is already called in init block, no need to call again here | ||||||||||
| // The buildContext() will handle MCP tools initialization if needed | ||||||||||
|
Comment on lines
+155
to
+156
|
||||||||||
| // Note: initializeWorkspace is already called in init block, no need to call again here | |
| // The buildContext() will handle MCP tools initialization if needed | |
| // Workspace initialization is performed asynchronously in the init block. | |
| // MCP tools initialization is handled within buildContext if needed. |
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 conditional registration logic is inconsistent. PlotDSLAgent is registered to
toolRegistryonly whenisAvailableis true (lines 139-142), but then unconditionally registered tosubAgentManager(line 144). This could lead to the SubAgent being available in the manager but not as a tool. Either both should be conditional, or thesubAgentManager.registerSubAgent()call should handle the availability check internally (which it does based on the SubAgentManager.kt changes).