Let agents post coordination messages so company channels are populated

This commit is contained in:
ZacharyZhang-NY committed 2026-05-29 23:35:33 -04:00
1 parent 54ad9d1909
commit e14a4bfce8
4 files changed
+65 -8

No files matched your search

@@ -33,6 +33,7 @@ function scriptedCeo(): (input: ProviderToolTurnInput) => Promise<AgentTurnResul
] },
{ text: "Writing the plan.", toolCalls: [
call("write_deliverable", { path: "plan/operating-plan.md", content: "# OrbitOps Operating Plan\n\n- Validate demand\n- Launch booking site\n" }),
call("send_message", { channel: "general", body: "Kickoff: team staffed, plan written, booking site delegated to Mara." }),
] },
{ text: "Team staffed, work delegated, plan written.", toolCalls: [] },
];
@@ -101,6 +102,12 @@ describe("autonomous bootstrap run", () => {
expect(planFile).toBeTruthy();
expect(planFile).toMatchObject({ ownerType: "agent", ownerId: ceo?.id, kind: "md", scanState: "approved" });
// The CEO posts a coordination message, so the Messages channel is populated.
const general = state.chatSpaces.find((s) => s.orgId === orgId && s.name === "general");
const kickoff = state.chatMessages.find((m) => m.orgId === orgId && m.spaceId === general?.id);
expect(kickoff).toMatchObject({ senderType: "agent", senderId: ceo?.id });
expect(kickoff?.bodyMd).toContain("team staffed");
const run = state.taskRuns.find((r) => r.id === claimed!.id);
expect(run?.state).toBe("completed");