File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,25 +71,20 @@ export function createCommandLog(message: string): TaskLog {
7171
7272// Task operations using Supabase
7373export async function createTask ( supabase : SupabaseClient , data : CreateTaskData ) : Promise < Task | null > {
74- const taskId = nanoid ( )
75- const task : Omit < Task , 'created_at' | 'updated_at' > = {
76- id : taskId ,
74+ const task = {
7775 user_id : data . user_id ,
78- status : 'pending' ,
76+ status : 'pending' as const ,
7977 progress : 0 ,
8078 prompt : data . prompt ,
8179 repo_url : data . repo_url ,
8280 selected_agent : data . selected_agent || 'claude' ,
8381 selected_model : data . selected_model ,
84- logs : [ createInfoLog ( 'Task created, preparing to start...' ) ] ,
82+ logs : JSON . stringify ( [ createInfoLog ( 'Task created, preparing to start...' ) ] ) ,
8583 }
8684
8785 const { data : newTask , error } = await supabase
8886 . from ( 'tasks' )
89- . insert ( {
90- ...task ,
91- logs : JSON . stringify ( task . logs ) ,
92- } )
87+ . insert ( task )
9388 . select ( )
9489 . single ( )
9590
You can’t perform that action at this time.
0 commit comments