From 90b3cf1163c369d65506540fe68f4da94fc587ce Mon Sep 17 00:00:00 2001 From: bot-backend Date: Sun, 31 May 2026 17:04:17 +0300 Subject: [PATCH] fixup: restore reviewer=opus per-role model + ToolSearch step in analyst/backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - start-bot.ps1: вернуть $model = reviewer? opus : sonnet + --model $model (concurrent-edit затёр на хардкод --model sonnet) - auto-code-reviewer.md: doc 15-17 reviewer работает на Opus (было stale 'Sonnet') - auto-analyst.md / auto-backend.md: шаг 1.5 ENSURE forgejo tools ToolSearch (deferred) — review minor --- .claude/agents/auto-analyst.md | 2 ++ .claude/agents/auto-backend.md | 2 ++ .claude/agents/auto-code-reviewer.md | 6 +++--- scripts/start-bot.ps1 | 11 ++++++++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.claude/agents/auto-analyst.md b/.claude/agents/auto-analyst.md index ecc9e19d..8cb1969a 100644 --- a/.claude/agents/auto-analyst.md +++ b/.claude/agents/auto-analyst.md @@ -47,6 +47,8 @@ actionable-спек (+ `scope/*` + `status/ready`), либо расщепляе ``` 1. KILL-SWITCH check (см. _autonomous_pickup.md) +1.5 ENSURE forgejo tools loaded (deferred, см. _autonomous_pickup.md) — если ещё не в контексте: + ToolSearch select:list_repo_issues,get_issue_by_index,create_issue,update_issue,issue_state_change,create_issue_comment,add_issue_labels,remove_issue_labels,list_repo_labels 2. INBOUND PICKUP ⚠️ ПРИОРИТЕТ (человек→бот канал, идёт ПЕРЕД proactive): - GET issues?labels=status/needs-analysis&state=open&sort=oldest (БЕЗ limit — забираешь ВСЕ). diff --git a/.claude/agents/auto-backend.md b/.claude/agents/auto-backend.md index 164999d3..1fc75d51 100644 --- a/.claude/agents/auto-backend.md +++ b/.claude/agents/auto-backend.md @@ -29,6 +29,8 @@ Backend Python engineer (FastAPI + Celery + PostgreSQL+PostGIS) в autonomous-pi ``` 1. KILL-SWITCH check (см. _autonomous_pickup.md) +1.5 ENSURE tools loaded (deferred forgejo + postgres-gendesign, см. _autonomous_pickup.md) — если ещё не в контексте: + ToolSearch select:list_repo_issues,get_issue_by_index,update_issue,add_issue_labels,remove_issue_labels,issue_state_change,create_issue_comment,create_pull_request (postgres-gendesign — отдельным ToolSearch при работе со схемой) 2. PICKUP (fixup приоритетнее нового claim): a. FIXUP first — GET issues?labels=scope/backend,status/needs-fix&assignee=&limit=1 Есть → FIXUP MODE (см. ниже), claim пропусти diff --git a/.claude/agents/auto-code-reviewer.md b/.claude/agents/auto-code-reviewer.md index 01021d17..605a2696 100644 --- a/.claude/agents/auto-code-reviewer.md +++ b/.claude/agents/auto-code-reviewer.md @@ -12,9 +12,9 @@ tools: Read, Glob, Grep, Bash, mcp__obsidian__obsidian_simple_search, mcp__obsid > **DRAFT.** Эта persona НЕ для Task-tool spawn. Только как `--append-system-prompt` > для standalone окна с `/loop 2m`. > -> **Модель = модель окна.** Frontmatter `model: sonnet` действует ТОЛЬКО при Task-spawn (запрещён). -> В standalone `/loop`-окне модель = модель окна (`start-bot.ps1` запускает с `--model sonnet`). -> Reviewer работает на Sonnet (экономия Opus-пула); для критичных PR есть deep-code-reviewer (Opus, вручную). +> **Модель = модель окна.** Frontmatter `model:` действует ТОЛЬКО при Task-spawn (запрещён). +> В standalone `/loop`-окне модель = модель окна: `start-bot.ps1 reviewer` запускает с `--model opus` +> (reviewer = merge-authority → нужен сильный reasoning на verdict; остальные loop-роли на Sonnet). > **Forgejo API → ТОЛЬКО `mcp__forgejo__*` tools.** ❌ НЕ дёргай curl / python3 / `/tmp/*.json` руками — > на Windows это даёт `http=404` + `FileNotFoundError /tmp/...` (incident 2026-05-31, PR #893). MCP-тул diff --git a/scripts/start-bot.ps1 b/scripts/start-bot.ps1 index 4f95b84c..d7587704 100644 --- a/scripts/start-bot.ps1 +++ b/scripts/start-bot.ps1 @@ -73,12 +73,17 @@ if (-not $env:OBSIDIAN_API_KEY -and (Test-Path "$PSScriptRoot\..\.mcp.json")) { $mcpConfig = (Resolve-Path "$PSScriptRoot\..\.claude\mcp\$Role.json").Path +# Модель per-role: reviewer на Opus (merge-authority — нужен сильный reasoning на verdict), +# остальные loop-роли на Sonnet (pickup+code+PR+smoke; в ~5x дешевле по weekly-квоте, отдельный пул). +# Subagent'ы наследуют модель сессии, если в их frontmatter не задан model: override. +$model = if ($Role -eq 'reviewer') { 'opus' } else { 'sonnet' } + Write-Host "OK bot=$bot" -ForegroundColor Green Write-Host "OK identity + tokens + forgejo-bot remote" -ForegroundColor Green Write-Host "OK per-role MCP (--strict-mcp-config): $mcpConfig" -ForegroundColor Green +Write-Host "OK model: $model" -ForegroundColor Green Write-Host "" -Write-Host "В окне Claude (Sonnet — экономия недельного Opus-пула): /work-as-$Role -> затем /loop" -ForegroundColor Cyan +Write-Host "В окне Claude ($model): /work-as-$Role -> затем /loop" -ForegroundColor Cyan # --strict-mcp-config: грузим ТОЛЬКО серверы этой роли (игнорируем .mcp.json + ~/.claude.json) -# --model sonnet: loop-роли на Sonnet (отдельный пул); Opus оставляем main-оркестратору -claude --model sonnet --strict-mcp-config --mcp-config "$mcpConfig" +claude --model $model --strict-mcp-config --mcp-config "$mcpConfig"