summaryrefslogtreecommitdiff
path: root/makima/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/server')
-rw-r--r--makima/src/server/handlers/contract_chat.rs16
-rw-r--r--makima/src/server/handlers/contracts.rs4
-rw-r--r--makima/src/server/handlers/mesh.rs12
-rw-r--r--makima/src/server/handlers/mesh_chat.rs4
-rw-r--r--makima/src/server/handlers/mesh_supervisor.rs4
-rw-r--r--makima/src/server/handlers/transcript_analysis.rs8
6 files changed, 36 insertions, 12 deletions
diff --git a/makima/src/server/handlers/contract_chat.rs b/makima/src/server/handlers/contract_chat.rs
index 0f794c1..c94538d 100644
--- a/makima/src/server/handlers/contract_chat.rs
+++ b/makima/src/server/handlers/contract_chat.rs
@@ -1356,7 +1356,7 @@ async fn handle_contract_request(
};
let create_req = CreateTaskRequest {
- contract_id,
+ contract_id: Some(contract_id),
name: name.clone(),
description: None,
plan,
@@ -1372,6 +1372,8 @@ async fn handle_contract_request(
copy_files: None,
is_supervisor: false,
checkpoint_sha: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
match repository::create_task_for_owner(pool, owner_id, create_req).await {
@@ -1450,7 +1452,7 @@ async fn handle_contract_request(
);
let create_req = CreateTaskRequest {
- contract_id,
+ contract_id: Some(contract_id),
name: task_name.clone(),
description: Some(instruction.clone()),
plan,
@@ -1466,6 +1468,8 @@ async fn handle_contract_request(
copy_files: None,
is_supervisor: false,
checkpoint_sha: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
match repository::create_task_for_owner(pool, owner_id, create_req).await {
@@ -2054,7 +2058,7 @@ async fn handle_contract_request(
for task_def in &tasks {
let create_req = CreateTaskRequest {
- contract_id,
+ contract_id: Some(contract_id),
name: task_def.name.clone(),
description: None,
plan: task_def.plan.clone(),
@@ -2070,6 +2074,8 @@ async fn handle_contract_request(
copy_files: None,
is_supervisor: false,
checkpoint_sha: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
match repository::create_task_for_owner(pool, owner_id, create_req).await {
@@ -2564,7 +2570,7 @@ async fn handle_contract_request(
if include_action_items && !analysis.action_items.is_empty() {
for item in &analysis.action_items {
let task_req = CreateTaskRequest {
- contract_id: contract.id,
+ contract_id: Some(contract.id),
name: item.text.chars().take(100).collect(),
description: Some(format!("Action item from: {}", item.speaker)),
plan: item.text.clone(),
@@ -2584,6 +2590,8 @@ async fn handle_contract_request(
copy_files: None,
is_supervisor: false,
checkpoint_sha: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
if repository::create_task_for_owner(pool, owner_id, task_req).await.is_ok() {
diff --git a/makima/src/server/handlers/contracts.rs b/makima/src/server/handlers/contracts.rs
index 11337f2..462b385 100644
--- a/makima/src/server/handlers/contracts.rs
+++ b/makima/src/server/handlers/contracts.rs
@@ -287,7 +287,7 @@ pub async fn create_contract(
base_branch: None,
target_branch: None,
parent_task_id: None,
- contract_id: contract.id,
+ contract_id: Some(contract.id),
target_repo_path: None,
completion_action: None,
continue_from_task_id: None,
@@ -296,6 +296,8 @@ pub async fn create_contract(
checkpoint_sha: None,
priority: 0,
merge_mode: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
match repository::create_task_for_owner(pool, auth.owner_id, supervisor_req).await {
diff --git a/makima/src/server/handlers/mesh.rs b/makima/src/server/handlers/mesh.rs
index b6eadf1..99c3d9d 100644
--- a/makima/src/server/handlers/mesh.rs
+++ b/makima/src/server/handlers/mesh.rs
@@ -2197,7 +2197,7 @@ pub async fn reassign_task(
// Create a NEW task with the conversation context
let create_req = CreateTaskRequest {
- contract_id: task.contract_id.unwrap_or(Uuid::nil()),
+ contract_id: task.contract_id,
name: format!("{} (resumed)", task.name),
description: task.description.clone(),
plan: updated_plan.clone(),
@@ -2213,6 +2213,8 @@ pub async fn reassign_task(
continue_from_task_id: Some(id), // Continue from the old task's worktree if possible
copy_files: None,
checkpoint_sha: task.last_checkpoint_sha.clone(),
+ branched_from_task_id: None,
+ conversation_history: None,
};
let new_task = match repository::create_task_for_owner(pool, auth.owner_id, create_req).await {
@@ -2914,7 +2916,7 @@ pub async fn fork_task(
// Create the new forked task
let create_req = CreateTaskRequest {
- contract_id: task.contract_id.unwrap_or(Uuid::nil()),
+ contract_id: task.contract_id,
name: req.new_task_name.clone(),
description: task.description.clone(),
plan: req.new_task_plan.clone(),
@@ -2930,6 +2932,8 @@ pub async fn fork_task(
continue_from_task_id: None,
copy_files: None,
checkpoint_sha: Some(checkpoint.commit_sha.clone()),
+ branched_from_task_id: None,
+ conversation_history: None,
};
let new_task = match repository::create_task_for_owner(pool, auth.owner_id, create_req).await {
@@ -3069,7 +3073,7 @@ pub async fn resume_from_checkpoint(
});
let create_req = CreateTaskRequest {
- contract_id: task.contract_id.unwrap_or(Uuid::nil()),
+ contract_id: task.contract_id,
name: task_name,
description: task.description.clone(),
plan: req.plan,
@@ -3085,6 +3089,8 @@ pub async fn resume_from_checkpoint(
continue_from_task_id: Some(task_id), // Copy worktree from original task
copy_files: None,
checkpoint_sha: Some(checkpoint.commit_sha.clone()),
+ branched_from_task_id: None,
+ conversation_history: None,
};
let new_task = match repository::create_task_for_owner(pool, auth.owner_id, create_req).await {
diff --git a/makima/src/server/handlers/mesh_chat.rs b/makima/src/server/handlers/mesh_chat.rs
index c468446..0fc5513 100644
--- a/makima/src/server/handlers/mesh_chat.rs
+++ b/makima/src/server/handlers/mesh_chat.rs
@@ -1002,7 +1002,7 @@ async fn handle_mesh_request(
};
let create_req = CreateTaskRequest {
- contract_id,
+ contract_id: Some(contract_id),
name: name.clone(),
description: None,
plan,
@@ -1018,6 +1018,8 @@ async fn handle_mesh_request(
copy_files: None,
is_supervisor: false,
checkpoint_sha: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
match repository::create_task_for_owner(pool, owner_id, create_req).await {
diff --git a/makima/src/server/handlers/mesh_supervisor.rs b/makima/src/server/handlers/mesh_supervisor.rs
index df8f77c..8f4cfc4 100644
--- a/makima/src/server/handlers/mesh_supervisor.rs
+++ b/makima/src/server/handlers/mesh_supervisor.rs
@@ -554,7 +554,7 @@ pub async fn spawn_task(
description: None,
plan: request.plan.clone(),
repository_url: repo_url.clone(),
- contract_id: request.contract_id,
+ contract_id: Some(request.contract_id),
parent_task_id: request.parent_task_id,
is_supervisor: false,
checkpoint_sha: request.checkpoint_sha.clone(),
@@ -566,6 +566,8 @@ pub async fn spawn_task(
completion_action: None,
continue_from_task_id: None,
copy_files: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
// Create task in DB
diff --git a/makima/src/server/handlers/transcript_analysis.rs b/makima/src/server/handlers/transcript_analysis.rs
index 99f9ea7..3b71eca 100644
--- a/makima/src/server/handlers/transcript_analysis.rs
+++ b/makima/src/server/handlers/transcript_analysis.rs
@@ -344,7 +344,7 @@ pub async fn create_contract_from_analysis(
if request.include_action_items && !analysis.action_items.is_empty() {
for item in &analysis.action_items {
let task_req = models::CreateTaskRequest {
- contract_id: contract.id,
+ contract_id: Some(contract.id),
name: truncate_for_name(&item.text, 100),
description: Some(format!("Action item from transcript (Speaker: {})", item.speaker)),
plan: item.text.clone(),
@@ -364,6 +364,8 @@ pub async fn create_contract_from_analysis(
_ => 0,
},
merge_mode: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
if let Ok(t) = repository::create_task_for_owner(pool, auth.owner_id, task_req).await {
@@ -515,7 +517,7 @@ pub async fn update_contract_from_analysis(
if request.create_tasks && !analysis.action_items.is_empty() {
for item in &analysis.action_items {
let task_req = models::CreateTaskRequest {
- contract_id: request.contract_id,
+ contract_id: Some(request.contract_id),
name: truncate_for_name(&item.text, 100),
description: Some(format!("Action item from {} (Speaker: {})", file.name, item.speaker)),
plan: item.text.clone(),
@@ -531,6 +533,8 @@ pub async fn update_contract_from_analysis(
checkpoint_sha: None,
priority: 0,
merge_mode: None,
+ branched_from_task_id: None,
+ conversation_history: None,
};
if let Ok(t) = repository::create_task_for_owner(pool, auth.owner_id, task_req).await {