-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.ts
More file actions
25 lines (23 loc) · 1.14 KB
/
Copy pathagent.ts
File metadata and controls
25 lines (23 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* cloud-team-implementer handler — deliberately event-free.
*
* Team members are launched by the cloud team dispatcher when the LEAD
* persona's trigger fires: the dispatcher reads the bound roster, provisions
* a sandbox per member, and runs the member workflow with this persona's
* harness/model/systemPrompt. Subscribing to events here would make every
* roster member fire independently alongside the lead — duplicate sandboxes
* and duplicate PRs for the same issue — so this handler declares no
* triggers and only logs if cloud ever routes an event to it directly.
*/
import { defineAgent, isCronTickEvent, type WorkforceCtx, type WorkforceEvent } from '@agentworkforce/runtime';
export async function handleUnexpectedEvent(ctx: WorkforceCtx, event: WorkforceEvent): Promise<void> {
ctx.log('warn', 'cloud-team-implementer received a direct event; members are launched by the team dispatcher, not by subscriptions', {
eventId: event.id,
source: isCronTickEvent(event) ? 'cron' : event.resource.provider,
type: event.type
});
}
export default defineAgent({
launchedBy: 'team-dispatcher',
handler: handleUnexpectedEvent
});