Отключение агента менеджера: на время и до команды владельца (миграция 017, API pause/resume, события, шаг 2 и приём сообщений); тесты; docs
Some checks failed
ci / deploy (push) Has been cancelled
ci / test (push) Has been cancelled

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 19:56:51 +03:00
parent 3e696bb53f
commit f3e0b0618e
13 changed files with 273 additions and 22 deletions

View File

@@ -2,6 +2,7 @@ import { itNotify, localDate, MirrorNotReadyError, requireFreshTables, type Comm
import { runStep2 } from "./agents/step2.js";
import type { AgentContext } from "./agents/session.js";
import { buildItems, paramsFor } from "./inputs/build.js";
import { NOT_PAUSED_SQL } from "./pause.js";
import { writePackage } from "./inputs/package-writer.js";
export type PrepJob = "collect_morning" | "recheck_noon";
@@ -68,10 +69,10 @@ export async function runPrepJob(deps: PrepDeps, job: PrepJob, opts: { projectId
join construction_manager cm on cm.person_id = ap.manager_person_id
join person per on per.id = cm.person_id
where ap.is_enabled and ap.mode = any($1) and cm.is_active and per.is_active and per.jt_membership_id is not null
and (cm.paused_until is null or cm.paused_until < $2::date)
and ($3::uuid is null or ap.id = $3)
and ${NOT_PAUSED_SQL("cm")}
and ($2::uuid is null or ap.id = $2)
order by ap.created_at`,
[deps.modes, today, opts.projectId ?? null],
[deps.modes, opts.projectId ?? null],
);
const outcomes: ProjectOutcome[] = [];