-
Notifications
You must be signed in to change notification settings - Fork 42
5 of X: Transition to AwaitingHumanApproval with real request to HL API #44
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
5 of X: Transition to AwaitingHumanApproval with real request to HL API #44
Conversation
dd213ff to
9a5a149
Compare
| r.MCPManager = mcpmanager.NewMCPServerManager() | ||
| } | ||
|
|
||
| if r.HLClient == 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.
A note, I'm piggybacking here and probably breaking the naming of this function, maybe worth looking at renaming?
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.
❌ Changes requested. Reviewed everything up to 9a5a149 in 3 minutes and 24 seconds
More details
- Looked at
1412lines of code in9files - Skipped
1files when reviewing. - Skipped posting
11drafted comments based on config settings.
1. kubechain/internal/mcpmanager/mcpmanager.go:157
- Draft comment:
Prefer structured logging over fmt.Printf for error messages. - 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.
2. kubechain/internal/mcpmanager/mcpmanager.go:326
- Draft comment:
Consider validating or normalizing the tool name comparison in FindServerForTool. - 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.
3. kubechain/internal/mcpmanager/mcpmanager.go:298
- Draft comment:
Enhance handling of non-text content in tool call output. - 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.
4. kubechain/api/v1alpha1/taskruntoolcall_types.go:10
- Draft comment:
Nice addition of the new status enum value. Ensure that consumers use these constants instead of hard-coded strings for consistency. - Reason this comment was not posted:
Comment looked like it was already resolved.
5. kubechain/config/crd/bases/kubechain.humanlayer.dev_taskruntoolcalls.yaml:140
- Draft comment:
Added new enum value for status. Verify that all controllers use the constant and not literal strings. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%
The comment is asking the PR author to verify that all controllers use the constant instead of literal strings. This is a request for verification, which is not allowed according to the rules. The comment does not provide a specific suggestion or point out a specific issue in the code.
6. kubechain/internal/controller/taskruntoolcall/taskruntoolcall_controller.go:785
- Draft comment:
When updating status to 'AwaitingHumanApproval', use the enum constant instead of the string literal. - Reason this comment was not posted:
Marked as duplicate.
7. kubechain/internal/controller/taskruntoolcall/taskruntoolcall_controller.go:801
- Draft comment:
Good nil-check for HLClient; ensure that all injected dependencies are verified before use. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%
This comment is asking the PR author to ensure that dependencies are verified, which is similar to asking them to double-check or ensure behavior. It doesn't provide a specific suggestion or point out a specific issue.
8. kubechain/internal/humanlayer/hlclient.go:18
- Draft comment:
Nice refactoring to use an interface and wrapper. Consider adding documentation for each method to improve clarity for future developers. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =20%<= threshold50%
The comment is suggesting adding documentation for methods, which is a general suggestion for improvement. It doesn't point out a specific issue or provide a specific code suggestion. It seems to be more of a general best practice reminder, which doesn't align with the rules provided.
9. kubechain/internal/humanlayer/mock_hlclient.go:80
- Draft comment:
The mock implementation correctly stores invocation details for verification in tests. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%
None
10. kubechain/internal/mcpmanager/mcpmanager.go:28
- Draft comment:
The new MCPManagerInterface is defined properly; ensure callers use the interface abstraction to facilitate testing. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
This comment is asking the author to "ensure" something rather than pointing out a specific issue. It's making a suggestion about how callers should use the code, but not identifying any actual problem. The interface addition itself looks good, but telling callers to use it is more of a documentation point than a required code change.
The interface addition is a good practice for testing, so maybe we should keep the comment to encourage good testing practices? The comment could help future maintainers.
While testing practices are important, this comment violates our rule about not making comments that just ask authors to "ensure" things. It's not pointing out a specific issue that needs fixing.
Delete this comment as it's asking the author to "ensure" something rather than identifying a specific issue that needs to be fixed. It's more of a general suggestion than an actionable review comment.
11. kubechain/internal/mcpmanager/mcpmanager.go:369
- Draft comment:
Consider using a logger instead of fmt.Printf for logging errors when marshaling input schemas. - 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.
Workflow ID: wflow_26YxJShrTXuKSuYo
Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
kubechain/internal/controller/taskruntoolcall/taskruntoolcall_controller.go
Outdated
Show resolved
Hide resolved
kubechain/internal/controller/taskruntoolcall/taskruntoolcall_controller.go
Show resolved
Hide resolved
| "tool_name": trtc.Spec.ToolRef.Name, | ||
| "task_run": trtc.Spec.TaskRunRef.Name, | ||
| "namespace": trtc.Namespace, | ||
| }) |
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.
yeah I think we want isntead of
approve_tool_call({
"namespace": "default",
"task_run": "make-fetch-happen-task-1",
"tool_name": "make-fetch-happen-server__fetch"
})
we want
fetch__fetch({
url: ...
offset: ...
})
| } | ||
|
|
||
| // Do not pass GO, do not collect $200, if we've errored | ||
| if trtc.Status.Status == kubechainv1alpha1.TaskRunToolCallStatusTypeErrorRequestingHumanApproval { |
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.
if we're in a terminal state, I've tried to hoist these to the top
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.
oh i read it wrong ignore me
|
|
||
| if needsApproval { | ||
|
|
||
| trtcNamespace := trtc.Namespace |
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.
as you're going, this could probably be it's own method eventually
42674fe to
b4334b6
Compare
Introduces handling to transition to
AwaitingHumanApprovaland make request to HumanLayer APIImportant
Adds transition to
AwaitingHumanApprovalin TaskRunToolCall with HumanLayer API integration for approval requests.AwaitingHumanApprovalandErrorRequestingHumanApprovalstatuses intaskruntoolcall_types.go.AwaitingHumanApprovalintaskruntoolcall_controller.go.postToHumanLayer().ErrorRequestingHumanApproval.TaskRunToolCallReconcilerto includeHLClientfor HumanLayer API interactions.getContactChannel()andgetHumanLayerAPIKey()for fetching contact channel and API key.Reconcile()to handle approval logic and requeue if awaiting approval.taskruntoolcall_controller_test.gofor transitions toAwaitingHumanApprovalandErrorRequestingHumanApproval.mock_hlclient.gofor testing API interactions.kubechain.humanlayer.dev_taskruntoolcalls.yamlto include new statuses.kubechain_v1alpha_contactchannel_with_approval.yaml.This description was created by
for 9a5a149. It will automatically update as commits are pushed.