这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@allisoneer
Copy link
Contributor

@allisoneer allisoneer commented May 14, 2025

Important

Add DELETE endpoint for agents and enhance agent status response with new fields, including comprehensive tests.

  • Endpoints:
    • Add DELETE /v1/agents/:name endpoint in server.go to delete agents and associated resources.
    • Update AgentResponse in server.go to include status, statusDetail, ready, and MCPStatus fields.
  • Tests:
    • Add TestAgentEndpointStatus in agent_status_test.go to verify agent status response.
    • Add tests for DELETE /v1/agents/:name in server_test.go to ensure agent and resources deletion, handle non-existent agents, and idempotency.

This description was created by Ellipsis for 85bacf3. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 558 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft 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% <= threshold 50% None

Workflow ID: wflow_UUGOoezaH4SZBPUP

You can customize Ellipsis 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, "-")
Copy link
Contributor

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 {
Copy link
Contributor

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.

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
Copy link
Contributor

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

@allisoneer allisoneer merged commit f994eb6 into humanlayer:main May 14, 2025
4 of 5 checks passed
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.

2 participants