-
Notifications
You must be signed in to change notification settings - Fork 42
approval required based on annotations #104
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
Open
allisoneer
wants to merge
2
commits into
humanlayer:main
Choose a base branch
from
allisoneer:allison/eng-1309-campy-should-request-approval-on-certain-mcp-tools-using-the
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
approval required based on annotations #104
allisoneer
wants to merge
2
commits into
humanlayer:main
from
allisoneer:allison/eng-1309-campy-should-request-approval-on-certain-mcp-tools-using-the
+412
−52
Conversation
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
…al-on-certain-mcp-tools-using-the
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.
Important
Looks good to me! 👍
Reviewed everything up to 987031a in 1 minute and 43 seconds. Click for details.
- Reviewed
646lines of code in7files - Skipped
0files when reviewing. - Skipped posting
9draft 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/api/v1alpha1/mcpserver_types.go:89
- Draft comment:
The new ToolAnnotation struct looks useful. Consider expanding the documentation to explain the default behavior when these boolean hints are omitted, and how they interact with tool execution (for instance, what should a nil value imply versus false). - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
2. acp/api/v1alpha1/toolcall_types.go:46
- Draft comment:
The ToolAnnotations field has been added to ToolCallSpec. Ensure that any upstream validation or conversion logic correctly handles missing annotations and that the JSON schema documentation is updated if needed. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
3. acp/internal/adapters/mcp_adapter.go:43
- Draft comment:
The client tool creation now includes 'ACPToolAnnotations' taken from the MCPTool. This propagation appears correct; verify that the LLM client later leverages these annotations for approval or execution decisions. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
4. acp/internal/controller/task/task_controller.go:528
- Draft comment:
In the createToolCalls function, a map (toolAnnotationsMap) is built keyed by tool.Function.Name. Ensure that the tool names are always unique across different MCP servers to avoid accidentally overwriting annotations. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the author to ensure that tool names are unique across different servers. This is a request for confirmation of intention, which violates the rules. The comment does not provide a specific code suggestion or ask for a specific test to be written.
5. acp/internal/controller/toolcall/toolcall_controller.go:535
- Draft comment:
The handlePendingApproval function distinguishes between a human contact flow and a standard function call flow. The nested if-conditions and branch for responseOption are a bit complex; consider refactoring for clarity and reducing nesting in a future cleanup. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. acp/internal/controller/toolcall/toolcall_controller.go:757
- Draft comment:
In the requestHumanApproval function, when task.Spec.ResponseURL is present, the HTTP request is built and sent. Please review that the HTTP client enforces secure (TLS) connections and that errors (especially during JSON decoding for call ID extraction) are logged carefully. The fallback logic that generates a placeholder call ID should be reviewed to avoid potential collisions or ambiguity. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =50%<= threshold50%The comment is asking the PR author to review the HTTP client for secure connections and error logging, which is not allowed. However, it also suggests reviewing the fallback logic for potential issues, which is a valid concern. The comment is partially useful.
7. acp/internal/controller/toolcall/toolcall_controller.go:1228
- Draft comment:
The createToolApprovalRequest helper builds a payload with multiple response options. The implementation is sound; just ensure that these approval option names (approve, approve_session, reject) are consistently used throughout the system and that any TODOs regarding session-level approvals are tracked. - Reason this comment was not posted:
Confidence changes required:40%<= threshold50%None
8. acp/internal/llmclient/llm_client.go:32
- Draft comment:
The LLMClient interface and LLMRequestError type are straightforward. Consider whether additional error context (or wrapping the original error) might be useful for debugging LLM failures. - Reason this comment was not posted:
Confidence changes required:30%<= threshold50%None
9. acp/internal/mcpmanager/mcpmanager.go:202
- Draft comment:
In the MCPServerManager, tool conversion now includes copying the ToolAnnotation. The code that resolves secret values for environment variables is good; however, take care to avoid logging sensitive data when errors occur. Additionally, ensure that any changes in secret resolution or annotations are properly tested. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
Workflow ID: wflow_EcJxnAECkPRBpXF2
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Pretty sloppy and in-process.
Important
Adds tool approval logic based on annotations, updating controllers and managers to handle new metadata.
ToolAnnotationstruct inmcpserver_types.goandtoolcall_types.goto store tool metadata.ToolCallReconcilerto handle tool approval based on annotations, including session-level approvals.TaskReconcilerto manage tool calls with annotations.ToolCallReconcilernow checksToolAnnotationfor approval logic, includingReadOnlyHintto skip approvals.TaskReconcilercreates tool calls with annotations and manages their execution.MCPServerManagerupdated to include tool annotations when listing tools.createToolApprovalRequestfunction intoolcall_controller.gofor building approval requests.llm_client.goto includeACPToolAnnotationsinToolstruct.This description was created by
for 987031a. You can customize this summary. It will automatically update as commits are pushed.