docs: Update agent documentation
Updated agent.md documentation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,33 @@ export function architectProcedures(publicProcedure: ProcedureBuilder) {
|
||||
});
|
||||
}
|
||||
|
||||
// Auto-dismiss stale breakdown agents
|
||||
const allAgents = await agentManager.list();
|
||||
const staleAgents = allAgents.filter(
|
||||
(a) =>
|
||||
a.mode === 'breakdown' &&
|
||||
a.initiativeId === input.initiativeId &&
|
||||
['crashed', 'idle'].includes(a.status) &&
|
||||
!a.userDismissedAt,
|
||||
);
|
||||
for (const stale of staleAgents) {
|
||||
await agentManager.dismiss(stale.id);
|
||||
}
|
||||
|
||||
// Reject if a breakdown agent is already active for this initiative
|
||||
const activeBreakdownAgents = allAgents.filter(
|
||||
(a) =>
|
||||
a.mode === 'breakdown' &&
|
||||
a.initiativeId === input.initiativeId &&
|
||||
['running', 'waiting_for_input'].includes(a.status),
|
||||
);
|
||||
if (activeBreakdownAgents.length > 0) {
|
||||
throw new TRPCError({
|
||||
code: 'CONFLICT',
|
||||
message: 'A breakdown agent is already running for this initiative',
|
||||
});
|
||||
}
|
||||
|
||||
const task = await taskRepo.create({
|
||||
initiativeId: input.initiativeId,
|
||||
name: `Breakdown: ${initiative.name}`,
|
||||
|
||||
Reference in New Issue
Block a user