Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
feat(toolcall): implement ToolCall logging functionality
Dmitry Ng2ce863ec1ad7
diff --git a/backend/cmd/ftester/mocks/logs.go b/backend/cmd/ftester/mocks/logs.goindex 71b75385..dc53a2d8 100644--- a/backend/cmd/ftester/mocks/logs.go+++ b/backend/cmd/ftester/mocks/logs.go@@ -18,6 +18,7 @@ type ProxyProviders interface {GetSearchLogProvider() tools.SearchLogProviderGetTermLogProvider() tools.TermLogProviderGetVectorStoreLogProvider() tools.VectorStoreLogProvider+ GetToolCallLogProvider() tools.ToolCallLogProviderGetKnowledgeProvider() tools.KnowledgeProvider}@@ -29,6 +30,7 @@ type proxyProviders struct {searchLog *proxySearchLogProvidertermLog *proxyTermLogProvidervectorStoreLog *proxyVectorStoreLogProvider+ toolCallLog *proxyToolCallLogProviderknowledgeProvider *proxyKnowledgeProvider}@@ -41,6 +43,7 @@ func NewProxyProviders() ProxyProviders {searchLog: &proxySearchLogProvider{},termLog: &proxyTermLogProvider{},vectorStoreLog: &proxyVectorStoreLogProvider{},+ toolCallLog: &proxyToolCallLogProvider{},knowledgeProvider: &proxyKnowledgeProvider{},}}@@ -69,6 +72,10 @@ func (p *proxyProviders) GetVectorStoreLogProvider() tools.VectorStoreLogProvidereturn p.vectorStoreLog}+func (p *proxyProviders) GetToolCallLogProvider() tools.ToolCallLogProvider {+ return p.toolCallLog+}+func (p *proxyProviders) GetKnowledgeProvider() tools.KnowledgeProvider {return p.knowledgeProvider}@@ -269,6 +276,44 @@ func (p *proxyVectorStoreLogProvider) PutLog(return 0, nil}+// proxyToolCallLogProvider is a proxy implementation of ToolCallLogProvider+type proxyToolCallLogProvider struct{}++// PutLog implements the ToolCallLogProvider interface+func (p *proxyToolCallLogProvider) PutLog(ctx context.Context, callID string, name string, args json.RawMessage, taskID *int64, subtaskID *int64) (int64, error) {+ terminal.PrintInfo("Tool call log saved:")+ terminal.PrintKeyValue("Call ID", callID)+ terminal.PrintKeyValue("Name", name)+ terminal.PrintKeyValue("Args", string(args))++ if taskID != nil {+ terminal.PrintKeyValueFormat("Task ID", "%d", *taskID)+ }+ if subtaskID != nil {+ terminal.PrintKeyValueFormat("Subtask ID", "%d", *subtaskID)+ }++ return 0, nil+}++// UpdateLogSuccess implements the ToolCallLogProvider interface+func (p *proxyToolCallLogProvider) UpdateLogSuccess(ctx context.Context, id int64, result string, durationSeconds float64) error {+ terminal.PrintInfo("Tool call log success updated:")+ terminal.PrintKeyValueFormat("ID", "%d", id)+ terminal.PrintKeyValue("Result", result)+ terminal.PrintKeyValueFormat("Duration Seconds", "%f", durationSeconds)+ return nil+}++// UpdateLogFailed implements the ToolCallLogProvider interface+func (p *proxyToolCallLogProvider) UpdateLogFailed(ctx context.Context, id int64, result string, durationSeconds float64) error {+ terminal.PrintInfo("Tool call log failed updated:")+ terminal.PrintKeyValueFormat("ID", "%d", id)+ terminal.PrintKeyValue("Result", result)+ terminal.PrintKeyValueFormat("Duration Seconds", "%f", durationSeconds)+ return nil+}+// proxyKnowledgeProvider is a proxy implementation of KnowledgeProvidertype proxyKnowledgeProvider struct{}diff --git a/backend/cmd/ftester/worker/tester.go b/backend/cmd/ftester/worker/tester.goindex 524a2467..c11865d6 100644--- a/backend/cmd/ftester/worker/tester.go+++ b/backend/cmd/ftester/worker/tester.go@@ -81,6 +81,7 @@ func NewTester(flowExecutor.SetSearchLogProvider(proxies.GetSearchLogProvider())flowExecutor.SetTermLogProvider(proxies.GetTermLogProvider())flowExecutor.SetVectorStoreLogProvider(proxies.GetVectorStoreLogProvider())+ flowExecutor.SetToolCallLogProvider(proxies.GetToolCallLogProvider())flowExecutor.SetKnowledgeProvider(proxies.GetKnowledgeProvider())flowExecutor.SetGraphitiClient(providerController.GraphitiClient())diff --git a/backend/docs/flow_execution.md b/backend/docs/flow_execution.mdindex b2a01ed5..f9769136 100644--- a/backend/docs/flow_execution.md+++ b/backend/docs/flow_execution.md@@ -485,6 +485,7 @@ graph TBSearchLogCtrl[Search Log Controller]TermLogCtrl[Terminal Log Controller]VectorLogCtrl[Vector Store Log Controller]+ ToolCallLogCtrl[Tool Call Log Controller]ScreenshotCtrl[Screenshot Controller]AssistantLogCtrl[Assistant Log Controller]end@@ -495,6 +496,7 @@ graph TBSearchLogWorker[Flow Search Log Worker]TermLogWorker[Flow Terminal Log Worker]VectorLogWorker[Flow Vector Store Log Worker]+ ToolCallLogWorker[Flow Tool Call Log Worker]ScreenshotWorker[Flow Screenshot Worker]AssistantLogWorker[Flow Assistant Log Worker]end@@ -505,6 +507,7 @@ graph TBSearchLogDB[(Search Logs<br/>Engine + Query + Result)]TermLogDB[(Terminal Logs<br/>Stdin/Stdout)]VectorLogDB[(Vector Store Logs<br/>Retrieve/Store actions)]+ ToolCallLogDB[(Tool Call Logs<br/>received/running/finished/failed)]ScreenshotDB[(Screenshots<br/>Browser captures)]AssistantLogDB[(Assistant Logs<br/>Interactive conversation)]end@@ -519,6 +522,7 @@ graph TBFlowCtrl --> SearchLogCtrlFlowCtrl --> TermLogCtrlFlowCtrl --> VectorLogCtrl+ FlowCtrl --> ToolCallLogCtrlFlowCtrl --> ScreenshotCtrlFlowCtrl --> AssistantLogCtrl@@ -527,6 +531,7 @@ graph TBSearchLogCtrl --> SearchLogWorkerTermLogCtrl --> TermLogWorkerVectorLogCtrl --> VectorLogWorker+ ToolCallLogCtrl --> ToolCallLogWorkerScreenshotCtrl --> ScreenshotWorkerAssistantLogCtrl --> AssistantLogWorker@@ -535,6 +540,7 @@ graph TBSearchLogWorker --> SearchLogDBTermLogWorker --> TermLogDBVectorLogWorker --> VectorLogDB+ ToolCallLogWorker --> ToolCallLogDBScreenshotWorker --> ScreenshotDBAssistantLogWorker --> AssistantLogDB@@ -543,6 +549,7 @@ graph TBSubtask --> SearchLogWorkerSubtask --> TermLogWorkerSubtask --> VectorLogWorker+ Subtask --> ToolCallLogWorkerSubtask --> ScreenshotWorkerAssistant --> AssistantLogWorker@@ -551,6 +558,7 @@ graph TBSearchLogWorker --> PublisherTermLogWorker --> PublisherVectorLogWorker --> Publisher+ ToolCallLogWorker --> PublisherScreenshotWorker --> PublisherAssistantLogWorker --> Publisher@@ -813,6 +821,7 @@ graph LRGraphQLSubs --> TerminalLogAdded[Terminal Log Added]GraphQLSubs --> SearchLogAdded[Search Log Added]GraphQLSubs --> VectorStoreLogAdded[Vector Store Log Added]+ GraphQLSubs --> ToolCallLogAdded[Tool Call Log Added/Updated]GraphQLSubs --> ScreenshotAdded[Screenshot Added]GraphQLSubs --> AssistantLogAdded[Assistant Log Added/Updated]end@@ -1189,7 +1198,7 @@ The Flow execution system represents a sophisticated orchestration platform that- **Vector knowledge system** - 4 storage types with semantic search and metadata filtering- **Comprehensive tool ecosystem** - 44+ tools across 7 categories with automatic memory storage- **GraphQL subscriptions** - Real-time Flow/Task/Log updates via WebSocket connections-- **Logging architecture** - 7-layer logging system with Controller/Worker pattern+- **Logging architecture** - 8-layer logging system with Controller/Worker pattern### Critical Technical Details@@ -1215,7 +1224,7 @@ The Flow execution system represents a sophisticated orchestration platform that**Flow Publisher Integration**:- **Centralized Updates**: Single publisher coordinates all Flow-related real-time updates-- **Event Types**: 8 different event types (Flow, Task, Agent logs, Message logs, etc.)+- **Event Types**: 10 different event types (Flow, Task, Agent logs, Message logs, Tool Call logs, etc.)- **User-scoped**: Each user gets their own publisher instance for proper isolation- **WebSocket Distribution**: Efficient real-time delivery to frontend clients@@ -1240,7 +1249,7 @@ The Flow execution system represents a sophisticated orchestration platform that- **Graceful degradation**: Automatic fallbacks to simpler operational modes**Real-time & Observability**:-- **7-layer logging**: Comprehensive tracking from agent interactions to terminal commands+- **8-layer logging**: Comprehensive tracking from agent interactions to terminal commands- **GraphQL subscriptions**: Real-time updates via WebSocket connections- **Streaming architecture**: Progressive response delivery with thinking/content separation- **Vector observability**: Complete tracking of knowledge storage and retrieval operationsdiff --git a/backend/pkg/controller/assistant.go b/backend/pkg/controller/assistant.goindex 9f2f9a6f..360321ff 100644--- a/backend/pkg/controller/assistant.go+++ b/backend/pkg/controller/assistant.go@@ -214,6 +214,7 @@ func NewAssistantWorker(ctx context.Context, awc newAssistantWorkerCtx) (Assistaexecutor.SetSearchLogProvider(workers.slw)executor.SetTermLogProvider(workers.tlw)executor.SetVectorStoreLogProvider(workers.vslw)+ executor.SetToolCallLogProvider(workers.tclw)executor.SetKnowledgeProvider(pub)executor.SetGraphitiClient(awc.provs.GraphitiClient())@@ -355,6 +356,7 @@ func LoadAssistantWorker(executor.SetSearchLogProvider(workers.slw)executor.SetTermLogProvider(workers.tlw)executor.SetVectorStoreLogProvider(workers.vslw)+ executor.SetToolCallLogProvider(workers.tclw)executor.SetKnowledgeProvider(pub)var msgChainID int64diff --git a/backend/pkg/controller/flow.go b/backend/pkg/controller/flow.goindex 8eefcbe1..d7f96554 100644--- a/backend/pkg/controller/flow.go+++ b/backend/pkg/controller/flow.go@@ -101,6 +101,7 @@ type flowProviderControllers struct {slc SearchLogControllertlc TermLogControllervslc VectorStoreLogController+ tclc ToolCallLogControllersc ScreenshotController}@@ -110,6 +111,7 @@ type flowProviderWorkers struct {slw FlowSearchLogWorkertlw FlowTermLogWorkervslw FlowVectorStoreLogWorker+ tclw FlowToolCallLogWorkersw FlowScreenshotWorker}@@ -226,6 +228,7 @@ func NewFlowWorker(executor.SetSearchLogProvider(workers.slw)executor.SetTermLogProvider(workers.tlw)executor.SetVectorStoreLogProvider(workers.vslw)+ executor.SetToolCallLogProvider(workers.tclw)executor.SetKnowledgeProvider(pub)executor.SetGraphitiClient(fwc.provs.GraphitiClient())@@ -380,6 +383,7 @@ func LoadFlowWorker(ctx context.Context, flow database.Flow, fwc flowWorkerCtx)executor.SetSearchLogProvider(workers.slw)executor.SetTermLogProvider(workers.tlw)executor.SetVectorStoreLogProvider(workers.vslw)+ executor.SetToolCallLogProvider(workers.tclw)executor.SetKnowledgeProvider(pub)executor.SetGraphitiClient(fwc.provs.GraphitiClient())@@ -1087,6 +1091,11 @@ func newFlowProviderWorkers(return nil, fmt.Errorf("failed to create flow vector store log: %w", err)}+ tclw, err := cnts.tclc.NewFlowToolCallLog(ctx, flowID, pub)+ if err != nil {+ return nil, fmt.Errorf("failed to create flow tool call log: %w", err)+ }+sw, err := cnts.sc.NewFlowScreenshot(ctx, flowID, pub)if err != nil {return nil, fmt.Errorf("failed to create flow screenshot: %w", err)@@ -1098,6 +1107,7 @@ func newFlowProviderWorkers(slw: slw,tlw: tlw,vslw: vslw,+ tclw: tclw,sw: sw,}, nil}@@ -1132,6 +1142,11 @@ func getFlowProviderWorkers(return nil, fmt.Errorf("failed to get flow vector store log: %w", err)}+ tclw, err := cnts.tclc.GetFlowToolCallLog(ctx, flowID)+ if err != nil {+ return nil, fmt.Errorf("failed to get flow tool call log: %w", err)+ }+sw, err := cnts.sc.GetFlowScreenshot(ctx, flowID)if err != nil {return nil, fmt.Errorf("failed to get flow screenshot: %w", err)@@ -1143,6 +1158,7 @@ func getFlowProviderWorkers(slw: slw,tlw: tlw,vslw: vslw,+ tclw: tclw,sw: sw,}, nil}diff --git a/backend/pkg/controller/flows.go b/backend/pkg/controller/flows.goindex 11c52a06..6793e1c4 100644--- a/backend/pkg/controller/flows.go+++ b/backend/pkg/controller/flows.go@@ -66,6 +66,7 @@ type flowController struct {slc SearchLogControllertlc TermLogControllervslc VectorStoreLogController+ tclc ToolCallLogControllersc ScreenshotController}@@ -90,6 +91,7 @@ func NewFlowController(slc: NewSearchLogController(db),tlc: NewTermLogController(db),vslc: NewVectorStoreLogController(db),+ tclc: NewToolCallLogController(db),sc: NewScreenshotController(db),}}@@ -114,6 +116,7 @@ func (fc *flowController) LoadFlows(ctx context.Context) error {slc: fc.slc,tlc: fc.tlc,vslc: fc.vslc,+ tclc: fc.tclc,sc: fc.sc,},})@@ -164,6 +167,7 @@ func (fc *flowController) CreateFlow(slc: fc.slc,tlc: fc.tlc,vslc: fc.vslc,+ tclc: fc.tclc,sc: fc.sc,},},@@ -210,6 +214,7 @@ func (fc *flowController) CreateAssistant(slc: fc.slc,tlc: fc.tlc,vslc: fc.vslc,+ tclc: fc.tclc,sc: fc.sc,},}diff --git a/backend/pkg/controller/tclog.go b/backend/pkg/controller/tclog.gonew file mode 100644index 00000000..52513b1c--- /dev/null+++ b/backend/pkg/controller/tclog.go@@ -0,0 +1,126 @@+package controller++import (+ "context"+ "encoding/json"+ "fmt"+ "sync"++ "pentagi/pkg/database"+ "pentagi/pkg/graph/subscriptions"+)++type FlowToolCallLogWorker interface {+ PutLog(+ ctx context.Context,+ callID string,+ name string,+ args json.RawMessage,+ taskID *int64,+ subtaskID *int64,+ ) (int64, error)+ UpdateLogSuccess(ctx context.Context, id int64, result string, durationSeconds float64) error+ UpdateLogFailed(ctx context.Context, id int64, result string, durationSeconds float64) error+ GetLog(ctx context.Context, id int64) (database.Toolcall, error)+}++type flowToolCallLogWorker struct {+ db database.Querier+ mx *sync.Mutex+ flowID int64+ pub subscriptions.FlowPublisher+}++func NewFlowToolCallLogWorker(+ db database.Querier,+ flowID int64,+ pub subscriptions.FlowPublisher,+) FlowToolCallLogWorker {+ return &flowToolCallLogWorker{+ db: db,+ mx: &sync.Mutex{},+ flowID: flowID,+ pub: pub,+ }+}++func (w *flowToolCallLogWorker) PutLog(+ ctx context.Context,+ callID string,+ name string,+ args json.RawMessage,+ taskID *int64,+ subtaskID *int64,+) (int64, error) {+ w.mx.Lock()+ defer w.mx.Unlock()++ tc, err := w.db.CreateToolcall(ctx, database.CreateToolcallParams{+ CallID: callID,+ Status: database.ToolcallStatusRunning,+ Name: name,+ Args: args,+ FlowID: w.flowID,+ TaskID: database.Int64ToNullInt64(taskID),+ SubtaskID: database.Int64ToNullInt64(subtaskID),+ })+ if err != nil {+ return 0, fmt.Errorf("failed to create tool call log: %w", err)+ }++ w.pub.ToolCallLogAdded(ctx, tc)++ return tc.ID, nil+}++func (w *flowToolCallLogWorker) UpdateLogSuccess(+ ctx context.Context,+ id int64,+ result string,+ durationSeconds float64,+) error {+ tc, err := w.db.UpdateToolcallFinishedResult(ctx, database.UpdateToolcallFinishedResultParams{+ Result: result,+ DurationSeconds: durationSeconds,+ ID: id,+ })+ if err != nil {+ return fmt.Errorf("failed to update tool call log result: %w", err)+ }++ w.pub.ToolCallLogUpdated(ctx, tc)++ return nil+}++func (w *flowToolCallLogWorker) UpdateLogFailed(+ ctx context.Context,+ id int64,+ result string,+ durationSeconds float64,+) error {+ tc, err := w.db.UpdateToolcallFailedResult(ctx, database.UpdateToolcallFailedResultParams{+ Result: result,+ DurationSeconds: durationSeconds,+ ID: id,+ })+ if err != nil {+ return fmt.Errorf("failed to update tool call log failed result: %w", err)+ }++ w.pub.ToolCallLogUpdated(ctx, tc)++ return nil+}++func (w *flowToolCallLogWorker) GetLog(ctx context.Context, id int64) (database.Toolcall, error) {+ tc, err := w.db.GetFlowToolcall(ctx, database.GetFlowToolcallParams{+ ID: id,+ FlowID: w.flowID,+ })+ if err != nil {+ return database.Toolcall{}, fmt.Errorf("failed to get tool call log: %w", err)+ }++ return tc, nil+}diff --git a/backend/pkg/controller/tclogs.go b/backend/pkg/controller/tclogs.gonew file mode 100644index 00000000..02d5f0b0--- /dev/null+++ b/backend/pkg/controller/tclogs.go@@ -0,0 +1,71 @@+package controller++import (+ "context"+ "fmt"+ "sync"++ "pentagi/pkg/database"+ "pentagi/pkg/graph/subscriptions"+)++type ToolCallLogController interface {+ NewFlowToolCallLog(ctx context.Context, flowID int64, pub subscriptions.FlowPublisher) (FlowToolCallLogWorker, error)+ ListFlowsToolCallLog(ctx context.Context) ([]FlowToolCallLogWorker, error)+ GetFlowToolCallLog(ctx context.Context, flowID int64) (FlowToolCallLogWorker, error)+}++type toolCallLogController struct {+ db database.Querier+ mx *sync.Mutex+ flows map[int64]FlowToolCallLogWorker+}++func NewToolCallLogController(db database.Querier) ToolCallLogController {+ return &toolCallLogController{+ db: db,+ mx: &sync.Mutex{},+ flows: make(map[int64]FlowToolCallLogWorker),+ }+}++func (c *toolCallLogController) NewFlowToolCallLog(+ ctx context.Context,+ flowID int64,+ pub subscriptions.FlowPublisher,+) (FlowToolCallLogWorker, error) {+ c.mx.Lock()+ defer c.mx.Unlock()++ flw := NewFlowToolCallLogWorker(c.db, flowID, pub)+ c.flows[flowID] = flw++ return flw, nil+}++func (c *toolCallLogController) ListFlowsToolCallLog(ctx context.Context) ([]FlowToolCallLogWorker, error) {+ c.mx.Lock()+ defer c.mx.Unlock()++ flows := make([]FlowToolCallLogWorker, 0, len(c.flows))+ for _, flw := range c.flows {+ flows = append(flows, flw)+ }++ return flows, nil+}++func (c *toolCallLogController) GetFlowToolCallLog(+ ctx context.Context,+ flowID int64,+) (FlowToolCallLogWorker, error) {+ c.mx.Lock()+ defer c.mx.Unlock()++ flw, ok := c.flows[flowID]+ if !ok {+ return nil, fmt.Errorf("flow not found")+ }++ return flw, nil+}diff --git a/backend/pkg/database/converter/converter.go b/backend/pkg/database/converter/converter.goindex b235edb2..965a02a4 100644--- a/backend/pkg/database/converter/converter.go+++ b/backend/pkg/database/converter/converter.go@@ -301,6 +301,32 @@ func ConvertVectorStoreLog(log database.Vecstorelog) *model.VectorStoreLog {}}+func ConvertToolCallLogs(logs []database.Toolcall) []*model.ToolCallLog {+ glogs := make([]*model.ToolCallLog, 0, len(logs))+ for _, log := range logs {+ glogs = append(glogs, ConvertToolCallLog(log))+ }++ return glogs+}++func ConvertToolCallLog(log database.Toolcall) *model.ToolCallLog {+ return &model.ToolCallLog{+ ID: log.ID,+ CallID: log.CallID,+ Status: model.ToolCallStatus(log.Status),+ Name: log.Name,+ Args: string(log.Args),+ Result: log.Result,+ DurationSeconds: log.DurationSeconds,+ FlowID: log.FlowID,+ TaskID: database.NullInt64ToInt64(log.TaskID),+ SubtaskID: database.NullInt64ToInt64(log.SubtaskID),+ CreatedAt: log.CreatedAt.Time,+ UpdatedAt: log.UpdatedAt.Time,+ }+}+func ConvertAssistantLogs(logs []database.Assistantlog) []*model.AssistantLog {glogs := make([]*model.AssistantLog, 0, len(logs))for _, log := range logs {diff --git a/backend/pkg/database/querier.go b/backend/pkg/database/querier.goindex 6f6335b1..5517efbb 100644--- a/backend/pkg/database/querier.go+++ b/backend/pkg/database/querier.go@@ -101,6 +101,8 @@ type Querier interface {GetFlowTemplate(ctx context.Context, arg GetFlowTemplateParams) (FlowTemplate, error)GetFlowTemplatesByUserID(ctx context.Context, userID int64) ([]FlowTemplate, error)GetFlowTermLogs(ctx context.Context, flowID int64) ([]Termlog, error)+ GetFlowToolcall(ctx context.Context, arg GetFlowToolcallParams) (Toolcall, error)+ GetFlowToolcalls(ctx context.Context, flowID int64) ([]Toolcall, error)// ==================== Toolcalls Analytics Queries ====================// Get total execution time and count of toolcalls for a specific flowGetFlowToolcallsStats(ctx context.Context, flowID int64) (GetFlowToolcallsStatsRow, error)diff --git a/backend/pkg/database/toolcalls.sql.go b/backend/pkg/database/toolcalls.sql.goindex 2f5a8b78..428f8653 100644--- a/backend/pkg/database/toolcalls.sql.go+++ b/backend/pkg/database/toolcalls.sql.go@@ -136,6 +136,84 @@ func (q *Queries) GetCallToolcall(ctx context.Context, callID string) (Toolcall,return i, err}+const getFlowToolcall = `-- name: GetFlowToolcall :one+SELECT+ tc.id, tc.call_id, tc.status, tc.name, tc.args, tc.result, tc.flow_id, tc.task_id, tc.subtask_id, tc.created_at, tc.updated_at, tc.duration_seconds+FROM toolcalls tc+INNER JOIN flows f ON tc.flow_id = f.id+WHERE tc.id = $1 AND tc.flow_id = $2 AND f.deleted_at IS NULL+`++type GetFlowToolcallParams struct {+ ID int64 `json:"id"`+ FlowID int64 `json:"flow_id"`+}++func (q *Queries) GetFlowToolcall(ctx context.Context, arg GetFlowToolcallParams) (Toolcall, error) {+ row := q.db.QueryRowContext(ctx, getFlowToolcall, arg.ID, arg.FlowID)+ var i Toolcall+ err := row.Scan(+ &i.ID,+ &i.CallID,+ &i.Status,+ &i.Name,+ &i.Args,+ &i.Result,+ &i.FlowID,+ &i.TaskID,+ &i.SubtaskID,+ &i.CreatedAt,+ &i.UpdatedAt,+ &i.DurationSeconds,+ )+ return i, err+}++const getFlowToolcalls = `-- name: GetFlowToolcalls :many+SELECT+ tc.id, tc.call_id, tc.status, tc.name, tc.args, tc.result, tc.flow_id, tc.task_id, tc.subtask_id, tc.created_at, tc.updated_at, tc.duration_seconds+FROM toolcalls tc+INNER JOIN flows f ON tc.flow_id = f.id+WHERE tc.flow_id = $1 AND f.deleted_at IS NULL+ORDER BY tc.created_at ASC+`++func (q *Queries) GetFlowToolcalls(ctx context.Context, flowID int64) ([]Toolcall, error) {+ rows, err := q.db.QueryContext(ctx, getFlowToolcalls, flowID)+ if err != nil {+ return nil, err+ }+ defer rows.Close()+ var items []Toolcall+ for rows.Next() {+ var i Toolcall+ if err := rows.Scan(+ &i.ID,+ &i.CallID,+ &i.Status,+ &i.Name,+ &i.Args,+ &i.Result,+ &i.FlowID,+ &i.TaskID,+ &i.SubtaskID,+ &i.CreatedAt,+ &i.UpdatedAt,+ &i.DurationSeconds,+ ); err != nil {+ return nil, err+ }+ items = append(items, i)+ }+ if err := rows.Close(); err != nil {+ return nil, err+ }+ if err := rows.Err(); err != nil {+ return nil, err+ }+ return items, nil+}+const getFlowToolcallsStats = `-- name: GetFlowToolcallsStats :oneSELECTdiff --git a/backend/pkg/graph/generated.go b/backend/pkg/graph/generated.goindex 2b7e4bf0..9ad89c98 100644--- a/backend/pkg/graph/generated.go+++ b/backend/pkg/graph/generated.go@@ -488,6 +488,7 @@ type ComplexityRoot struct {SettingsUser func(childComplexity int) intTasks func(childComplexity int, flowID int64) intTerminalLogs func(childComplexity int, flowID int64) int+ ToolCallLogs func(childComplexity int, flowID int64) intToolcallsStatsByFlow func(childComplexity int, flowID int64) intToolcallsStatsByFunction func(childComplexity int) intToolcallsStatsByFunctionForFlow func(childComplexity int, flowID int64) int@@ -577,6 +578,8 @@ type ComplexityRoot struct {TaskCreated func(childComplexity int, flowID int64) intTaskUpdated func(childComplexity int, flowID int64) intTerminalLogAdded func(childComplexity int, flowID int64) int+ ToolCallLogAdded func(childComplexity int, flowID int64) int+ ToolCallLogUpdated func(childComplexity int, flowID int64) intVectorStoreLogAdded func(childComplexity int, flowID int64) int}@@ -648,6 +651,21 @@ type ComplexityRoot struct {Type func(childComplexity int) int}+ ToolCallLog struct {+ Args func(childComplexity int) int+ CallID func(childComplexity int) int+ CreatedAt func(childComplexity int) int+ DurationSeconds func(childComplexity int) int+ FlowID func(childComplexity int) int+ ID func(childComplexity int) int+ Name func(childComplexity int) int+ Result func(childComplexity int) int+ Status func(childComplexity int) int+ SubtaskID func(childComplexity int) int+ TaskID func(childComplexity int) int+ UpdatedAt func(childComplexity int) int+ }+ToolcallsStats struct {TotalCount func(childComplexity int) intTotalDurationSeconds func(childComplexity int) int@@ -762,6 +780,7 @@ type QueryResolver interface {AgentLogs(ctx context.Context, flowID int64) ([]*model.AgentLog, error)SearchLogs(ctx context.Context, flowID int64) ([]*model.SearchLog, error)VectorStoreLogs(ctx context.Context, flowID int64) ([]*model.VectorStoreLog, error)+ ToolCallLogs(ctx context.Context, flowID int64) ([]*model.ToolCallLog, error)AssistantLogs(ctx context.Context, flowID int64, assistantID int64) ([]*model.AssistantLog, error)UsageStatsTotal(ctx context.Context) (*model.UsageStats, error)UsageStatsByPeriod(ctx context.Context, period model.UsageStatsPeriod) ([]*model.DailyUsageStats, error)@@ -812,6 +831,8 @@ type SubscriptionResolver interface {AgentLogAdded(ctx context.Context, flowID int64) (<-chan *model.AgentLog, error)SearchLogAdded(ctx context.Context, flowID int64) (<-chan *model.SearchLog, error)VectorStoreLogAdded(ctx context.Context, flowID int64) (<-chan *model.VectorStoreLog, error)+ ToolCallLogAdded(ctx context.Context, flowID int64) (<-chan *model.ToolCallLog, error)+ ToolCallLogUpdated(ctx context.Context, flowID int64) (<-chan *model.ToolCallLog, error)AssistantLogAdded(ctx context.Context, flowID int64) (<-chan *model.AssistantLog, error)AssistantLogUpdated(ctx context.Context, flowID int64) (<-chan *model.AssistantLog, error)ProviderCreated(ctx context.Context) (<-chan *model.ProviderConfig, error)@@ -3257,6 +3278,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity inreturn e.complexity.Query.TerminalLogs(childComplexity, args["flowId"].(int64)), true+ case "Query.toolCallLogs":+ if e.complexity.Query.ToolCallLogs == nil {+ break+ }++ args, err := ec.field_Query_toolCallLogs_args(context.TODO(), rawArgs)+ if err != nil {+ return 0, false+ }++ return e.complexity.Query.ToolCallLogs(childComplexity, args["flowId"].(int64)), true+case "Query.toolcallsStatsByFlow":if e.complexity.Query.ToolcallsStatsByFlow == nil {break@@ -3895,6 +3928,30 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity inreturn e.complexity.Subscription.TerminalLogAdded(childComplexity, args["flowId"].(int64)), true+ case "Subscription.toolCallLogAdded":+ if e.complexity.Subscription.ToolCallLogAdded == nil {+ break+ }++ args, err := ec.field_Subscription_toolCallLogAdded_args(context.TODO(), rawArgs)+ if err != nil {+ return 0, false+ }++ return e.complexity.Subscription.ToolCallLogAdded(childComplexity, args["flowId"].(int64)), true++ case "Subscription.toolCallLogUpdated":+ if e.complexity.Subscription.ToolCallLogUpdated == nil {+ break+ }++ args, err := ec.field_Subscription_toolCallLogUpdated_args(context.TODO(), rawArgs)+ if err != nil {+ return 0, false+ }++ return e.complexity.Subscription.ToolCallLogUpdated(childComplexity, args["flowId"].(int64)), true+case "Subscription.vectorStoreLogAdded":if e.complexity.Subscription.VectorStoreLogAdded == nil {break@@ -4236,6 +4293,90 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity inreturn e.complexity.TestResult.Type(childComplexity), true+ case "ToolCallLog.args":+ if e.complexity.ToolCallLog.Args == nil {+ break+ }++ return e.complexity.ToolCallLog.Args(childComplexity), true++ case "ToolCallLog.callId":+ if e.complexity.ToolCallLog.CallID == nil {+ break+ }++ return e.complexity.ToolCallLog.CallID(childComplexity), true++ case "ToolCallLog.createdAt":+ if e.complexity.ToolCallLog.CreatedAt == nil {+ break+ }++ return e.complexity.ToolCallLog.CreatedAt(childComplexity), true++ case "ToolCallLog.durationSeconds":+ if e.complexity.ToolCallLog.DurationSeconds == nil {+ break+ }++ return e.complexity.ToolCallLog.DurationSeconds(childComplexity), true++ case "ToolCallLog.flowId":+ if e.complexity.ToolCallLog.FlowID == nil {+ break+ }++ return e.complexity.ToolCallLog.FlowID(childComplexity), true++ case "ToolCallLog.id":+ if e.complexity.ToolCallLog.ID == nil {+ break+ }++ return e.complexity.ToolCallLog.ID(childComplexity), true++ case "ToolCallLog.name":+ if e.complexity.ToolCallLog.Name == nil {+ break+ }++ return e.complexity.ToolCallLog.Name(childComplexity), true++ case "ToolCallLog.result":+ if e.complexity.ToolCallLog.Result == nil {+ break+ }++ return e.complexity.ToolCallLog.Result(childComplexity), true++ case "ToolCallLog.status":+ if e.complexity.ToolCallLog.Status == nil {+ break+ }++ return e.complexity.ToolCallLog.Status(childComplexity), true++ case "ToolCallLog.subtaskId":+ if e.complexity.ToolCallLog.SubtaskID == nil {+ break+ }++ return e.complexity.ToolCallLog.SubtaskID(childComplexity), true++ case "ToolCallLog.taskId":+ if e.complexity.ToolCallLog.TaskID == nil {+ break+ }++ return e.complexity.ToolCallLog.TaskID(childComplexity), true++ case "ToolCallLog.updatedAt":+ if e.complexity.ToolCallLog.UpdatedAt == nil {+ break+ }++ return e.complexity.ToolCallLog.UpdatedAt(childComplexity), true+case "ToolcallsStats.totalCount":if e.complexity.ToolcallsStats.TotalCount == nil {break@@ -7260,17 +7401,17 @@ func (ec *executionContext) field_Query_terminalLogs_argsFlowID(return zeroVal, nil}-func (ec *executionContext) field_Query_toolcallsStatsByFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+func (ec *executionContext) field_Query_toolCallLogs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {var err errorargs := map[string]interface{}{}- arg0, err := ec.field_Query_toolcallsStatsByFlow_argsFlowID(ctx, rawArgs)+ arg0, err := ec.field_Query_toolCallLogs_argsFlowID(ctx, rawArgs)if err != nil {return nil, err}args["flowId"] = arg0return args, nil}-func (ec *executionContext) field_Query_toolcallsStatsByFlow_argsFlowID(+func (ec *executionContext) field_Query_toolCallLogs_argsFlowID(ctx context.Context,rawArgs map[string]interface{},) (int64, error) {@@ -7292,113 +7433,17 @@ func (ec *executionContext) field_Query_toolcallsStatsByFlow_argsFlowID(return zeroVal, nil}-func (ec *executionContext) field_Query_toolcallsStatsByFunctionForFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {- var err error- args := map[string]interface{}{}- arg0, err := ec.field_Query_toolcallsStatsByFunctionForFlow_argsFlowID(ctx, rawArgs)- if err != nil {- return nil, err- }- args["flowId"] = arg0- return args, nil-}-func (ec *executionContext) field_Query_toolcallsStatsByFunctionForFlow_argsFlowID(- ctx context.Context,- rawArgs map[string]interface{},-) (int64, error) {- // We won't call the directive if the argument is null.- // Set call_argument_directives_with_null to true to call directives- // even if the argument is null.- _, ok := rawArgs["flowId"]- if !ok {- var zeroVal int64- return zeroVal, nil- }-- ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))- if tmp, ok := rawArgs["flowId"]; ok {- return ec.unmarshalNID2int64(ctx, tmp)- }-- var zeroVal int64- return zeroVal, nil-}--func (ec *executionContext) field_Query_toolcallsStatsByPeriod_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {- var err error- args := map[string]interface{}{}- arg0, err := ec.field_Query_toolcallsStatsByPeriod_argsPeriod(ctx, rawArgs)- if err != nil {- return nil, err- }- args["period"] = arg0- return args, nil-}-func (ec *executionContext) field_Query_toolcallsStatsByPeriod_argsPeriod(- ctx context.Context,- rawArgs map[string]interface{},-) (model.UsageStatsPeriod, error) {- // We won't call the directive if the argument is null.- // Set call_argument_directives_with_null to true to call directives- // even if the argument is null.- _, ok := rawArgs["period"]- if !ok {- var zeroVal model.UsageStatsPeriod- return zeroVal, nil- }-- ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("period"))- if tmp, ok := rawArgs["period"]; ok {- return ec.unmarshalNUsageStatsPeriod2pentagiᚋpkgᚋgraphᚋmodelᚐUsageStatsPeriod(ctx, tmp)- }-- var zeroVal model.UsageStatsPeriod- return zeroVal, nil-}--func (ec *executionContext) field_Query_usageStatsByAgentTypeForFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {- var err error- args := map[string]interface{}{}- arg0, err := ec.field_Query_usageStatsByAgentTypeForFlow_argsFlowID(ctx, rawArgs)- if err != nil {- return nil, err- }- args["flowId"] = arg0- return args, nil-}-func (ec *executionContext) field_Query_usageStatsByAgentTypeForFlow_argsFlowID(- ctx context.Context,- rawArgs map[string]interface{},-) (int64, error) {- // We won't call the directive if the argument is null.- // Set call_argument_directives_with_null to true to call directives- // even if the argument is null.- _, ok := rawArgs["flowId"]- if !ok {- var zeroVal int64- return zeroVal, nil- }-- ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))- if tmp, ok := rawArgs["flowId"]; ok {- return ec.unmarshalNID2int64(ctx, tmp)- }-- var zeroVal int64- return zeroVal, nil-}--func (ec *executionContext) field_Query_usageStatsByFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+func (ec *executionContext) field_Query_toolcallsStatsByFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {var err errorargs := map[string]interface{}{}- arg0, err := ec.field_Query_usageStatsByFlow_argsFlowID(ctx, rawArgs)+ arg0, err := ec.field_Query_toolcallsStatsByFlow_argsFlowID(ctx, rawArgs)if err != nil {return nil, err}args["flowId"] = arg0return args, nil}-func (ec *executionContext) field_Query_usageStatsByFlow_argsFlowID(+func (ec *executionContext) field_Query_toolcallsStatsByFlow_argsFlowID(ctx context.Context,rawArgs map[string]interface{},) (int64, error) {@@ -7420,17 +7465,17 @@ func (ec *executionContext) field_Query_usageStatsByFlow_argsFlowID(return zeroVal, nil}-func (ec *executionContext) field_Query_usageStatsByModelAgentsForFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+func (ec *executionContext) field_Query_toolcallsStatsByFunctionForFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {var err errorargs := map[string]interface{}{}- arg0, err := ec.field_Query_usageStatsByModelAgentsForFlow_argsFlowID(ctx, rawArgs)+ arg0, err := ec.field_Query_toolcallsStatsByFunctionForFlow_argsFlowID(ctx, rawArgs)if err != nil {return nil, err}args["flowId"] = arg0return args, nil}-func (ec *executionContext) field_Query_usageStatsByModelAgentsForFlow_argsFlowID(+func (ec *executionContext) field_Query_toolcallsStatsByFunctionForFlow_argsFlowID(ctx context.Context,rawArgs map[string]interface{},) (int64, error) {@@ -7452,17 +7497,17 @@ func (ec *executionContext) field_Query_usageStatsByModelAgentsForFlow_argsFlowIreturn zeroVal, nil}-func (ec *executionContext) field_Query_usageStatsByPeriod_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+func (ec *executionContext) field_Query_toolcallsStatsByPeriod_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {var err errorargs := map[string]interface{}{}- arg0, err := ec.field_Query_usageStatsByPeriod_argsPeriod(ctx, rawArgs)+ arg0, err := ec.field_Query_toolcallsStatsByPeriod_argsPeriod(ctx, rawArgs)if err != nil {return nil, err}args["period"] = arg0return args, nil}-func (ec *executionContext) field_Query_usageStatsByPeriod_argsPeriod(+func (ec *executionContext) field_Query_toolcallsStatsByPeriod_argsPeriod(ctx context.Context,rawArgs map[string]interface{},) (model.UsageStatsPeriod, error) {@@ -7484,81 +7529,17 @@ func (ec *executionContext) field_Query_usageStatsByPeriod_argsPeriod(return zeroVal, nil}-func (ec *executionContext) field_Query_vectorStoreLogs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {- var err error- args := map[string]interface{}{}- arg0, err := ec.field_Query_vectorStoreLogs_argsFlowID(ctx, rawArgs)- if err != nil {- return nil, err- }- args["flowId"] = arg0- return args, nil-}-func (ec *executionContext) field_Query_vectorStoreLogs_argsFlowID(- ctx context.Context,- rawArgs map[string]interface{},-) (int64, error) {- // We won't call the directive if the argument is null.- // Set call_argument_directives_with_null to true to call directives- // even if the argument is null.- _, ok := rawArgs["flowId"]- if !ok {- var zeroVal int64- return zeroVal, nil- }-- ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))- if tmp, ok := rawArgs["flowId"]; ok {- return ec.unmarshalNID2int64(ctx, tmp)- }-- var zeroVal int64- return zeroVal, nil-}--func (ec *executionContext) field_Subscription_agentLogAdded_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {- var err error- args := map[string]interface{}{}- arg0, err := ec.field_Subscription_agentLogAdded_argsFlowID(ctx, rawArgs)- if err != nil {- return nil, err- }- args["flowId"] = arg0- return args, nil-}-func (ec *executionContext) field_Subscription_agentLogAdded_argsFlowID(- ctx context.Context,- rawArgs map[string]interface{},-) (int64, error) {- // We won't call the directive if the argument is null.- // Set call_argument_directives_with_null to true to call directives- // even if the argument is null.- _, ok := rawArgs["flowId"]- if !ok {- var zeroVal int64- return zeroVal, nil- }-- ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))- if tmp, ok := rawArgs["flowId"]; ok {- return ec.unmarshalNID2int64(ctx, tmp)- }-- var zeroVal int64- return zeroVal, nil-}--func (ec *executionContext) field_Subscription_assistantCreated_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+func (ec *executionContext) field_Query_usageStatsByAgentTypeForFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {var err errorargs := map[string]interface{}{}- arg0, err := ec.field_Subscription_assistantCreated_argsFlowID(ctx, rawArgs)+ arg0, err := ec.field_Query_usageStatsByAgentTypeForFlow_argsFlowID(ctx, rawArgs)if err != nil {return nil, err}args["flowId"] = arg0return args, nil}-func (ec *executionContext) field_Subscription_assistantCreated_argsFlowID(+func (ec *executionContext) field_Query_usageStatsByAgentTypeForFlow_argsFlowID(ctx context.Context,rawArgs map[string]interface{},) (int64, error) {@@ -7580,17 +7561,209 @@ func (ec *executionContext) field_Subscription_assistantCreated_argsFlowID(return zeroVal, nil}-func (ec *executionContext) field_Subscription_assistantDeleted_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+func (ec *executionContext) field_Query_usageStatsByFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {var err errorargs := map[string]interface{}{}- arg0, err := ec.field_Subscription_assistantDeleted_argsFlowID(ctx, rawArgs)+ arg0, err := ec.field_Query_usageStatsByFlow_argsFlowID(ctx, rawArgs)if err != nil {return nil, err}args["flowId"] = arg0return args, nil}-func (ec *executionContext) field_Subscription_assistantDeleted_argsFlowID(+func (ec *executionContext) field_Query_usageStatsByFlow_argsFlowID(+ ctx context.Context,+ rawArgs map[string]interface{},+) (int64, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["flowId"]+ if !ok {+ var zeroVal int64+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))+ if tmp, ok := rawArgs["flowId"]; ok {+ return ec.unmarshalNID2int64(ctx, tmp)+ }++ var zeroVal int64+ return zeroVal, nil+}++func (ec *executionContext) field_Query_usageStatsByModelAgentsForFlow_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Query_usageStatsByModelAgentsForFlow_argsFlowID(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["flowId"] = arg0+ return args, nil+}+func (ec *executionContext) field_Query_usageStatsByModelAgentsForFlow_argsFlowID(+ ctx context.Context,+ rawArgs map[string]interface{},+) (int64, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["flowId"]+ if !ok {+ var zeroVal int64+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))+ if tmp, ok := rawArgs["flowId"]; ok {+ return ec.unmarshalNID2int64(ctx, tmp)+ }++ var zeroVal int64+ return zeroVal, nil+}++func (ec *executionContext) field_Query_usageStatsByPeriod_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Query_usageStatsByPeriod_argsPeriod(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["period"] = arg0+ return args, nil+}+func (ec *executionContext) field_Query_usageStatsByPeriod_argsPeriod(+ ctx context.Context,+ rawArgs map[string]interface{},+) (model.UsageStatsPeriod, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["period"]+ if !ok {+ var zeroVal model.UsageStatsPeriod+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("period"))+ if tmp, ok := rawArgs["period"]; ok {+ return ec.unmarshalNUsageStatsPeriod2pentagiᚋpkgᚋgraphᚋmodelᚐUsageStatsPeriod(ctx, tmp)+ }++ var zeroVal model.UsageStatsPeriod+ return zeroVal, nil+}++func (ec *executionContext) field_Query_vectorStoreLogs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Query_vectorStoreLogs_argsFlowID(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["flowId"] = arg0+ return args, nil+}+func (ec *executionContext) field_Query_vectorStoreLogs_argsFlowID(+ ctx context.Context,+ rawArgs map[string]interface{},+) (int64, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["flowId"]+ if !ok {+ var zeroVal int64+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))+ if tmp, ok := rawArgs["flowId"]; ok {+ return ec.unmarshalNID2int64(ctx, tmp)+ }++ var zeroVal int64+ return zeroVal, nil+}++func (ec *executionContext) field_Subscription_agentLogAdded_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Subscription_agentLogAdded_argsFlowID(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["flowId"] = arg0+ return args, nil+}+func (ec *executionContext) field_Subscription_agentLogAdded_argsFlowID(+ ctx context.Context,+ rawArgs map[string]interface{},+) (int64, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["flowId"]+ if !ok {+ var zeroVal int64+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))+ if tmp, ok := rawArgs["flowId"]; ok {+ return ec.unmarshalNID2int64(ctx, tmp)+ }++ var zeroVal int64+ return zeroVal, nil+}++func (ec *executionContext) field_Subscription_assistantCreated_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Subscription_assistantCreated_argsFlowID(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["flowId"] = arg0+ return args, nil+}+func (ec *executionContext) field_Subscription_assistantCreated_argsFlowID(+ ctx context.Context,+ rawArgs map[string]interface{},+) (int64, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["flowId"]+ if !ok {+ var zeroVal int64+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))+ if tmp, ok := rawArgs["flowId"]; ok {+ return ec.unmarshalNID2int64(ctx, tmp)+ }++ var zeroVal int64+ return zeroVal, nil+}++func (ec *executionContext) field_Subscription_assistantDeleted_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Subscription_assistantDeleted_argsFlowID(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["flowId"] = arg0+ return args, nil+}+func (ec *executionContext) field_Subscription_assistantDeleted_argsFlowID(ctx context.Context,rawArgs map[string]interface{},) (int64, error) {@@ -8028,6 +8201,70 @@ func (ec *executionContext) field_Subscription_terminalLogAdded_argsFlowID(return zeroVal, nil}+func (ec *executionContext) field_Subscription_toolCallLogAdded_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Subscription_toolCallLogAdded_argsFlowID(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["flowId"] = arg0+ return args, nil+}+func (ec *executionContext) field_Subscription_toolCallLogAdded_argsFlowID(+ ctx context.Context,+ rawArgs map[string]interface{},+) (int64, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["flowId"]+ if !ok {+ var zeroVal int64+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))+ if tmp, ok := rawArgs["flowId"]; ok {+ return ec.unmarshalNID2int64(ctx, tmp)+ }++ var zeroVal int64+ return zeroVal, nil+}++func (ec *executionContext) field_Subscription_toolCallLogUpdated_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {+ var err error+ args := map[string]interface{}{}+ arg0, err := ec.field_Subscription_toolCallLogUpdated_argsFlowID(ctx, rawArgs)+ if err != nil {+ return nil, err+ }+ args["flowId"] = arg0+ return args, nil+}+func (ec *executionContext) field_Subscription_toolCallLogUpdated_argsFlowID(+ ctx context.Context,+ rawArgs map[string]interface{},+) (int64, error) {+ // We won't call the directive if the argument is null.+ // Set call_argument_directives_with_null to true to call directives+ // even if the argument is null.+ _, ok := rawArgs["flowId"]+ if !ok {+ var zeroVal int64+ return zeroVal, nil+ }++ ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("flowId"))+ if tmp, ok := rawArgs["flowId"]; ok {+ return ec.unmarshalNID2int64(ctx, tmp)+ }++ var zeroVal int64+ return zeroVal, nil+}+func (ec *executionContext) field_Subscription_vectorStoreLogAdded_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {var err errorargs := map[string]interface{}{}@@ -22904,6 +23141,84 @@ func (ec *executionContext) fieldContext_Query_vectorStoreLogs(ctx context.Contereturn fc, nil}+func (ec *executionContext) _Query_toolCallLogs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_Query_toolCallLogs(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return ec.resolvers.Query().ToolCallLogs(rctx, fc.Args["flowId"].(int64))+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ return graphql.Null+ }+ res := resTmp.([]*model.ToolCallLog)+ fc.Result = res+ return ec.marshalOToolCallLog2ᚕᚖpentagiᚋpkgᚋgraphᚋmodelᚐToolCallLogᚄ(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_Query_toolCallLogs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "Query",+ Field: field,+ IsMethod: true,+ IsResolver: true,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ switch field.Name {+ case "id":+ return ec.fieldContext_ToolCallLog_id(ctx, field)+ case "callId":+ return ec.fieldContext_ToolCallLog_callId(ctx, field)+ case "status":+ return ec.fieldContext_ToolCallLog_status(ctx, field)+ case "name":+ return ec.fieldContext_ToolCallLog_name(ctx, field)+ case "args":+ return ec.fieldContext_ToolCallLog_args(ctx, field)+ case "result":+ return ec.fieldContext_ToolCallLog_result(ctx, field)+ case "durationSeconds":+ return ec.fieldContext_ToolCallLog_durationSeconds(ctx, field)+ case "flowId":+ return ec.fieldContext_ToolCallLog_flowId(ctx, field)+ case "taskId":+ return ec.fieldContext_ToolCallLog_taskId(ctx, field)+ case "subtaskId":+ return ec.fieldContext_ToolCallLog_subtaskId(ctx, field)+ case "createdAt":+ return ec.fieldContext_ToolCallLog_createdAt(ctx, field)+ case "updatedAt":+ return ec.fieldContext_ToolCallLog_updatedAt(ctx, field)+ }+ return nil, fmt.Errorf("no field named %q was found under type ToolCallLog", field.Name)+ },+ }+ defer func() {+ if r := recover(); r != nil {+ err = ec.Recover(ctx, r)+ ec.Error(ctx, err)+ }+ }()+ ctx = graphql.WithFieldContext(ctx, fc)+ if fc.Args, err = ec.field_Query_toolCallLogs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {+ ec.Error(ctx, err)+ return fc, err+ }+ return fc, nil+}+func (ec *executionContext) _Query_assistantLogs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {fc, err := ec.fieldContext_Query_assistantLogs(ctx, field)if err != nil {@@ -27514,6 +27829,196 @@ func (ec *executionContext) fieldContext_Subscription_vectorStoreLogAdded(ctx coreturn fc, nil}+func (ec *executionContext) _Subscription_toolCallLogAdded(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {+ fc, err := ec.fieldContext_Subscription_toolCallLogAdded(ctx, field)+ if err != nil {+ return nil+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = nil+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return ec.resolvers.Subscription().ToolCallLogAdded(rctx, fc.Args["flowId"].(int64))+ })+ if err != nil {+ ec.Error(ctx, err)+ return nil+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return nil+ }+ return func(ctx context.Context) graphql.Marshaler {+ select {+ case res, ok := <-resTmp.(<-chan *model.ToolCallLog):+ if !ok {+ return nil+ }+ return graphql.WriterFunc(func(w io.Writer) {+ w.Write([]byte{'{'})+ graphql.MarshalString(field.Alias).MarshalGQL(w)+ w.Write([]byte{':'})+ ec.marshalNToolCallLog2ᚖpentagiᚋpkgᚋgraphᚋmodelᚐToolCallLog(ctx, field.Selections, res).MarshalGQL(w)+ w.Write([]byte{'}'})+ })+ case <-ctx.Done():+ return nil+ }+ }+}++func (ec *executionContext) fieldContext_Subscription_toolCallLogAdded(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "Subscription",+ Field: field,+ IsMethod: true,+ IsResolver: true,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ switch field.Name {+ case "id":+ return ec.fieldContext_ToolCallLog_id(ctx, field)+ case "callId":+ return ec.fieldContext_ToolCallLog_callId(ctx, field)+ case "status":+ return ec.fieldContext_ToolCallLog_status(ctx, field)+ case "name":+ return ec.fieldContext_ToolCallLog_name(ctx, field)+ case "args":+ return ec.fieldContext_ToolCallLog_args(ctx, field)+ case "result":+ return ec.fieldContext_ToolCallLog_result(ctx, field)+ case "durationSeconds":+ return ec.fieldContext_ToolCallLog_durationSeconds(ctx, field)+ case "flowId":+ return ec.fieldContext_ToolCallLog_flowId(ctx, field)+ case "taskId":+ return ec.fieldContext_ToolCallLog_taskId(ctx, field)+ case "subtaskId":+ return ec.fieldContext_ToolCallLog_subtaskId(ctx, field)+ case "createdAt":+ return ec.fieldContext_ToolCallLog_createdAt(ctx, field)+ case "updatedAt":+ return ec.fieldContext_ToolCallLog_updatedAt(ctx, field)+ }+ return nil, fmt.Errorf("no field named %q was found under type ToolCallLog", field.Name)+ },+ }+ defer func() {+ if r := recover(); r != nil {+ err = ec.Recover(ctx, r)+ ec.Error(ctx, err)+ }+ }()+ ctx = graphql.WithFieldContext(ctx, fc)+ if fc.Args, err = ec.field_Subscription_toolCallLogAdded_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {+ ec.Error(ctx, err)+ return fc, err+ }+ return fc, nil+}++func (ec *executionContext) _Subscription_toolCallLogUpdated(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {+ fc, err := ec.fieldContext_Subscription_toolCallLogUpdated(ctx, field)+ if err != nil {+ return nil+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = nil+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return ec.resolvers.Subscription().ToolCallLogUpdated(rctx, fc.Args["flowId"].(int64))+ })+ if err != nil {+ ec.Error(ctx, err)+ return nil+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return nil+ }+ return func(ctx context.Context) graphql.Marshaler {+ select {+ case res, ok := <-resTmp.(<-chan *model.ToolCallLog):+ if !ok {+ return nil+ }+ return graphql.WriterFunc(func(w io.Writer) {+ w.Write([]byte{'{'})+ graphql.MarshalString(field.Alias).MarshalGQL(w)+ w.Write([]byte{':'})+ ec.marshalNToolCallLog2ᚖpentagiᚋpkgᚋgraphᚋmodelᚐToolCallLog(ctx, field.Selections, res).MarshalGQL(w)+ w.Write([]byte{'}'})+ })+ case <-ctx.Done():+ return nil+ }+ }+}++func (ec *executionContext) fieldContext_Subscription_toolCallLogUpdated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "Subscription",+ Field: field,+ IsMethod: true,+ IsResolver: true,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ switch field.Name {+ case "id":+ return ec.fieldContext_ToolCallLog_id(ctx, field)+ case "callId":+ return ec.fieldContext_ToolCallLog_callId(ctx, field)+ case "status":+ return ec.fieldContext_ToolCallLog_status(ctx, field)+ case "name":+ return ec.fieldContext_ToolCallLog_name(ctx, field)+ case "args":+ return ec.fieldContext_ToolCallLog_args(ctx, field)+ case "result":+ return ec.fieldContext_ToolCallLog_result(ctx, field)+ case "durationSeconds":+ return ec.fieldContext_ToolCallLog_durationSeconds(ctx, field)+ case "flowId":+ return ec.fieldContext_ToolCallLog_flowId(ctx, field)+ case "taskId":+ return ec.fieldContext_ToolCallLog_taskId(ctx, field)+ case "subtaskId":+ return ec.fieldContext_ToolCallLog_subtaskId(ctx, field)+ case "createdAt":+ return ec.fieldContext_ToolCallLog_createdAt(ctx, field)+ case "updatedAt":+ return ec.fieldContext_ToolCallLog_updatedAt(ctx, field)+ }+ return nil, fmt.Errorf("no field named %q was found under type ToolCallLog", field.Name)+ },+ }+ defer func() {+ if r := recover(); r != nil {+ err = ec.Recover(ctx, r)+ ec.Error(ctx, err)+ }+ }()+ ctx = graphql.WithFieldContext(ctx, fc)+ if fc.Args, err = ec.field_Subscription_toolCallLogUpdated_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {+ ec.Error(ctx, err)+ return fc, err+ }+ return fc, nil+}+func (ec *executionContext) _Subscription_assistantLogAdded(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {fc, err := ec.fieldContext_Subscription_assistantLogAdded(ctx, field)if err != nil {@@ -30817,26 +31322,460 @@ func (ec *executionContext) _TestResult_result(ctx context.Context, field graphq}return graphql.Null}- res := resTmp.(bool)+ res := resTmp.(bool)+ fc.Result = res+ return ec.marshalNBoolean2bool(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_TestResult_result(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "TestResult",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type Boolean does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _TestResult_reasoning(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_TestResult_reasoning(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Reasoning, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(bool)+ fc.Result = res+ return ec.marshalNBoolean2bool(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_TestResult_reasoning(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "TestResult",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type Boolean does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _TestResult_streaming(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_TestResult_streaming(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Streaming, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(bool)+ fc.Result = res+ return ec.marshalNBoolean2bool(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_TestResult_streaming(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "TestResult",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type Boolean does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _TestResult_latency(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_TestResult_latency(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Latency, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ return graphql.Null+ }+ res := resTmp.(*int)+ fc.Result = res+ return ec.marshalOInt2ᚖint(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_TestResult_latency(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "TestResult",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type Int does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _TestResult_error(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_TestResult_error(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Error, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ return graphql.Null+ }+ res := resTmp.(*string)+ fc.Result = res+ return ec.marshalOString2ᚖstring(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_TestResult_error(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "TestResult",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type String does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_id(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_id(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.ID, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(int64)+ fc.Result = res+ return ec.marshalNID2int64(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_ToolCallLog_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "ToolCallLog",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type ID does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_callId(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_callId(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.CallID, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(string)+ fc.Result = res+ return ec.marshalNString2string(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_ToolCallLog_callId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "ToolCallLog",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type String does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_status(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_status(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Status, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(model.ToolCallStatus)+ fc.Result = res+ return ec.marshalNToolCallStatus2pentagiᚋpkgᚋgraphᚋmodelᚐToolCallStatus(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_ToolCallLog_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "ToolCallLog",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type ToolCallStatus does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_name(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_name(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Name, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(string)+ fc.Result = res+ return ec.marshalNString2string(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_ToolCallLog_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "ToolCallLog",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type String does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_args(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_args(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Args, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(string)+ fc.Result = res+ return ec.marshalNString2string(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_ToolCallLog_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "ToolCallLog",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type String does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_result(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_result(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.Result, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(string)fc.Result = res- return ec.marshalNBoolean2bool(ctx, field.Selections, res)+ return ec.marshalNString2string(ctx, field.Selections, res)}-func (ec *executionContext) fieldContext_TestResult_result(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+func (ec *executionContext) fieldContext_ToolCallLog_result(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {fc = &graphql.FieldContext{- Object: "TestResult",+ Object: "ToolCallLog",Field: field,IsMethod: false,IsResolver: false,Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {- return nil, errors.New("field of type Boolean does not have child fields")+ return nil, errors.New("field of type String does not have child fields")},}return fc, nil}-func (ec *executionContext) _TestResult_reasoning(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {- fc, err := ec.fieldContext_TestResult_reasoning(ctx, field)+func (ec *executionContext) _ToolCallLog_durationSeconds(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_durationSeconds(ctx, field)if err != nil {return graphql.Null}@@ -30849,7 +31788,7 @@ func (ec *executionContext) _TestResult_reasoning(ctx context.Context, field gra}()resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {ctx = rctx // use context from middleware stack in children- return obj.Reasoning, nil+ return obj.DurationSeconds, nil})if err != nil {ec.Error(ctx, err)@@ -30861,26 +31800,26 @@ func (ec *executionContext) _TestResult_reasoning(ctx context.Context, field gra}return graphql.Null}- res := resTmp.(bool)+ res := resTmp.(float64)fc.Result = res- return ec.marshalNBoolean2bool(ctx, field.Selections, res)+ return ec.marshalNFloat2float64(ctx, field.Selections, res)}-func (ec *executionContext) fieldContext_TestResult_reasoning(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+func (ec *executionContext) fieldContext_ToolCallLog_durationSeconds(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {fc = &graphql.FieldContext{- Object: "TestResult",+ Object: "ToolCallLog",Field: field,IsMethod: false,IsResolver: false,Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {- return nil, errors.New("field of type Boolean does not have child fields")+ return nil, errors.New("field of type Float does not have child fields")},}return fc, nil}-func (ec *executionContext) _TestResult_streaming(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {- fc, err := ec.fieldContext_TestResult_streaming(ctx, field)+func (ec *executionContext) _ToolCallLog_flowId(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_flowId(ctx, field)if err != nil {return graphql.Null}@@ -30893,7 +31832,7 @@ func (ec *executionContext) _TestResult_streaming(ctx context.Context, field gra}()resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {ctx = rctx // use context from middleware stack in children- return obj.Streaming, nil+ return obj.FlowID, nil})if err != nil {ec.Error(ctx, err)@@ -30905,26 +31844,26 @@ func (ec *executionContext) _TestResult_streaming(ctx context.Context, field gra}return graphql.Null}- res := resTmp.(bool)+ res := resTmp.(int64)fc.Result = res- return ec.marshalNBoolean2bool(ctx, field.Selections, res)+ return ec.marshalNID2int64(ctx, field.Selections, res)}-func (ec *executionContext) fieldContext_TestResult_streaming(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+func (ec *executionContext) fieldContext_ToolCallLog_flowId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {fc = &graphql.FieldContext{- Object: "TestResult",+ Object: "ToolCallLog",Field: field,IsMethod: false,IsResolver: false,Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {- return nil, errors.New("field of type Boolean does not have child fields")+ return nil, errors.New("field of type ID does not have child fields")},}return fc, nil}-func (ec *executionContext) _TestResult_latency(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {- fc, err := ec.fieldContext_TestResult_latency(ctx, field)+func (ec *executionContext) _ToolCallLog_taskId(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_taskId(ctx, field)if err != nil {return graphql.Null}@@ -30937,7 +31876,7 @@ func (ec *executionContext) _TestResult_latency(ctx context.Context, field graph}()resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {ctx = rctx // use context from middleware stack in children- return obj.Latency, nil+ return obj.TaskID, nil})if err != nil {ec.Error(ctx, err)@@ -30946,26 +31885,26 @@ func (ec *executionContext) _TestResult_latency(ctx context.Context, field graphif resTmp == nil {return graphql.Null}- res := resTmp.(*int)+ res := resTmp.(*int64)fc.Result = res- return ec.marshalOInt2ᚖint(ctx, field.Selections, res)+ return ec.marshalOID2ᚖint64(ctx, field.Selections, res)}-func (ec *executionContext) fieldContext_TestResult_latency(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+func (ec *executionContext) fieldContext_ToolCallLog_taskId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {fc = &graphql.FieldContext{- Object: "TestResult",+ Object: "ToolCallLog",Field: field,IsMethod: false,IsResolver: false,Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {- return nil, errors.New("field of type Int does not have child fields")+ return nil, errors.New("field of type ID does not have child fields")},}return fc, nil}-func (ec *executionContext) _TestResult_error(ctx context.Context, field graphql.CollectedField, obj *model.TestResult) (ret graphql.Marshaler) {- fc, err := ec.fieldContext_TestResult_error(ctx, field)+func (ec *executionContext) _ToolCallLog_subtaskId(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_subtaskId(ctx, field)if err != nil {return graphql.Null}@@ -30978,7 +31917,7 @@ func (ec *executionContext) _TestResult_error(ctx context.Context, field graphql}()resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {ctx = rctx // use context from middleware stack in children- return obj.Error, nil+ return obj.SubtaskID, nil})if err != nil {ec.Error(ctx, err)@@ -30987,19 +31926,107 @@ func (ec *executionContext) _TestResult_error(ctx context.Context, field graphqlif resTmp == nil {return graphql.Null}- res := resTmp.(*string)+ res := resTmp.(*int64)fc.Result = res- return ec.marshalOString2ᚖstring(ctx, field.Selections, res)+ return ec.marshalOID2ᚖint64(ctx, field.Selections, res)}-func (ec *executionContext) fieldContext_TestResult_error(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+func (ec *executionContext) fieldContext_ToolCallLog_subtaskId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {fc = &graphql.FieldContext{- Object: "TestResult",+ Object: "ToolCallLog",Field: field,IsMethod: false,IsResolver: false,Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {- return nil, errors.New("field of type String does not have child fields")+ return nil, errors.New("field of type ID does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_createdAt(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.CreatedAt, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(time.Time)+ fc.Result = res+ return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_ToolCallLog_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "ToolCallLog",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type Time does not have child fields")+ },+ }+ return fc, nil+}++func (ec *executionContext) _ToolCallLog_updatedAt(ctx context.Context, field graphql.CollectedField, obj *model.ToolCallLog) (ret graphql.Marshaler) {+ fc, err := ec.fieldContext_ToolCallLog_updatedAt(ctx, field)+ if err != nil {+ return graphql.Null+ }+ ctx = graphql.WithFieldContext(ctx, fc)+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = graphql.Null+ }+ }()+ resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {+ ctx = rctx // use context from middleware stack in children+ return obj.UpdatedAt, nil+ })+ if err != nil {+ ec.Error(ctx, err)+ return graphql.Null+ }+ if resTmp == nil {+ if !graphql.HasFieldError(ctx, fc) {+ ec.Errorf(ctx, "must not be null")+ }+ return graphql.Null+ }+ res := resTmp.(time.Time)+ fc.Result = res+ return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)+}++func (ec *executionContext) fieldContext_ToolCallLog_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {+ fc = &graphql.FieldContext{+ Object: "ToolCallLog",+ Field: field,+ IsMethod: false,+ IsResolver: false,+ Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {+ return nil, errors.New("field of type Time does not have child fields")},}return fc, nil@@ -38564,6 +39591,25 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) grfunc(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })}+ out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })+ case "toolCallLogs":+ field := field++ innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ }+ }()+ res = ec._Query_toolCallLogs(ctx, field)+ return res+ }++ rrm := func(ctx context.Context) graphql.Marshaler {+ return ec.OperationContext.RootResolverMiddleware(ctx,+ func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })+ }+out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })case "assistantLogs":field := field@@ -39539,6 +40585,10 @@ func (ec *executionContext) _Subscription(ctx context.Context, sel ast.Selectionreturn ec._Subscription_searchLogAdded(ctx, fields[0])case "vectorStoreLogAdded":return ec._Subscription_vectorStoreLogAdded(ctx, fields[0])+ case "toolCallLogAdded":+ return ec._Subscription_toolCallLogAdded(ctx, fields[0])+ case "toolCallLogUpdated":+ return ec._Subscription_toolCallLogUpdated(ctx, fields[0])case "assistantLogAdded":return ec._Subscription_assistantLogAdded(ctx, fields[0])case "assistantLogUpdated":@@ -39708,56 +40758,247 @@ func (ec *executionContext) _SubtaskExecutionStats(ctx context.Context, sel ast.return out}-var taskImplementors = []string{"Task"}+var taskImplementors = []string{"Task"}++func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj *model.Task) graphql.Marshaler {+ fields := graphql.CollectFields(ec.OperationContext, sel, taskImplementors)++ out := graphql.NewFieldSet(fields)+ deferred := make(map[string]*graphql.FieldSet)+ for i, field := range fields {+ switch field.Name {+ case "__typename":+ out.Values[i] = graphql.MarshalString("Task")+ case "id":+ out.Values[i] = ec._Task_id(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "title":+ out.Values[i] = ec._Task_title(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "status":+ out.Values[i] = ec._Task_status(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "input":+ out.Values[i] = ec._Task_input(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "result":+ out.Values[i] = ec._Task_result(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "flowId":+ out.Values[i] = ec._Task_flowId(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "subtasks":+ out.Values[i] = ec._Task_subtasks(ctx, field, obj)+ case "createdAt":+ out.Values[i] = ec._Task_createdAt(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "updatedAt":+ out.Values[i] = ec._Task_updatedAt(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ default:+ panic("unknown field " + strconv.Quote(field.Name))+ }+ }+ out.Dispatch(ctx)+ if out.Invalids > 0 {+ return graphql.Null+ }++ atomic.AddInt32(&ec.deferred, int32(len(deferred)))++ for label, dfs := range deferred {+ ec.processDeferredGroup(graphql.DeferredGroup{+ Label: label,+ Path: graphql.GetPath(ctx),+ FieldSet: dfs,+ Context: ctx,+ })+ }++ return out+}++var taskExecutionStatsImplementors = []string{"TaskExecutionStats"}++func (ec *executionContext) _TaskExecutionStats(ctx context.Context, sel ast.SelectionSet, obj *model.TaskExecutionStats) graphql.Marshaler {+ fields := graphql.CollectFields(ec.OperationContext, sel, taskExecutionStatsImplementors)++ out := graphql.NewFieldSet(fields)+ deferred := make(map[string]*graphql.FieldSet)+ for i, field := range fields {+ switch field.Name {+ case "__typename":+ out.Values[i] = graphql.MarshalString("TaskExecutionStats")+ case "taskId":+ out.Values[i] = ec._TaskExecutionStats_taskId(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "taskTitle":+ out.Values[i] = ec._TaskExecutionStats_taskTitle(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "totalDurationSeconds":+ out.Values[i] = ec._TaskExecutionStats_totalDurationSeconds(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "totalToolcallsCount":+ out.Values[i] = ec._TaskExecutionStats_totalToolcallsCount(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "subtasks":+ out.Values[i] = ec._TaskExecutionStats_subtasks(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ default:+ panic("unknown field " + strconv.Quote(field.Name))+ }+ }+ out.Dispatch(ctx)+ if out.Invalids > 0 {+ return graphql.Null+ }++ atomic.AddInt32(&ec.deferred, int32(len(deferred)))++ for label, dfs := range deferred {+ ec.processDeferredGroup(graphql.DeferredGroup{+ Label: label,+ Path: graphql.GetPath(ctx),+ FieldSet: dfs,+ Context: ctx,+ })+ }++ return out+}++var terminalImplementors = []string{"Terminal"}++func (ec *executionContext) _Terminal(ctx context.Context, sel ast.SelectionSet, obj *model.Terminal) graphql.Marshaler {+ fields := graphql.CollectFields(ec.OperationContext, sel, terminalImplementors)++ out := graphql.NewFieldSet(fields)+ deferred := make(map[string]*graphql.FieldSet)+ for i, field := range fields {+ switch field.Name {+ case "__typename":+ out.Values[i] = graphql.MarshalString("Terminal")+ case "id":+ out.Values[i] = ec._Terminal_id(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "type":+ out.Values[i] = ec._Terminal_type(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "name":+ out.Values[i] = ec._Terminal_name(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "image":+ out.Values[i] = ec._Terminal_image(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "connected":+ out.Values[i] = ec._Terminal_connected(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ case "createdAt":+ out.Values[i] = ec._Terminal_createdAt(ctx, field, obj)+ if out.Values[i] == graphql.Null {+ out.Invalids+++ }+ default:+ panic("unknown field " + strconv.Quote(field.Name))+ }+ }+ out.Dispatch(ctx)+ if out.Invalids > 0 {+ return graphql.Null+ }++ atomic.AddInt32(&ec.deferred, int32(len(deferred)))++ for label, dfs := range deferred {+ ec.processDeferredGroup(graphql.DeferredGroup{+ Label: label,+ Path: graphql.GetPath(ctx),+ FieldSet: dfs,+ Context: ctx,+ })+ }++ return out+}++var terminalLogImplementors = []string{"TerminalLog"}-func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj *model.Task) graphql.Marshaler {- fields := graphql.CollectFields(ec.OperationContext, sel, taskImplementors)+func (ec *executionContext) _TerminalLog(ctx context.Context, sel ast.SelectionSet, obj *model.TerminalLog) graphql.Marshaler {+ fields := graphql.CollectFields(ec.OperationContext, sel, terminalLogImplementors)out := graphql.NewFieldSet(fields)deferred := make(map[string]*graphql.FieldSet)for i, field := range fields {switch field.Name {case "__typename":- out.Values[i] = graphql.MarshalString("Task")+ out.Values[i] = graphql.MarshalString("TerminalLog")case "id":- out.Values[i] = ec._Task_id(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- case "title":- out.Values[i] = ec._Task_title(ctx, field, obj)+ out.Values[i] = ec._TerminalLog_id(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "status":- out.Values[i] = ec._Task_status(ctx, field, obj)+ case "flowId":+ out.Values[i] = ec._TerminalLog_flowId(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "input":- out.Values[i] = ec._Task_input(ctx, field, obj)+ case "taskId":+ out.Values[i] = ec._TerminalLog_taskId(ctx, field, obj)+ case "subtaskId":+ out.Values[i] = ec._TerminalLog_subtaskId(ctx, field, obj)+ case "type":+ out.Values[i] = ec._TerminalLog_type(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "result":- out.Values[i] = ec._Task_result(ctx, field, obj)+ case "text":+ out.Values[i] = ec._TerminalLog_text(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "flowId":- out.Values[i] = ec._Task_flowId(ctx, field, obj)+ case "terminal":+ out.Values[i] = ec._TerminalLog_terminal(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "subtasks":- out.Values[i] = ec._Task_subtasks(ctx, field, obj)case "createdAt":- out.Values[i] = ec._Task_createdAt(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- case "updatedAt":- out.Values[i] = ec._Task_updatedAt(ctx, field, obj)+ out.Values[i] = ec._TerminalLog_createdAt(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}@@ -39784,42 +41025,46 @@ func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, objreturn out}-var taskExecutionStatsImplementors = []string{"TaskExecutionStats"}+var testResultImplementors = []string{"TestResult"}-func (ec *executionContext) _TaskExecutionStats(ctx context.Context, sel ast.SelectionSet, obj *model.TaskExecutionStats) graphql.Marshaler {- fields := graphql.CollectFields(ec.OperationContext, sel, taskExecutionStatsImplementors)+func (ec *executionContext) _TestResult(ctx context.Context, sel ast.SelectionSet, obj *model.TestResult) graphql.Marshaler {+ fields := graphql.CollectFields(ec.OperationContext, sel, testResultImplementors)out := graphql.NewFieldSet(fields)deferred := make(map[string]*graphql.FieldSet)for i, field := range fields {switch field.Name {case "__typename":- out.Values[i] = graphql.MarshalString("TaskExecutionStats")- case "taskId":- out.Values[i] = ec._TaskExecutionStats_taskId(ctx, field, obj)+ out.Values[i] = graphql.MarshalString("TestResult")+ case "name":+ out.Values[i] = ec._TestResult_name(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "taskTitle":- out.Values[i] = ec._TaskExecutionStats_taskTitle(ctx, field, obj)+ case "type":+ out.Values[i] = ec._TestResult_type(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "totalDurationSeconds":- out.Values[i] = ec._TaskExecutionStats_totalDurationSeconds(ctx, field, obj)+ case "result":+ out.Values[i] = ec._TestResult_result(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "totalToolcallsCount":- out.Values[i] = ec._TaskExecutionStats_totalToolcallsCount(ctx, field, obj)+ case "reasoning":+ out.Values[i] = ec._TestResult_reasoning(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "subtasks":- out.Values[i] = ec._TaskExecutionStats_subtasks(ctx, field, obj)+ case "streaming":+ out.Values[i] = ec._TestResult_streaming(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}+ case "latency":+ out.Values[i] = ec._TestResult_latency(ctx, field, obj)+ case "error":+ out.Values[i] = ec._TestResult_error(ctx, field, obj)default:panic("unknown field " + strconv.Quote(field.Name))}@@ -39843,178 +41088,71 @@ func (ec *executionContext) _TaskExecutionStats(ctx context.Context, sel ast.Selreturn out}-var terminalImplementors = []string{"Terminal"}+var toolCallLogImplementors = []string{"ToolCallLog"}-func (ec *executionContext) _Terminal(ctx context.Context, sel ast.SelectionSet, obj *model.Terminal) graphql.Marshaler {- fields := graphql.CollectFields(ec.OperationContext, sel, terminalImplementors)+func (ec *executionContext) _ToolCallLog(ctx context.Context, sel ast.SelectionSet, obj *model.ToolCallLog) graphql.Marshaler {+ fields := graphql.CollectFields(ec.OperationContext, sel, toolCallLogImplementors)out := graphql.NewFieldSet(fields)deferred := make(map[string]*graphql.FieldSet)for i, field := range fields {switch field.Name {case "__typename":- out.Values[i] = graphql.MarshalString("Terminal")+ out.Values[i] = graphql.MarshalString("ToolCallLog")case "id":- out.Values[i] = ec._Terminal_id(ctx, field, obj)+ out.Values[i] = ec._ToolCallLog_id(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "type":- out.Values[i] = ec._Terminal_type(ctx, field, obj)+ case "callId":+ out.Values[i] = ec._ToolCallLog_callId(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "name":- out.Values[i] = ec._Terminal_name(ctx, field, obj)+ case "status":+ out.Values[i] = ec._ToolCallLog_status(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "image":- out.Values[i] = ec._Terminal_image(ctx, field, obj)+ case "name":+ out.Values[i] = ec._ToolCallLog_name(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "connected":- out.Values[i] = ec._Terminal_connected(ctx, field, obj)+ case "args":+ out.Values[i] = ec._ToolCallLog_args(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "createdAt":- out.Values[i] = ec._Terminal_createdAt(ctx, field, obj)+ case "result":+ out.Values[i] = ec._ToolCallLog_result(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- default:- panic("unknown field " + strconv.Quote(field.Name))- }- }- out.Dispatch(ctx)- if out.Invalids > 0 {- return graphql.Null- }-- atomic.AddInt32(&ec.deferred, int32(len(deferred)))-- for label, dfs := range deferred {- ec.processDeferredGroup(graphql.DeferredGroup{- Label: label,- Path: graphql.GetPath(ctx),- FieldSet: dfs,- Context: ctx,- })- }-- return out-}--var terminalLogImplementors = []string{"TerminalLog"}--func (ec *executionContext) _TerminalLog(ctx context.Context, sel ast.SelectionSet, obj *model.TerminalLog) graphql.Marshaler {- fields := graphql.CollectFields(ec.OperationContext, sel, terminalLogImplementors)-- out := graphql.NewFieldSet(fields)- deferred := make(map[string]*graphql.FieldSet)- for i, field := range fields {- switch field.Name {- case "__typename":- out.Values[i] = graphql.MarshalString("TerminalLog")- case "id":- out.Values[i] = ec._TerminalLog_id(ctx, field, obj)+ case "durationSeconds":+ out.Values[i] = ec._ToolCallLog_durationSeconds(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}case "flowId":- out.Values[i] = ec._TerminalLog_flowId(ctx, field, obj)+ out.Values[i] = ec._ToolCallLog_flowId(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}case "taskId":- out.Values[i] = ec._TerminalLog_taskId(ctx, field, obj)+ out.Values[i] = ec._ToolCallLog_taskId(ctx, field, obj)case "subtaskId":- out.Values[i] = ec._TerminalLog_subtaskId(ctx, field, obj)- case "type":- out.Values[i] = ec._TerminalLog_type(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- case "text":- out.Values[i] = ec._TerminalLog_text(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- case "terminal":- out.Values[i] = ec._TerminalLog_terminal(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }+ out.Values[i] = ec._ToolCallLog_subtaskId(ctx, field, obj)case "createdAt":- out.Values[i] = ec._TerminalLog_createdAt(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- default:- panic("unknown field " + strconv.Quote(field.Name))- }- }- out.Dispatch(ctx)- if out.Invalids > 0 {- return graphql.Null- }-- atomic.AddInt32(&ec.deferred, int32(len(deferred)))-- for label, dfs := range deferred {- ec.processDeferredGroup(graphql.DeferredGroup{- Label: label,- Path: graphql.GetPath(ctx),- FieldSet: dfs,- Context: ctx,- })- }-- return out-}--var testResultImplementors = []string{"TestResult"}--func (ec *executionContext) _TestResult(ctx context.Context, sel ast.SelectionSet, obj *model.TestResult) graphql.Marshaler {- fields := graphql.CollectFields(ec.OperationContext, sel, testResultImplementors)-- out := graphql.NewFieldSet(fields)- deferred := make(map[string]*graphql.FieldSet)- for i, field := range fields {- switch field.Name {- case "__typename":- out.Values[i] = graphql.MarshalString("TestResult")- case "name":- out.Values[i] = ec._TestResult_name(ctx, field, obj)+ out.Values[i] = ec._ToolCallLog_createdAt(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "type":- out.Values[i] = ec._TestResult_type(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- case "result":- out.Values[i] = ec._TestResult_result(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- case "reasoning":- out.Values[i] = ec._TestResult_reasoning(ctx, field, obj)- if out.Values[i] == graphql.Null {- out.Invalids++- }- case "streaming":- out.Values[i] = ec._TestResult_streaming(ctx, field, obj)+ case "updatedAt":+ out.Values[i] = ec._ToolCallLog_updatedAt(ctx, field, obj)if out.Values[i] == graphql.Null {out.Invalids++}- case "latency":- out.Values[i] = ec._TestResult_latency(ctx, field, obj)- case "error":- out.Values[i] = ec._TestResult_error(ctx, field, obj)default:panic("unknown field " + strconv.Quote(field.Name))}@@ -42653,6 +43791,30 @@ func (ec *executionContext) marshalNTokenStatus2pentagiᚋpkgᚋgraphᚋmodelᚐreturn v}+func (ec *executionContext) marshalNToolCallLog2pentagiᚋpkgᚋgraphᚋmodelᚐToolCallLog(ctx context.Context, sel ast.SelectionSet, v model.ToolCallLog) graphql.Marshaler {+ return ec._ToolCallLog(ctx, sel, &v)+}++func (ec *executionContext) marshalNToolCallLog2ᚖpentagiᚋpkgᚋgraphᚋmodelᚐToolCallLog(ctx context.Context, sel ast.SelectionSet, v *model.ToolCallLog) graphql.Marshaler {+ if v == nil {+ if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {+ ec.Errorf(ctx, "the requested element is null which the schema does not allow")+ }+ return graphql.Null+ }+ return ec._ToolCallLog(ctx, sel, v)+}++func (ec *executionContext) unmarshalNToolCallStatus2pentagiᚋpkgᚋgraphᚋmodelᚐToolCallStatus(ctx context.Context, v interface{}) (model.ToolCallStatus, error) {+ var res model.ToolCallStatus+ err := res.UnmarshalGQL(v)+ return res, graphql.ErrorOnPath(ctx, err)+}++func (ec *executionContext) marshalNToolCallStatus2pentagiᚋpkgᚋgraphᚋmodelᚐToolCallStatus(ctx context.Context, sel ast.SelectionSet, v model.ToolCallStatus) graphql.Marshaler {+ return v+}+func (ec *executionContext) marshalNToolcallsStats2pentagiᚋpkgᚋgraphᚋmodelᚐToolcallsStats(ctx context.Context, sel ast.SelectionSet, v model.ToolcallsStats) graphql.Marshaler {return ec._ToolcallsStats(ctx, sel, &v)}@@ -44228,6 +45390,53 @@ func (ec *executionContext) marshalOTokenStatus2ᚖpentagiᚋpkgᚋgraphᚋmodelreturn v}+func (ec *executionContext) marshalOToolCallLog2ᚕᚖpentagiᚋpkgᚋgraphᚋmodelᚐToolCallLogᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ToolCallLog) graphql.Marshaler {+ if v == nil {+ return graphql.Null+ }+ ret := make(graphql.Array, len(v))+ var wg sync.WaitGroup+ isLen1 := len(v) == 1+ if !isLen1 {+ wg.Add(len(v))+ }+ for i := range v {+ i := i+ fc := &graphql.FieldContext{+ Index: &i,+ Result: &v[i],+ }+ ctx := graphql.WithFieldContext(ctx, fc)+ f := func(i int) {+ defer func() {+ if r := recover(); r != nil {+ ec.Error(ctx, ec.Recover(ctx, r))+ ret = nil+ }+ }()+ if !isLen1 {+ defer wg.Done()+ }+ ret[i] = ec.marshalNToolCallLog2ᚖpentagiᚋpkgᚋgraphᚋmodelᚐToolCallLog(ctx, sel, v[i])+ }+ if isLen1 {+ f(i)+ } else {+ go f(i)+ }++ }+ wg.Wait()++ for _, e := range ret {+ if e == graphql.Null {+ return graphql.Null+ }+ }++ return ret+}+func (ec *executionContext) marshalOUserPrompt2ᚕᚖpentagiᚋpkgᚋgraphᚋmodelᚐUserPromptᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.UserPrompt) graphql.Marshaler {if v == nil {return graphql.Nulldiff --git a/backend/pkg/graph/model/models_gen.go b/backend/pkg/graph/model/models_gen.goindex f6d59ae7..8576c5af 100644--- a/backend/pkg/graph/model/models_gen.go+++ b/backend/pkg/graph/model/models_gen.go@@ -527,6 +527,21 @@ type TestResult struct {Error *string `json:"error,omitempty"`}+type ToolCallLog struct {+ ID int64 `json:"id"`+ CallID string `json:"callId"`+ Status ToolCallStatus `json:"status"`+ Name string `json:"name"`+ Args string `json:"args"`+ Result string `json:"result"`+ DurationSeconds float64 `json:"durationSeconds"`+ FlowID int64 `json:"flowId"`+ TaskID *int64 `json:"taskId,omitempty"`+ SubtaskID *int64 `json:"subtaskId,omitempty"`+ CreatedAt time.Time `json:"createdAt"`+ UpdatedAt time.Time `json:"updatedAt"`+}+type ToolcallsStats struct {TotalCount int `json:"totalCount"`TotalDurationSeconds float64 `json:"totalDurationSeconds"`@@ -1464,6 +1479,51 @@ func (e TokenStatus) MarshalGQL(w io.Writer) {fmt.Fprint(w, strconv.Quote(e.String()))}+type ToolCallStatus string++const (+ ToolCallStatusReceived ToolCallStatus = "received"+ ToolCallStatusRunning ToolCallStatus = "running"+ ToolCallStatusFinished ToolCallStatus = "finished"+ ToolCallStatusFailed ToolCallStatus = "failed"+)++var AllToolCallStatus = []ToolCallStatus{+ ToolCallStatusReceived,+ ToolCallStatusRunning,+ ToolCallStatusFinished,+ ToolCallStatusFailed,+}++func (e ToolCallStatus) IsValid() bool {+ switch e {+ case ToolCallStatusReceived, ToolCallStatusRunning, ToolCallStatusFinished, ToolCallStatusFailed:+ return true+ }+ return false+}++func (e ToolCallStatus) String() string {+ return string(e)+}++func (e *ToolCallStatus) UnmarshalGQL(v interface{}) error {+ str, ok := v.(string)+ if !ok {+ return fmt.Errorf("enums must be strings")+ }++ *e = ToolCallStatus(str)+ if !e.IsValid() {+ return fmt.Errorf("%s is not a valid ToolCallStatus", str)+ }+ return nil+}++func (e ToolCallStatus) MarshalGQL(w io.Writer) {+ fmt.Fprint(w, strconv.Quote(e.String()))+}+type UsageStatsPeriod stringconst (diff --git a/backend/pkg/graph/schema.graphqls b/backend/pkg/graph/schema.graphqlsindex b10d787c..46fb4734 100644--- a/backend/pkg/graph/schema.graphqls+++ b/backend/pkg/graph/schema.graphqls@@ -153,6 +153,13 @@ enum VectorStoreAction {store}+enum ToolCallStatus {+ received+ running+ finished+ failed+}+# ==================== Core System Types ====================type Settings {@@ -330,6 +337,21 @@ type VectorStoreLog {createdAt: Time!}+type ToolCallLog {+ id: ID!+ callId: String!+ status: ToolCallStatus!+ name: String!+ args: String!+ result: String!+ durationSeconds: Float!+ flowId: ID!+ taskId: ID+ subtaskId: ID+ createdAt: Time!+ updatedAt: Time!+}+type Screenshot {id: ID!flowId: ID!@@ -931,6 +953,7 @@ type Query {agentLogs(flowId: ID!): [AgentLog!]searchLogs(flowId: ID!): [SearchLog!]vectorStoreLogs(flowId: ID!): [VectorStoreLog!]+ toolCallLogs(flowId: ID!): [ToolCallLog!]assistantLogs(flowId: ID!, assistantId: ID!): [AssistantLog!]# Usage statistics and analytics@@ -1056,6 +1079,8 @@ type Subscription {agentLogAdded(flowId: ID!): AgentLog!searchLogAdded(flowId: ID!): SearchLog!vectorStoreLogAdded(flowId: ID!): VectorStoreLog!+ toolCallLogAdded(flowId: ID!): ToolCallLog!+ toolCallLogUpdated(flowId: ID!): ToolCallLog!assistantLogAdded(flowId: ID!): AssistantLog!assistantLogUpdated(flowId: ID!): AssistantLog!diff --git a/backend/pkg/graph/schema.resolvers.go b/backend/pkg/graph/schema.resolvers.goindex b216ba74..9f026e7b 100644--- a/backend/pkg/graph/schema.resolvers.go+++ b/backend/pkg/graph/schema.resolvers.go@@ -1485,6 +1485,26 @@ func (r *queryResolver) VectorStoreLogs(ctx context.Context, flowID int64) ([]*mreturn converter.ConvertVectorStoreLogs(logs), nil}+// ToolCallLogs is the resolver for the toolCallLogs field.+func (r *queryResolver) ToolCallLogs(ctx context.Context, flowID int64) ([]*model.ToolCallLog, error) {+ uid, err := validatePermissionWithFlowID(ctx, "toolcalls.view", flowID, r.DB)+ if err != nil {+ return nil, err+ }++ r.Logger.WithFields(logrus.Fields{+ "uid": uid,+ "flow": flowID,+ }).Debug("get tool call logs")++ logs, err := r.DB.GetFlowToolcalls(ctx, flowID)+ if err != nil {+ return nil, err+ }++ return converter.ConvertToolCallLogs(logs), nil+}+// AssistantLogs is the resolver for the assistantLogs field.func (r *queryResolver) AssistantLogs(ctx context.Context, flowID int64, assistantID int64) ([]*model.AssistantLog, error) {uid, err := validatePermissionWithFlowID(ctx, "assistantlogs.view", flowID, r.DB)@@ -2655,6 +2675,26 @@ func (r *subscriptionResolver) VectorStoreLogAdded(ctx context.Context, flowID ireturn r.Subscriptions.NewFlowSubscriber(uid, flowID).VectorStoreLogAdded(ctx)}+// ToolCallLogAdded is the resolver for the toolCallLogAdded field.+func (r *subscriptionResolver) ToolCallLogAdded(ctx context.Context, flowID int64) (<-chan *model.ToolCallLog, error) {+ uid, err := validatePermissionWithFlowID(ctx, "toolcalls.subscribe", flowID, r.DB)+ if err != nil {+ return nil, err+ }++ return r.Subscriptions.NewFlowSubscriber(uid, flowID).ToolCallLogAdded(ctx)+}++// ToolCallLogUpdated is the resolver for the toolCallLogUpdated field.+func (r *subscriptionResolver) ToolCallLogUpdated(ctx context.Context, flowID int64) (<-chan *model.ToolCallLog, error) {+ uid, err := validatePermissionWithFlowID(ctx, "toolcalls.subscribe", flowID, r.DB)+ if err != nil {+ return nil, err+ }++ return r.Subscriptions.NewFlowSubscriber(uid, flowID).ToolCallLogUpdated(ctx)+}+// AssistantLogAdded is the resolver for the assistantLogAdded field.func (r *subscriptionResolver) AssistantLogAdded(ctx context.Context, flowID int64) (<-chan *model.AssistantLog, error) {uid, err := validatePermissionWithFlowID(ctx, "assistantlogs.subscribe", flowID, r.DB)diff --git a/backend/pkg/graph/subscriptions/controller.go b/backend/pkg/graph/subscriptions/controller.goindex e4b52ff8..1909d5dd 100644--- a/backend/pkg/graph/subscriptions/controller.go+++ b/backend/pkg/graph/subscriptions/controller.go@@ -64,6 +64,8 @@ type FlowSubscriber interface {AgentLogAdded(ctx context.Context) (<-chan *model.AgentLog, error)SearchLogAdded(ctx context.Context) (<-chan *model.SearchLog, error)VectorStoreLogAdded(ctx context.Context) (<-chan *model.VectorStoreLog, error)+ ToolCallLogAdded(ctx context.Context) (<-chan *model.ToolCallLog, error)+ ToolCallLogUpdated(ctx context.Context) (<-chan *model.ToolCallLog, error)AssistantLogAdded(ctx context.Context) (<-chan *model.AssistantLog, error)AssistantLogUpdated(ctx context.Context) (<-chan *model.AssistantLog, error)FlowContext@@ -125,6 +127,8 @@ type FlowPublisher interface {AgentLogAdded(ctx context.Context, agentLog database.Agentlog)SearchLogAdded(ctx context.Context, searchLog database.Searchlog)VectorStoreLogAdded(ctx context.Context, vectorStoreLog database.Vecstorelog)+ ToolCallLogAdded(ctx context.Context, toolCallLog database.Toolcall)+ ToolCallLogUpdated(ctx context.Context, toolCallLog database.Toolcall)AssistantLogAdded(ctx context.Context, assistantLog database.Assistantlog)AssistantLogUpdated(ctx context.Context, assistantLog database.Assistantlog, appendPart bool)KnowledgeDocumentCreated(ctx context.Context, doc *model.KnowledgeDocument)@@ -209,6 +213,8 @@ type controller struct {agentLogAdded Channel[*model.AgentLog]searchLogAdded Channel[*model.SearchLog]vecStoreLogAdded Channel[*model.VectorStoreLog]+ toolCallLogAdded Channel[*model.ToolCallLog]+ toolCallLogUpdated Channel[*model.ToolCallLog]assistantLogAdded Channel[*model.AssistantLog]assistantLogUpdated Channel[*model.AssistantLog]@@ -264,6 +270,8 @@ func NewSubscriptionsController() SubscriptionsController {agentLogAdded: NewChannel[*model.AgentLog](),searchLogAdded: NewChannel[*model.SearchLog](),vecStoreLogAdded: NewChannel[*model.VectorStoreLog](),+ toolCallLogAdded: NewChannel[*model.ToolCallLog](),+ toolCallLogUpdated: NewChannel[*model.ToolCallLog](),assistantLogAdded: NewChannel[*model.AssistantLog](),assistantLogUpdated: NewChannel[*model.AssistantLog](),diff --git a/backend/pkg/graph/subscriptions/publisher.go b/backend/pkg/graph/subscriptions/publisher.goindex 1aa6e8f1..918eb1e4 100644--- a/backend/pkg/graph/subscriptions/publisher.go+++ b/backend/pkg/graph/subscriptions/publisher.go@@ -109,6 +109,14 @@ func (p *flowPublisher) VectorStoreLogAdded(ctx context.Context, vectorStoreLogp.ctrl.vecStoreLogAdded.Publish(ctx, p.flowID, converter.ConvertVectorStoreLog(vectorStoreLog))}+func (p *flowPublisher) ToolCallLogAdded(ctx context.Context, toolCallLog database.Toolcall) {+ p.ctrl.toolCallLogAdded.Publish(ctx, p.flowID, converter.ConvertToolCallLog(toolCallLog))+}++func (p *flowPublisher) ToolCallLogUpdated(ctx context.Context, toolCallLog database.Toolcall) {+ p.ctrl.toolCallLogUpdated.Publish(ctx, p.flowID, converter.ConvertToolCallLog(toolCallLog))+}+func (p *flowPublisher) AssistantLogAdded(ctx context.Context, assistantLog database.Assistantlog) {p.ctrl.assistantLogAdded.Publish(ctx, p.flowID, converter.ConvertAssistantLog(assistantLog, false))}diff --git a/backend/pkg/graph/subscriptions/subscriber.go b/backend/pkg/graph/subscriptions/subscriber.goindex 7293eab4..bedc0c56 100644--- a/backend/pkg/graph/subscriptions/subscriber.go+++ b/backend/pkg/graph/subscriptions/subscriber.go@@ -112,6 +112,14 @@ func (s *flowSubscriber) VectorStoreLogAdded(ctx context.Context) (<-chan *modelreturn s.ctrl.vecStoreLogAdded.Subscribe(ctx, s.flowID), nil}+func (s *flowSubscriber) ToolCallLogAdded(ctx context.Context) (<-chan *model.ToolCallLog, error) {+ return s.ctrl.toolCallLogAdded.Subscribe(ctx, s.flowID), nil+}++func (s *flowSubscriber) ToolCallLogUpdated(ctx context.Context) (<-chan *model.ToolCallLog, error) {+ return s.ctrl.toolCallLogUpdated.Subscribe(ctx, s.flowID), nil+}+func (s *flowSubscriber) AssistantLogAdded(ctx context.Context) (<-chan *model.AssistantLog, error) {return s.ctrl.assistantLogAdded.Subscribe(ctx, s.flowID), nil}diff --git a/backend/pkg/server/services/flow_files_test.go b/backend/pkg/server/services/flow_files_test.goindex 4d5e27d7..512762cc 100644--- a/backend/pkg/server/services/flow_files_test.go+++ b/backend/pkg/server/services/flow_files_test.go@@ -904,6 +904,10 @@ func (p *captureFlowPublisher) AgentLogAdded(_ context.Context, _ database.Agentfunc (p *captureFlowPublisher) SearchLogAdded(_ context.Context, _ database.Searchlog) {}func (p *captureFlowPublisher) VectorStoreLogAdded(_ context.Context, _ database.Vecstorelog) {}+func (p *captureFlowPublisher) ToolCallLogAdded(_ context.Context, _ database.Toolcall) {+}+func (p *captureFlowPublisher) ToolCallLogUpdated(_ context.Context, _ database.Toolcall) {+}func (p *captureFlowPublisher) AssistantLogAdded(_ context.Context, _ database.Assistantlog) {}func (p *captureFlowPublisher) AssistantLogUpdated(_ context.Context, _ database.Assistantlog, _ bool) {}diff --git a/backend/pkg/tools/executor.go b/backend/pkg/tools/executor.goindex c6322ebc..8320940c 100644--- a/backend/pkg/tools/executor.go+++ b/backend/pkg/tools/executor.go@@ -137,6 +137,7 @@ type customExecutor struct {db database.Queriermlp MsgLogProvider+ tclp ToolCallLogProviderstore *pgvector.Storevslp VectorStoreLogProvider@@ -289,15 +290,7 @@ func (ce *customExecutor) Execute(}}- tc, err := ce.db.CreateToolcall(ctx, database.CreateToolcallParams{- CallID: id,- Status: database.ToolcallStatusRunning,- Name: name,- Args: args,- FlowID: ce.flowID,- TaskID: database.Int64ToNullInt64(ce.taskID),- SubtaskID: database.Int64ToNullInt64(ce.subtaskID),- })+ tcID, err := ce.tclp.PutLog(ctx, id, name, args, ce.taskID, ce.subtaskID)if err != nil {obsWrapper.end("", err, time.Since(startTime).Seconds())return "", fmt.Errorf("failed to create toolcall: %w", err)@@ -308,11 +301,7 @@ func (ce *customExecutor) Execute(result, err := handler(ctx, name, args)if err != nil {durationDelta := time.Since(startTime).Seconds()- _, _ = ce.db.UpdateToolcallFailedResult(ctx, database.UpdateToolcallFailedResultParams{- Result: fmt.Sprintf("failed to execute handler: %s", err.Error()),- DurationSeconds: durationDelta,- ID: tc.ID,- })+ _ = ce.tclp.UpdateLogFailed(ctx, tcID, fmt.Sprintf("failed to execute handler: %s", err.Error()), durationDelta)return "", resultFormat, fmt.Errorf("failed to execute handler: %w", err)}@@ -326,11 +315,7 @@ func (ce *customExecutor) Execute(result, err = ce.summarizer(ctx, summarizePrompt)if err != nil {durationDelta := time.Since(startTime).Seconds()- _, _ = ce.db.UpdateToolcallFailedResult(ctx, database.UpdateToolcallFailedResultParams{- Result: fmt.Sprintf("failed to summarize result: %s", err.Error()),- DurationSeconds: durationDelta,- ID: tc.ID,- })+ _ = ce.tclp.UpdateLogFailed(ctx, tcID, fmt.Sprintf("failed to summarize result: %s", err.Error()), durationDelta)return "", resultFormat, fmt.Errorf("failed to summarize result: %w", err)}resultFormat = database.MsglogResultFormatMarkdown@@ -345,11 +330,7 @@ func (ce *customExecutor) Execute(}durationDelta := time.Since(startTime).Seconds()- _, err = ce.db.UpdateToolcallFinishedResult(ctx, database.UpdateToolcallFinishedResultParams{- Result: result,- DurationSeconds: durationDelta,- ID: tc.ID,- })+ err = ce.tclp.UpdateLogSuccess(ctx, tcID, result, durationDelta)if err != nil {return "", resultFormat, fmt.Errorf("failed to update toolcall result: %w", err)}diff --git a/backend/pkg/tools/tools.go b/backend/pkg/tools/tools.goindex 13922e71..6e3bc80c 100644--- a/backend/pkg/tools/tools.go+++ b/backend/pkg/tools/tools.go@@ -141,6 +141,19 @@ type VectorStoreLogProvider interface {) (int64, error)}+type ToolCallLogProvider interface {+ PutLog(+ ctx context.Context,+ callID string,+ name string,+ args json.RawMessage,+ taskID *int64,+ subtaskID *int64,+ ) (int64, error)+ UpdateLogSuccess(ctx context.Context, id int64, result string, durationSeconds float64) error+ UpdateLogFailed(ctx context.Context, id int64, result string, durationSeconds float64) error+}+type KnowledgeProvider interface {KnowledgeDocumentCreated(ctx context.Context, doc *model.KnowledgeDocument)}@@ -154,6 +167,7 @@ type flowToolsExecutor struct {slp SearchLogProvidertlp TermLogProvidervslp VectorStoreLogProvider+ tclp ToolCallLogProviderknp KnowledgeProviderdb database.Querier@@ -312,6 +326,7 @@ type FlowToolsExecutor interface {SetSearchLogProvider(slp SearchLogProvider)SetTermLogProvider(tlp TermLogProvider)SetVectorStoreLogProvider(vslp VectorStoreLogProvider)+ SetToolCallLogProvider(tclp ToolCallLogProvider)SetKnowledgeProvider(knp KnowledgeProvider)SetGraphitiClient(client *graphiti.Client)@@ -435,6 +450,10 @@ func (fte *flowToolsExecutor) SetVectorStoreLogProvider(vslp VectorStoreLogProvifte.vslp = vslp}+func (fte *flowToolsExecutor) SetToolCallLogProvider(tclp ToolCallLogProvider) {+ fte.tclp = tclp+}+func (fte *flowToolsExecutor) SetKnowledgeProvider(knp KnowledgeProvider) {fte.knp = knp}@@ -745,6 +764,7 @@ func (fte *flowToolsExecutor) GetCustomExecutor(cfg CustomExecutorConfig) (ContetaskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -983,6 +1003,7 @@ func (fte *flowToolsExecutor) GetAssistantExecutor(cfg AssistantExecutorConfig)userID: fte.userID,flowID: fte.flowID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1030,6 +1051,7 @@ func (fte *flowToolsExecutor) GetPrimaryExecutor(cfg PrimaryExecutorConfig) (ContaskID: &cfg.TaskID,subtaskID: &cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1105,6 +1127,7 @@ func (fte *flowToolsExecutor) GetInstallerExecutor(cfg InstallerExecutorConfig)taskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1207,6 +1230,7 @@ func (fte *flowToolsExecutor) GetCoderExecutor(cfg CoderExecutorConfig) (ContexttaskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1326,6 +1350,7 @@ func (fte *flowToolsExecutor) GetPentesterExecutor(cfg PentesterExecutorConfig)taskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1427,6 +1452,7 @@ func (fte *flowToolsExecutor) GetSearcherExecutor(cfg SearcherExecutorConfig) (CtaskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1595,6 +1621,7 @@ func (fte *flowToolsExecutor) GetGeneratorExecutor(cfg GeneratorExecutorConfig)flowID: fte.flowID,taskID: &cfg.TaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1662,6 +1689,7 @@ func (fte *flowToolsExecutor) GetRefinerExecutor(cfg RefinerExecutorConfig) (ConflowID: fte.flowID,taskID: &cfg.TaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1726,6 +1754,7 @@ func (fte *flowToolsExecutor) GetMemoristExecutor(cfg MemoristExecutorConfig) (CtaskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1796,6 +1825,7 @@ func (fte *flowToolsExecutor) GetEnricherExecutor(cfg EnricherExecutorConfig) (CtaskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,@@ -1864,6 +1894,7 @@ func (fte *flowToolsExecutor) GetReporterExecutor(cfg ReporterExecutorConfig) (CtaskID: cfg.TaskID,subtaskID: cfg.SubtaskID,mlp: fte.mlp,+ tclp: fte.tclp,vslp: fte.vslp,db: fte.db,store: fte.store,diff --git a/backend/sqlc/models/toolcalls.sql b/backend/sqlc/models/toolcalls.sqlindex 28a2ddc1..c64b4bd1 100644--- a/backend/sqlc/models/toolcalls.sql+++ b/backend/sqlc/models/toolcalls.sql@@ -1,3 +1,18 @@+-- name: GetFlowToolcalls :many+SELECT+ tc.*+FROM toolcalls tc+INNER JOIN flows f ON tc.flow_id = f.id+WHERE tc.flow_id = $1 AND f.deleted_at IS NULL+ORDER BY tc.created_at ASC;++-- name: GetFlowToolcall :one+SELECT+ tc.*+FROM toolcalls tc+INNER JOIN flows f ON tc.flow_id = f.id+WHERE tc.id = $1 AND tc.flow_id = $2 AND f.deleted_at IS NULL;+-- name: GetSubtaskToolcalls :manySELECTtc.*