Промты согласованы и установлены всем менеджерам: recap, Control todo (миграция 023, ControlWatcher), fallback на английском; tasks.md очищен
All checks were successful
ci / test (push) Successful in 25s
ci / deploy (push) Successful in 2m7s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 08:28:06 +03:00
parent 4f287519cc
commit 7c26b38a49
34 changed files with 449 additions and 36 deletions

View File

@@ -6,6 +6,7 @@ import { loadFragment, loadPrompt, type PromptSide } from "../agents/prompts.js"
import { saveProblems } from "../agents/step2.js";
import type { DriveSync } from "./drive.js";
import type { SlackApi } from "./api.js";
import { parseControlTodos, saveControlTodos } from "./control.js";
import { applyRecapOutput, getRecapState, loadChannelDialog, parseReactions, recapBlock } from "./recap.js";
import { saveChatTiming, type ChatTiming } from "./timing.js";
import { normalizeVoice, speechText, type ReplyMode, type Tts } from "./tts.js";
@@ -276,7 +277,7 @@ export async function handleManagerMessages(
const listText = isCeo ? "" : await todayList(ctx, manager.personId, today);
// проектный канал: диалог за сутки с временем (по Тампе) и накопленное для Daily Log
const channelBlocks: string[] = [];
const recapOn = !!proj && !!channel && live; // тихий режим и recap - только новая версия агента (промты proposed)
const recapOn = !!proj && !!channel; // тихий режим и recap проектных каналов - у всех менеджеров (промты согласованы, approved = proposed)
if (recapOn && proj && channel) {
const dialogText = await loadChannelDialog(deps.slack, channel, now, deps.timezone);
const st = await getRecapState(ctx.pool, channel);
@@ -326,7 +327,7 @@ ${recapBlock(st, deps.timezone)}`);
await saveChatTiming(ctx.pool, tm, ctx.log);
ctx.log.error({ manager: manager.personId, err }, "шаг 4 не удался");
await ctx.notifyIt(`:warning: khbuild_assistant_prep: шаг 4 (общение) для ${manager.name} не выполнен: ${err.slice(0, 500)}`);
if (!deps.dryPublish && channel) await deps.slack.postMessage(channel, "Не смог обработать сообщение - уже сообщил ИТ-команде, скоро разберёмся.");
if (!deps.dryPublish && channel) await deps.slack.postMessage(channel, "Sorry, I could not process your message. The IT team has been notified and will sort it out soon.");
throw e;
}
@@ -338,6 +339,9 @@ ${recapBlock(st, deps.timezone)}`);
if (!deps.dryPublish && deps.slack.addReaction)
for (const r of parseReactions(out.sections.get("реакции"))) await deps.slack.addReaction(channel, r.ts, r.emoji).catch((e) => ctx.log.warn({ err: String(e) }, "реакция не поставлена"));
}
// "Control:" todo: агент записал пары (todo исполнителя - парное todo контролёра) - дальше за ними следит ControlWatcher
const controlPairs = parseControlTodos(out.sections.get("control todo"));
if (controlPairs.length) await saveControlTodos(ctx.pool, manager.personId, controlPairs);
const replyRaw = out.sections.get(replyKey)!;
const reply = /^\(без ответа\)\.?$/i.test(replyRaw) ? null : replyRaw;
let published = false;