Skip to content

Commit 016f511

Browse files
committed
Move task lifecycle guidance to review notifications
1 parent 91a92f2 commit 016f511

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

garyx-gateway/src/routes/tests.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,6 +1931,8 @@ async fn task_create_with_agent_assignee_queues_agent_dispatch() {
19311931
assert_eq!(runs[0].thread_id, payload["thread_id"].as_str().unwrap());
19321932
assert!(runs[0].message.contains(task_id));
19331933
assert!(runs[0].message.contains("Move this task to review"));
1934+
assert!(!runs[0].message.contains("Garyx will move this task"));
1935+
assert!(!runs[0].message.contains("mark it done"));
19341936
assert_eq!(runs[0].metadata["task_auto_start"], true);
19351937
assert_eq!(
19361938
runs[0].workspace_dir.as_deref(),
@@ -2048,6 +2050,8 @@ async fn task_assign_queues_dispatch_with_original_body() {
20482050
.contains("Use this original body when assigning later.")
20492051
);
20502052
assert!(!runs[0].message.contains("Title: Assignable task"));
2053+
assert!(!runs[0].message.contains("Garyx will move this task"));
2054+
assert!(!runs[0].message.contains("mark it done"));
20512055
}
20522056

20532057
#[tokio::test]

garyx-gateway/src/task_notifications.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ pub(crate) fn format_task_ready_notification(
178178
Task {body_task_id} is ready for review: {title}\n\n\
179179
{final_message}\n\n\
180180
View details:\n\
181-
garyx task get {body_task_id}\n\
181+
garyx task get {body_task_id}\n\n\
182+
Review next:\n\
183+
If changes are needed, move the task back to in progress and send feedback to the task thread:\n\
184+
garyx task update {body_task_id} --status in_progress --note \"needs changes: summary\"\n\n\
185+
If approved, mark it done:\n\
186+
garyx task update {body_task_id} --status done --note \"approved by reviewer\"\n\
182187
</{TASK_NOTIFICATION_TAG}>"
183188
)
184189
}

garyx-gateway/src/task_notifications/tests.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ fn format_wraps_notification_with_single_outer_xml_tag() {
181181
));
182182
assert!(text.contains("Task #TASK-42 is ready for review: Ship task notifications"));
183183
assert!(text.contains("Done."));
184+
assert!(text.contains("Review next:"));
185+
assert!(text.contains(
186+
"garyx task update #TASK-42 --status in_progress --note \"needs changes: summary\""
187+
));
188+
assert!(
189+
text.contains("garyx task update #TASK-42 --status done --note \"approved by reviewer\"")
190+
);
184191
assert!(text.contains("</ garyx_task_notification>"));
185192
assert!(text.ends_with("</garyx_task_notification>"));
186193
}

garyx-gateway/src/tasks.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,11 +1069,11 @@ fn task_auto_dispatch_message(
10691069
.map(str::trim)
10701070
.filter(|value| !value.is_empty());
10711071
match body {
1072-
Some(body) => format!(
1073-
"Task {task_id} has been assigned to you and is already in progress.\n\n{body}\n\nGaryx will move this task to review when this run stops. Do not mark it done just because you finished; after a user, reviewer, or task creator explicitly approves it, you may record that approval with `garyx task update {task_id} --status done --note \"approved by <name>\"`."
1074-
),
1072+
Some(body) => {
1073+
format!("Task {task_id} has been assigned to you and is already in progress.\n\n{body}")
1074+
}
10751075
None => format!(
1076-
"Task {task_id} has been assigned to you and is already in progress.\n\nTitle: {title}\n\nGaryx will move this task to review when this run stops. Do not mark it done just because you finished; after a user, reviewer, or task creator explicitly approves it, you may record that approval with `garyx task update {task_id} --status done --note \"approved by <name>\"`."
1076+
"Task {task_id} has been assigned to you and is already in progress.\n\nTitle: {title}"
10771077
),
10781078
}
10791079
}

0 commit comments

Comments
 (0)