Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4950,7 +4950,16 @@ func handleRunDatastoreAutomation(ctx context.Context, cacheData CacheKeyData, a
continue
}

requiredApps := []string{"internal_datastore", "shuffle-datastore"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a function for this in blobs.go that should be used:

func IsShuffleApp(app WorkflowApp) bool {

for _, req := range requiredApps {

if !ArrayContains(option.Apps, req) {
option.Apps = append(option.Apps, req)
}
}

allowedApps := strings.Join(option.Apps, ",")

parsedParams := []map[string]string{
map[string]string{
"name": "app_name",
Expand Down
1 change: 1 addition & 0 deletions health.go
Original file line number Diff line number Diff line change
Expand Up @@ -4659,6 +4659,7 @@ func startAgentExecution(baseUrl, apiKey, orgId string) (agentStartResult, error
"input": map[string]string{
"text": "Get the current weather of new york using https://wttr.in/New+York?format=%t api and just output the current weather temperature without any commentary, just output the number in celcius and dont include the decimals, use action as custom_action, tool as http and category as singul keep the url as it and not needed for any other hallucinated params or headers, just include the url as is and the method name which is GET.",
},
"tool_name" : "http",
},
}

Expand Down
14 changes: 14 additions & 0 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -18124,6 +18124,20 @@ func handleAgentDecisionStreamResult(workflowExecution WorkflowExecution, action
originalAction = actionResult.Action
}

// If the execution is already FINISHED but a continuation was injected (user asked the agent to do more on top of what it already did), we need to reset the status back to EXECUTING so that HandleAiAgentExecutionStart doesn't exit with "Agent run already finished". We also persist this to cache so the guard in
if workflowExecution.Status == "FINISHED" || workflowExecution.Status == "SUCCESS" {
log.Printf("[INFO][%s] Agent continuation: resetting execution status from '%s' to 'EXECUTING' for continuation", workflowExecution.ExecutionId, workflowExecution.Status)
workflowExecution.Status = "EXECUTING"
workflowExecution.CompletedAt = 0

executionCacheKey := fmt.Sprintf("workflowexecution_%s", workflowExecution.ExecutionId)
DeleteCache(ctx, executionCacheKey)
marshalledExec, marshalErr := json.Marshal(workflowExecution)
if marshalErr == nil {
SetCache(ctx, executionCacheKey, marshalledExec, 30)
}
}

callerName := "handleAgentDecisionStreamResult"
returnAction, err := HandleAiAgentExecutionStart(workflowExecution, originalAction, true, callerName)
if err != nil {
Expand Down
Loading