-
Notifications
You must be signed in to change notification settings - Fork 42
delete and status response #101
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
delete and status response #101
Conversation
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.
Caution
Changes requested ❌
Reviewed everything up to 85bacf3 in 1 minute and 55 seconds. Click for details.
- Reviewed
558lines of code in3files - Skipped
0files when reviewing. - Skipped posting
1draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. acp/internal/server/server_test.go:324
- Draft comment:
Consider using the apierrors.StatusError alias instead of errors.StatusError for consistency in error handling. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_UUGOoezaH4SZBPUP
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| var mcpServer acp.MCPServer | ||
| if err := s.client.Get(ctx, client.ObjectKey{Namespace: namespace, Name: mcpRef.Name}, &mcpServer); err == nil { | ||
| // Extract key from MCP server name (assuming it follows the pattern: {agent-name}-{key}) | ||
| parts := strings.Split(mcpRef.Name, "-") |
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.
Using strings.Split to extract the MCP server key is brittle if names contain extra dashes. Consider a more robust parsing strategy or storing the key explicitly.
| } | ||
|
|
||
| // Delete MCP servers and secrets | ||
| for _, mcpRef := range agent.Spec.MCPServers { |
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 deleteAgent handler stops on the first deletion error for MCP servers or secrets. Consider aggregating errors to attempt deletion of all associated resources for improved idempotency.
acp/internal/server/server.go
Outdated
| Status string `json:"status,omitempty"` // e.g., "Ready", "Error", "Pending" | ||
| StatusDetail string `json:"statusDetail,omitempty"` // Additional status details | ||
| Ready bool `json:"ready,omitempty"` // Indicates if agent is ready | ||
| MCPStatus map[string]string `json:"mcpStatus,omitempty"` // Status of each MCP server |
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.
move into MCPServerConfig as status fields
Important
Add DELETE endpoint for agents and enhance agent status response with new fields, including comprehensive tests.
DELETE /v1/agents/:nameendpoint inserver.goto delete agents and associated resources.AgentResponseinserver.goto includestatus,statusDetail,ready, andMCPStatusfields.TestAgentEndpointStatusinagent_status_test.goto verify agent status response.DELETE /v1/agents/:nameinserver_test.goto ensure agent and resources deletion, handle non-existent agents, and idempotency.This description was created by
for 85bacf3. You can customize this summary. It will automatically update as commits are pushed.