feat(02-02): enhance agent prompts for non-code task deliverables

- Add deliverable requirement sections for research and content tasks in prompt-builder
- Research tasks instruct agents to produce knowledge entries, documents, or substantial comments
- Content tasks instruct agents to produce documents, social media drafts, or substantial comments
- Auto-infer task_type from assignee department on task creation in api-server
- Import inferTaskType in both prompt-builder and api-server
This commit is contained in:
ZacharyZhang-NY committed 2026-03-22 03:59:09 -04:00
1 parent 9a1671981a
commit 51dbeb0cac
2 files changed
+40 -1

No files matched your search

+10
View File
@@ -7,6 +7,7 @@ import { validateAgentToken, type TokenPayload } from "./agent-auth";
import { canAssignTask, canControlAgent, canManageGoal, canManageOrganization, canManageProject, canUpdateTask } from "./agent-permissions";
import { resolveApprovalDecision, shouldAutoApproveApproval } from "./approval-policy";
import type { AppDatabase } from "./database";
import { inferTaskType } from "./connector-matching";
import { dispatchAgentMessage } from "./message-dispatch";
import type { DesktopEvent } from "@shared/types";
@@ -537,6 +538,15 @@ export class AgentApiServer {
return;
}
// Auto-infer task_type from assignee's department
if (input.assigneeAgentId) {
try {
const assignee = this.db.getAgent(input.assigneeAgentId);
const inferredType = inferTaskType(assignee.department);
this.db.setTaskType(id, inferredType);
} catch { /* best effort -- agent may not exist or setTaskType may fail */ }
}
this.db.addActivity({
companyId,
actor: token.agentId,