Fix update function signatures and data handling in GET requests #13
Draft
satti-hari-krishna-reddy wants to merge 14 commits intoShuffle:mainfrom
Draft
Fix update function signatures and data handling in GET requests #13satti-hari-krishna-reddy wants to merge 14 commits intoShuffle:mainfrom
satti-hari-krishna-reddy wants to merge 14 commits intoShuffle:mainfrom
Conversation
frikky
reviewed
Apr 9, 2026
| // Runs attempts up to X times | ||
| var maxRerunAttempts = 7 | ||
| // var maxRerunAttempts = 7 | ||
| var maxRerunAttempts = 3 |
Member
There was a problem hiding this comment.
Are you sure about this? I don't mind, but I'd rather have something working but slow, than broken and fast.
| } | ||
|
|
||
| ctx = context.WithValue(ctx, "caller", "RunCategoryAction") | ||
| ctx = context.WithValue(ctx, "org_id", org.Id) |
Member
There was a problem hiding this comment.
I'm not sure I understand what these do. Is it related to the logging stuff?
| // Check if this is a GET request - GET requests should NOT have a body | ||
| isGetRequest := false | ||
| for _, p := range secondAction.Parameters { | ||
| if p.Name == "method" && strings.ToUpper(p.Value) == "GET" { |
Member
There was a problem hiding this comment.
Problem: Other methods can also not have a body. E.g. HEAD or OPTIONS. And custom methods.
How do we handle that?
| if debug { | ||
| // BUT: Don't apply this logic to proper HTTP fields like headers/body | ||
| if !isProperHttpField && ((strings.Contains(field.Value, "http") && strings.Contains(field.Value, "://") && (strings.Contains(field.Value, "GET") || strings.Contains(field.Value, "POST") || strings.Contains(field.Value, "PUT") || strings.Contains(field.Value, "PATCH") || strings.Contains(field.Value, "DELETE"))) || (strings.HasPrefix(field.Value, "{") && strings.HasSuffix(field.Value, "}"))) { | ||
| log.Printf("[HEYOOO] Singul - Found HTTP request in field %s: %s", field.Key, field.Value) |
| } | ||
|
|
||
| if len(ctx.Value("caller").(string)) == 0 { | ||
| ctx = context.WithValue(ctx, "caller", "AnalyzeIntentAndCorrectApp") |
Member
There was a problem hiding this comment.
Still confused about these contexts (:
| - slack.com/api → Slack | ||
| - api.github.com → GitHub | ||
| - random-api.com → http | ||
| - api.telegram.org/bot123456:TOKEN/sendMessage → http (has bot token, keep as HTTP) |
Member
There was a problem hiding this comment.
Uhm, we need a better way to handle this. We can't be adding specifics this way.
Any ideas?
| If the URL and fields clearly match a known service, return that service even if the intent text disagrees. | ||
| If the request does not strongly match any known service and appears to be a generic or custom HTTP call, return "http" | ||
|
|
||
| IMPORTANT: If the request already contains authentication credentials (API keys, tokens, bearer tokens in headers, bot tokens in URL, etc.), |
Member
There was a problem hiding this comment.
This feels like it will break something
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
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.
NoTE: This depends on Shuffle/shuffle-shared#367