Чтение зеркала Supabase агентами (khb-sql, роли khb_agent / khb_agent_ceo, KHB_SQL_URL); отчёты для агента руководителя; промты; тесты; docs
All checks were successful
ci / test (push) Successful in 23s
ci / deploy (push) Successful in 3m24s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 11:50:22 +03:00
parent 77b6e4ae3b
commit 00bf1cdd39
18 changed files with 246 additions and 7 deletions

View File

@@ -100,7 +100,7 @@ export async function closeOrphanRuns(ctx: AgentContext): Promise<number> {
*/
export function runManagerAgent(
ctx: AgentContext,
opts: { managerId: string; step: "step2" | "step4"; tools: ToolSet; prompt: string; /** Полный промт для повтора в новой сессии, если prompt - короткий. */ fullPrompt?: string; required: string[] },
opts: { managerId: string; step: "step2" | "step4"; tools: ToolSet; prompt: string; /** Полный промт для повтора в новой сессии, если prompt - короткий. */ fullPrompt?: string; /** Переменные окружения агента (KHB_SQL_URL и т.п.). */ env?: Record<string, string>; required: string[] },
): Promise<AgentOutcome> {
const tEnter = Date.now();
return ctx.locks.run(opts.managerId, () =>
@@ -113,7 +113,7 @@ export function runManagerAgent(
const run: ClaudeRunner = async (c) => {
const t = Date.now();
try {
const r = await base(c);
const r = await base(opts.env ? { ...c, env: opts.env } : c);
timing.runs.push({ wallMs: Date.now() - t, timing: r.timing, costUsd: r.costUsd });
return r;
} catch (e) {