-
Notifications
You must be signed in to change notification settings - Fork 42
add put support for agents api #99
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
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 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 { |
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 double JSON decoding; use a single strict JSON decoder with DisallowUnknownFields to simplify and avoid potential inconsistencies.
| return | ||
| } | ||
| } | ||
| mcpServer := createMCPServer(mcpName, namespace, config, secretName) |
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 variable shadowing; use assignment rather than ':=' when creating the new MCP server.
| 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) { |
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.
Consider refactoring the long updateAgent handler into smaller helper functions to improve readability and maintainability.
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.