it keeps failing at converting text to the next task
- User
it keeps failing at converting text to the next task
- Assistant
The issue you're experiencing with "converting text to the next task" could stem from one or more points in the process where the system creates or retrieves the next task based on prior outputs and flow information. In the provided code, this logic appears to be handled primarily by the
getNextTaskfunction inqueue.go.Here’s a focused walkthrough of the process and potential areas where the failure could occur:
Key Function:
getNextTaskgofunc getNextTask(provider providers.Provider, db *database.Queries, flowId int64) (*database.Task, error) { flow, err := db.ReadFlow(context.Background(), flowId) if err != nil { return nil, fmt.Errorf("failed to get flow: %w", err) } tasks, err := db.ReadTasksByFlowId(context.Background(), sql.NullInt64{ Int64: flowId, Valid: true, }) if err != nil { return nil, fmt.Errorf("failed to get tasks by flow id: %w", err) } const maxResultsLength = 4000 for i, task := range tasks { // Truncate long results to avoid issues. if [Redacted Person](task.Results.String) > maxResultsLength { results := task.Results.String[len(task.Results.String)-maxResultsLength:] tasks[i].Results = database.StringToNullString(results) } } // Use the provider to determine the next task based on flow state. c := provider.NextTask(providers.NextTaskOptions{ Tasks: tasks, DockerImage: flow.ContainerImage.String, }) lastTask := tasks[len(tasks)-1] // Update the tool call ID for the last task. _, err = db.UpdateTaskToolCallId(context.Background(), database.UpdateTaskToolCallIdParams{ ToolCallID: c.ToolCallID, ID: lastTask.ID, }) if err != nil { return nil, fmt.Errorf("failed to update task tool call id: %w", err) } // Create the next task in the database. nextTask, err := db.CreateTask(context.Background(), database.CreateTaskParams{ Args: c.Args, Message: c.Message, Type: c.Type, Status: database.StringToNullString("in_progress"), FlowID: sql.NullInt64{Int64: flowId, Valid: true}, ToolCallID: c.ToolCallID, }) if err != nil { return nil, fmt.Errorf("failed to save command: %w", err) } return &nextTask, nil }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.