Отключение агента менеджера: на время и до команды владельца (миграция 017, API pause/resume, события, шаг 2 и приём сообщений); тесты; docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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[] = [];
|
||||
|
||||
Reference in New Issue
Block a user