add put support for agents api#99
Merged
dexhorthy merged 1 commit intohumanlayer:mainfrom May 14, 2025
Merged
Conversation
dexhorthy
approved these changes
May 14, 2025
dexhorthy
approved these changes
May 14, 2025
Contributor
There was a problem hiding this comment.
Caution
Changes requested ❌
Reviewed everything up to 9756f6b in 3 minutes and 5 seconds. Click for details.
- Reviewed
591lines of code in2files - Skipped
0files when reviewing. - Skipped posting
2draft 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:853
- Draft comment:
The PUT /v1/agents endpoint tests are comprehensive and cover various scenarios, which is excellent. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. acp/internal/server/server.go:676
- Draft comment:
Typographical: In the error message "llm and systemPrompt are required", consider capitalizing "LLM" for consistency with its usage elsewhere in the code (e.g., using "LLM" instead of "llm"). - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While the suggestion would make the error messages more consistent, this is an extremely minor cosmetic change that doesn't affect functionality. The error message is still clear and understandable. The rules state not to make comments that are obvious or unimportant, and this feels like a very low-priority stylistic suggestion. The inconsistency in capitalization could be seen as a legitimate style issue that affects code quality and professionalism. Multiple occurrences of "LLM" in the codebase do use capital letters. While consistency is good, this is such a minor issue that it doesn't warrant a PR comment. The error message is still perfectly clear to users, and this kind of minor stylistic feedback could be better handled in team style guides or linters. Delete the comment. While technically correct, it's too minor of a stylistic issue to warrant a PR comment.
Workflow ID: wflow_13vwixa91a3A5s2F
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
|
||
| // Parse request | ||
| var req UpdateAgentRequest | ||
| if err := json.Unmarshal(rawData, &req); err != nil { |
Contributor
There was a problem hiding this comment.
Avoid double JSON decoding; use a single strict JSON decoder with DisallowUnknownFields to simplify and avoid potential inconsistencies.
| return | ||
| } | ||
| } | ||
| mcpServer := createMCPServer(mcpName, namespace, config, secretName) |
Contributor
There was a problem hiding this comment.
Avoid variable shadowing; use assignment rather than ':=' when creating the new MCP server.
Suggested change
| mcpServer := createMCPServer(mcpName, namespace, config, secretName) | |
| mcpServer = createMCPServer(mcpName, namespace, config, secretName) |
| } | ||
|
|
||
| // updateAgent handles updating an existing agent and its associated MCP servers | ||
| func (s *APIServer) updateAgent(c *gin.Context) { |
Contributor
There was a problem hiding this comment.
Consider refactoring the long updateAgent handler into smaller helper functions to improve readability and maintainability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Adds PUT support for updating agents, including MCP server management, with validation and tests.
PUT /v1/agents/:nameendpoint inserver.goto update existing agents.LLM,SystemPrompt, andMCPServers.UpdateAgentRequest.UpdateAgentRequeststruct for updating agents.server_test.gofor updating agents, including scenarios for updating MCP servers, handling non-existent agents or LLMs, and validating input.This description was created by
for 9756f6b. You can customize this summary. It will automatically update as commits are pushed.