Show actual file changes recorded for each Agent task
Verify control plane / verify (push) Canceled after 0s
Verify control plane / verify (pull_request) Canceled after 0s

This commit is contained in:
WebUp Cloud committed 2026-11-08 09:10:32 +08:00
1 parent d04777247b
commit 3296d378c9
14 files changed
+453 -16

No files matched your search

@@ -81,6 +81,35 @@ public class TaskController {
return tasks.history(id);
}
@GetMapping("/{id}/changes")
public Map<String, Object> changes(
@AuthenticationPrincipal SecurityConfig.Identity who,
@PathVariable UUID id,
@RequestParam(defaultValue = "0") @Min(0) @Max(1000000) int page) {
var task = tasks.find(id, who.id());
var totals =
db.queryForMap(
"SELECT COUNT(*) AS file_count,COALESCE(SUM(added_lines),0) AS added_lines,"
+ " COALESCE(SUM(removed_lines),0) AS removed_lines"
+ " FROM ai_task_file_changes WHERE task_id=?",
id);
var files =
db.queryForList(
"SELECT file_path,last_status,added_lines,removed_lines,binary_change FROM"
+ " ai_task_file_changes WHERE task_id=? ORDER BY file_path LIMIT 100 OFFSET ?",
id,
page * 100);
return Map.of(
"checks",
task.get("file_change_checks"),
"partial",
task.get("file_changes_partial"),
"totals",
totals,
"files",
files);
}
@PostMapping("/{id}/{action:pause|resume|cancel}")
public Map<String, Object> action(
@AuthenticationPrincipal SecurityConfig.Identity who,