Агенты: новая сессия вместо resume (память в промте), живой агент по простою 4 мин сводит память; экономия лимита (deviations п.69)
Some checks failed
ci / test (push) Failing after 29s
ci / deploy (push) Has been skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 14:19:11 +03:00
parent 333106e518
commit 53df5a9e7f
13 changed files with 106 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import { join } from "node:path";
import { basename, join } from "node:path";
import { createLogger, createPool, itNotify, loadServiceSettings } from "khb_common";
import { createCliRunner } from "./agents/cli-runner.js";
import { summarizeIdle } from "./agents/idle-memory.js";
import { createLiveRunner } from "./agents/live-runner.js";
import { loadFragment } from "./agents/prompts.js";
import { listManagers } from "./managers.js";
@@ -37,6 +38,7 @@ const ctx: AgentContext = {
? createLiveRunner({
bin: service.agent.claudeBin, model: service.agent.model, timeoutMs: service.agent.timeoutMs,
idleMs: service.agent.live.idleMinutes * 60_000, warmupMs: service.agent.live.warmupSeconds * 1000,
onIdle: (cwd) => summarizeIdle(ctx, basename(cwd)),
onEvent: (e) => log.info({ ...e }, "долгоживущий агент"),
})
: undefined,