这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@allisoneer
Copy link
Contributor

@allisoneer allisoneer commented May 21, 2025

Important

Replaces responseURL with baseURL and channelTokenFrom for human contact channels, updating TaskSpec, controller logic, API server, and tests accordingly.

  • Behavior:
    • Replaces responseURL with baseURL and channelTokenFrom in TaskSpec in task_types.go.
    • Updates TaskReconciler in task_controller.go to use baseURL and channelTokenFrom for sending results via HumanLayer API.
    • Removes send_response_url_test.go and related logic for responseURL.
  • API:
    • Updates createTask in server.go to handle baseURL and channelTokenFrom.
    • Adds sanitizeTask in server.go to remove channelTokenFrom from API responses.
  • CRD:
    • Updates acp.humanlayer.dev_tasks.yaml to include baseURL and channelTokenFrom in the schema.
  • Tests:
    • Adds task_humanlayerapi_integration_test.go for testing HumanLayer API integration.
    • Removes task_responseurl_integration_test.go and related tests.

This description was created by Ellipsis for 3a81c55. You can customize this summary. It will automatically update as commits are pushed.

@allisoneer
Copy link
Contributor Author

@claude Please review this PR

@claude
Copy link

claude bot commented May 21, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 1045 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft 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% <= threshold 50% 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% <= threshold 50% 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% <= threshold 50% 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% <= threshold 50% None

Workflow ID: wflow_WZXov7UlEoTYoAnW

You can customize Ellipsis 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
Copy link
Contributor

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"`
Copy link
Contributor

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

Copy link
Contributor

@dexhorthy dexhorthy left a 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)
Copy link
Contributor

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)

@allisoneer allisoneer merged commit 81e6ffa into humanlayer:main May 22, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants