Skip to content

Commit f02a67e

Browse files
committed
Merge branch 'main' of github.com:Shuffle/shuffle-shared
2 parents d3c0012 + 0d1fec7 commit f02a67e

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed

ai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ func FixContentOutput(contentOutput string) string {
13411341
contentOutput = strings.Trim(contentOutput, "\t")
13421342

13431343
// Fix issues with newlines in keys. Replace with raw newlines
1344-
contentOutput = strings.ReplaceAll(contentOutput, "\\n", "\n")
1344+
//contentOutput = strings.ReplaceAll(contentOutput, "\\n", "\n")
13451345

13461346
// Attempts to balance it automatically
13471347
contentOutput = balanceJSONLikeString(contentOutput)

db-connector.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17540,6 +17540,9 @@ func InitOpensearchIndexes() {
1754017540
GetESIndexPrefix("shuffle_logs"),
1754117541
GetESIndexPrefix("environments"),
1754217542
GetESIndexPrefix("org_statistics"),
17543+
GetESIndexPrefix("workflowapp"),
17544+
GetESIndexPrefix("workflow"),
17545+
GetESIndexPrefix("workflow_revisions"),
1754317546
}
1754417547

1754517548
customConfig := os.Getenv("OPENSEARCH_INDEX_CONFIG")

shared.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15128,6 +15128,13 @@ func HandleLogin(resp http.ResponseWriter, request *http.Request) {
1512815128
Expiration: expiration.Unix(),
1512915129
})
1513015130

15131+
// Singul handler
15132+
if project.Environment == "cloud" {
15133+
newCookie.Name = "__session"
15134+
newCookie.Domain = ".singul.io"
15135+
http.SetCookie(resp, newCookie)
15136+
}
15137+
1513115138
loginData = fmt.Sprintf(`{"success": true, "cookies": [{"key": "session_token", "value": "%s", "expiration": %d}], "region_url": "%s"}`, userdata.Session, expiration.Unix(), regionUrl)
1513215139
newData, err := json.Marshal(returnValue)
1513315140
if err == nil {
@@ -15185,6 +15192,13 @@ func HandleLogin(resp http.ResponseWriter, request *http.Request) {
1518515192
Expiration: expiration.Unix(),
1518615193
})
1518715194

15195+
// Singul handler
15196+
if project.Environment == "cloud" {
15197+
newCookie.Name = "__session"
15198+
newCookie.Domain = ".singul.io"
15199+
http.SetCookie(resp, newCookie)
15200+
}
15201+
1518815202
err = SetUser(ctx, &userdata, true)
1518915203
if err != nil {
1519015204
log.Printf("[ERROR] Failed updating user when setting session: %s", err)
@@ -24785,6 +24799,10 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2478524799
}
2478624800

2478724801
}
24802+
24803+
// Special weird mistake cases in apps without newlines
24804+
param.Value = strings.ReplaceAll(param.Value, "application/jsonContent-Type", "application/json\nContent-Type")
24805+
param.Value = strings.ReplaceAll(param.Value, "application/jsonAccept", "application/json\nAccept")
2478824806
}
2478924807

2479024808
if param.Name == "queries" {

stats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ func IncrementCache(ctx context.Context, orgId, dataType string, amount ...int)
891891
return
892892
}
893893

894-
if len(orgId) != 36 {
894+
if len(orgId) != 36 && orgId != "public" {
895895
log.Printf("[ERROR] Increment Stats with bad OrgId '%s' for type '%s'", orgId, dataType)
896896
return
897897
}

structs.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ type AtomicOutput struct {
136136
ThreadId string `json:"thread_id"` // Thread the assistant ran
137137
RunId string `json:"run_id"` // Run ID for the thread
138138
ToolCallID string `json:"tool_call_id,omitempty"` // Result inside the run
139-
140-
ResponseId string `json:"response_id,omitempty"` // Response ID
141-
ConversationId string `json:"conversation_id,omitempty"` // Conversation ID
139+
140+
ResponseId string `json:"response_id,omitempty"` // Response ID
141+
ConversationId string `json:"conversation_id,omitempty"` // Conversation ID
142142
}
143143

144144
type ExecutionRequestWrapper struct {
@@ -1666,8 +1666,8 @@ type Notification struct {
16661666
Ignored bool `json:"ignored" datastore:"ignored"`
16671667
ExecutionId string `json:"execution_id" datastore:"execution_id"`
16681668

1669-
Severity string `json:"severity" datastore:"severity"`
1670-
Origin string `json:"origin" datastore:"origin"`
1669+
Severity string `json:"severity" datastore:"severity"`
1670+
Origin string `json:"origin" datastore:"origin"`
16711671
}
16721672

16731673
type NotificationCached struct {
@@ -3999,12 +3999,12 @@ type SchemalessOutput struct {
39993999
Status int `json:"status,omitempty"`
40004000
URL string `json:"url,omitempty"`
40014001

4002-
// Optional
4003-
RawResponse interface{} `json:"raw_response,omitempty"`
4002+
// JSON output. Or not? What if it's a list?
4003+
Output interface{} `json:"output,omitempty"`
40044004

4005-
// JSON output. What if it's a list?
4006-
//Output map[string]interface{} `json:"output"`
4007-
Output interface{} `json:"output"`
4005+
// Optional. Used for error handling.
4006+
RawResponse interface{} `json:"raw_response,omitempty"`
4007+
Retries int `json:"retries,omitempty"`
40084008
}
40094009

40104010
type CategoryActionFieldOverride struct {
@@ -4804,4 +4804,4 @@ type StreamData struct {
48044804
Type string `json:"type"` // "chunk", "done", "error"
48054805
Chunk string `json:"chunk,omitempty"`
48064806
Data string `json:"data,omitempty"` // For the final ID or error
4807-
}
4807+
}

0 commit comments

Comments
 (0)