-
Notifications
You must be signed in to change notification settings - Fork 11
fix: disable sync if not using traceloop #22
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
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughConditionalized prompt polling during Traceloop initialization: Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant TL as Traceloop SDK
participant Poller as Prompt Poller
App->>TL: initialize(config)
TL->>TL: normalize BaseURL (ToLower)
alt BaseURL ends with "traceloop.com"
TL->>Poller: pollPrompts()
Poller-->>TL: start/continue syncing
else Other BaseURL
TL-->>App: log "sync disabled for base URL"
end
TL-->>App: initialization complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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 75f69e2 in 1 minute and 24 seconds. Click for details.
- Reviewed
25lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1draft 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. traceloop-sdk/sdk.go:75
- Draft comment:
Review logging of the BaseURL in the disabled sync message; ensure it does not expose sensitive config info in production logs. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
Workflow ID: wflow_K20F3ZqEGbr6731p
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
75f69e2 to
09ce94f
Compare
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 09ce94f in 1 minute and 36 seconds. Click for details.
- Reviewed
56lines of code in1files - Skipped
0files when reviewing. - Skipped posting
1draft 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. traceloop-sdk/sdk.go:72
- Draft comment:
For clarity, consider adding a log message in an else branch to indicate that prompt polling was skipped for non-traceloop endpoints. - 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% The existing log on line 70 already provides the endpoint information. Users can see that polling won't happen for non-traceloop endpoints by the conditional. An additional log would be redundant and add noise. This seems like a purely informative suggestion rather than a necessary code change. Maybe in some cases extra logging could help with debugging issues related to prompt polling. The suggestion isn't technically wrong. The existing log already provides the key information needed. Adding more logs could create noise and the current code structure makes the behavior clear enough. Delete the comment as it suggests adding unnecessary logging that would be redundant with existing logs.
Workflow ID: wflow_WVHYY1HzLXVzT0aa
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
traceloop-sdk/sdk.go
Outdated
| log.Printf("Traceloop %s SDK initialized. Connecting to %s\n", Version(), instance.config.BaseURL) | ||
|
|
||
| instance.pollPrompts() | ||
| if strings.HasSuffix(instance.config.BaseURL, "traceloop.com") { |
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 normalizing the BaseURL before checking its suffix (e.g. trimming trailing '/' and lowercasing) to avoid false negatives (e.g. 'https://api.traceloop.com/' may not match).
| if strings.HasSuffix(instance.config.BaseURL, "traceloop.com") { | |
| if strings.HasSuffix(strings.ToLower(strings.TrimSuffix(instance.config.BaseURL, "/")), "traceloop.com") { |
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Important
pollPrompts()ininitialize()now runs only ifBaseURLends withtraceloop.com, with logging for non-traceloop.com endpoints.pollPrompts()ininitialize()now only runs ifBaseURLends withtraceloop.com.stringspackage to support new behavior.This description was created by
for 09ce94f. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
New Features
Documentation
Tests
Chores