Чат руководителя (chat_kind = ceo, промт p-ceo-assistant, ответ в разделе «Ответ Arthur»); блоки входа и правило про todo - всем версиям, необязательные фрагменты; тесты; docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -206,7 +206,6 @@ d("консольные агенты (временная БД, фейковый
|
||||
expect(liveCalls).toHaveLength(2);
|
||||
expect(calls).toHaveLength(1);
|
||||
expect(calls[0]!.prompt).toContain("# Память");
|
||||
expect(calls[0]!.prompt).not.toContain("Todo самого менеджера"); // старая версия без изменений
|
||||
});
|
||||
|
||||
it("тайминг чата: строка chat_timing с этапами от сообщения в Slack до ответа в Slack", async () => {
|
||||
@@ -469,6 +468,27 @@ d("консольные агенты (временная БД, фейковый
|
||||
expect(r2.sections.get("ответ менеджеру")).toContain("can't write");
|
||||
expect(calls).toHaveLength(1);
|
||||
});
|
||||
it("чат руководителя (chat_kind = ceo): свой промт, раздел «Ответ Arthur», без списка задач на день", async () => {
|
||||
const liveCalls: ClaudeCall[] = [];
|
||||
const nl = String.fromCharCode(10);
|
||||
const liveRunner = {
|
||||
run: async (c: ClaudeCall) => { liveCalls.push(c); return { text: ["## Ответ Arthur", "Got it, Arthur.", "## Память", "ceo-память"].join(nl), sessionId: c.sessionId }; },
|
||||
isActive: () => false, activeSession: () => null, close: () => undefined, closeAll: () => undefined, activeCount: () => 0,
|
||||
};
|
||||
const base = ctx();
|
||||
const ceoCtx = { ...base, liveRunner, settings: { ...base.settings, live: { managerIds: [MGR], idleMinutes: 10, warmupSeconds: 0 } } };
|
||||
const posted: string[] = [];
|
||||
const slack = { postMessage: async (_c: string, x: string) => { posted.push(x); return true; }, fileInfo: async () => null, download: async () => 0 };
|
||||
const ceo = { personId: MGR, name: "Arthur Atanoff", slackUserId: "ULLMTEST", slackChannelId: "CLLMTEST", chatKind: "ceo" as const };
|
||||
const res = await handleManagerMessages({ ctx: ceoCtx, timezone: "America/New_York", slack }, ceo, [{ channel: "CLLMTEST", ts: "1791741400.000001", text: "what is overdue?", fileIds: [] }]);
|
||||
expect(res.reply).toBe("Got it, Arthur.");
|
||||
expect(posted).toEqual(["Got it, Arthur."]);
|
||||
const p = liveCalls[0]!.prompt;
|
||||
expect(p).toContain("личный ассистент Arthur Atanoff"); // промт руководителя
|
||||
expect(p).not.toContain("# Список задач на сегодня");
|
||||
expect(p).toContain("# Память");
|
||||
expect(p).toContain("what is overdue?");
|
||||
});
|
||||
it("API агентов: память читается и пишется с аудитом, сброс сессии, история", async () => {
|
||||
const app = buildApi({ pool: db.pool, token: "t", run: async () => { throw new Error("не нужен"); } });
|
||||
const h = { authorization: "Bearer t" };
|
||||
|
||||
Reference in New Issue
Block a user