Merge branch 'worktree-agent-a3712f2b'

# Conflicts:
#	.planning/STATE.md
This commit is contained in:
ZacharyZhang-NY committed 2026-03-27 00:34:55 -04:00
commit 8ef70259e0
6 files changed
+412 -2

No files matched your search

+15
View File
@@ -8,6 +8,7 @@ import { canAssignTask, canControlAgent, canManageGoal, canManageOrganization, c
import { resolveApprovalDecision, shouldAutoApproveApproval } from "./approval-policy";
import type { AppDatabase } from "./database";
import { inferTaskType } from "./connector-matching";
import { validateTaskCreation } from "./task-quality-gates";
import { dispatchAgentMessage } from "./message-dispatch";
import type { DesktopEvent, SectionId } from "@shared/types";
@@ -561,6 +562,12 @@ export class AgentApiServer {
this.json(res, 403, { error: "Current agent is not allowed to assign this task to the selected agent" });
return;
}
const isHeartbeat = input.title.startsWith("[Heartbeat]");
const taskValidation = validateTaskCreation({ title: input.title, description: input.description ?? "" }, isHeartbeat);
if (!taskValidation.valid) {
this.json(res, 422, { error: taskValidation.errors.join("; ") });
return;
}
let id: string;
try {
@@ -1582,6 +1589,14 @@ export class AgentApiServer {
if (actionItems.length > 0) {
for (const item of actionItems) {
if (item.title && typeof item.title === "string") {
const meetingTaskValidation = validateTaskCreation(
{ title: item.title, description: item.description ?? `Action item from meeting: ${data.title ?? existing.title}` },
false,
);
if (!meetingTaskValidation.valid) {
// Log but skip invalid meeting action items rather than failing the whole request
continue;
}
const taskId = this.db.saveTask({
companyId: token.companyId,
title: item.title,