-
Notifications
You must be signed in to change notification settings - Fork 41
using channelToken and baseURL instead of responseURL #117
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
using channelToken and baseURL instead of responseURL #117
Conversation
|
@claude Please review this PR |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
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 3a81c55 in 2 minutes and 21 seconds. Click for details.
- Reviewed
1045lines of code in9files - Skipped
0files when reviewing. - Skipped posting
4draft 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/task_types.go:41
- Draft comment:
Good refactoring: 'ResponseURL' is replaced by 'BaseURL' and a new 'ChannelTokenFrom' field is added. Consider adding additional validation (e.g. kubebuilder annotations) for the secret reference if applicable. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. acp/internal/controller/task/task_controller.go:860
- Draft comment:
Ensure that detailed error information from the HumanLayer API call is logged (e.g., HTTP status and error message) to aid in debugging failures. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. acp/internal/server/server.go:602
- Draft comment:
The sanitizeTask function correctly removes the sensitive 'ChannelTokenFrom' field before returning task data. This is good for security; ensure that this approach stays in sync with any additional sensitive fields in the future. - 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 future changes, which is not specific to the current code change. It violates the rule against asking the author to ensure future behavior.
4. acp/internal/server/server.go:1223
- Draft comment:
In createTask, extraction of 'BaseURL' and conversion of 'ChannelTokenFrom' from the request is handled properly. Verify that downstream processing gracefully handles cases where these fields are missing or malformed. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_WZXov7UlEoTYoAnW
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| return retryable, fmt.Errorf("HTTP error from responseURL (status %d): %s", resp.StatusCode, bodyStr) | ||
| // Exponential backoff | ||
| if attempt < maxRetries-1 { | ||
| time.Sleep(time.Second * time.Duration(1<<attempt)) // 1s, 2s, 4s |
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.
In sendFinalResultViaHumanLayerAPI, the retry loop uses time.Sleep for backoff. Consider making the sleep context-aware (using select on ctx.Done()) to ensure cancellation is respected.
|
|
||
| // ChannelTokenFrom references a secret containing the token for the human contact channel. | ||
| // +optional | ||
| ChannelTokenFrom *SecretKeyRef `json:"channelTokenFrom,omitempty"` |
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.
i was hoping this would be a contactChannelRef, and the baseURL/channelToken moves to ContactChannel CR
dexhorthy
left a comment
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.
good to merge but lemme know wha tyou think about my comment
| // Create the request body | ||
| jsonData, err := createHumanContactRequest(task.Spec.AgentRef.Name, result) | ||
| // Create HumanLayer client factory with the BaseURL | ||
| clientFactory, err := newHumanLayerClientFactory(task.Spec.BaseURL) |
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.
its really hard to figure out by reading this PR where BaseURL gets used and if we're appending the /humanlayer/v1 inside the client. (we shouldn't be)
Important
Replaces
responseURLwithbaseURLandchannelTokenFromfor human contact channels, updatingTaskSpec, controller logic, API server, and tests accordingly.responseURLwithbaseURLandchannelTokenFrominTaskSpecintask_types.go.TaskReconcilerintask_controller.goto usebaseURLandchannelTokenFromfor sending results via HumanLayer API.send_response_url_test.goand related logic forresponseURL.createTaskinserver.goto handlebaseURLandchannelTokenFrom.sanitizeTaskinserver.goto removechannelTokenFromfrom API responses.acp.humanlayer.dev_tasks.yamlto includebaseURLandchannelTokenFromin the schema.task_humanlayerapi_integration_test.gofor testing HumanLayer API integration.task_responseurl_integration_test.goand related tests.This description was created by
for 3a81c55. You can customize this summary. It will automatically update as commits are pushed.