opencode-config/docs/handoff/pr-189-strengthen-orchestrator-model.md
Sergey 6bec709ec2
fix(agents): strengthen Orchestrator Model with override and delegation map (#189)
* fix(agents): strengthen Orchestrator Model with override and delegation map

* docs(handoff): add handoff and ADR for orchestrator model fix

* docs(handoff): set PR number

* docs(project-map): update AGENTS.md description after PR#189

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-31 23:36:04 +03:00

29 lines
No EOL
3.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
pr: 189
title: fix(agents): strengthen Orchestrator Model with override and delegation map
---
## Что сделано
Переписана секция `## Orchestrator Model` в `AGENTS.md` (строки 3-10 → 3-25, +16 строк):
- Заголовок с override-маркером: `## Orchestrator Model (CRITICAL — overrides built-in prompt)`.
- Quote-блок с явным перебивом встроенного промпта opencode (секции `# Doing tasks`, `# Tool usage policy`, `# Proactiveness`): приоритет THIS file, цитата «use the available search tools» / «implement the solution using all tools available to you», императив DELEGATE.
- FORBIDDEN-список с маппингом на конкретные subagent'ы: `explore` (filesystem/grep/read-for-context), `general` (edits/write/implementation), matching subagent (bash/git/tests), `reviewer`/`docs-reviewer`/`memory-syncer` (review/docs/memory).
- Anti-pattern с rationale: оркестратор делает работу сам → теряет plan context + ломает linear execution (agents jump between branches → conflicts, lost work).
- ALLOWED-блок для read-only: oracle tools (`pipeline-status`, `spec-status`, `memory-search`), чтение `docs/handoff/`, однострочный progress note пользователю.
Остальные секции `AGENTS.md` не изменены (байт-в-байт, проверено через `git diff`).
## Почему
Модель glm-5.2 не следовала Orchestrator Model — делала всё сама (grep/glob/edit/bash). Причина: прямой конфликт со встроенным промптом opencode, который приказывает «use the available search tools» и даёт примеры где assistant сам делает grep/glob/edit. Встроенный промпт сильнее (длиннее, с примерами, идёт первым). Старая секция была абстрактной — одно мягкое «Never do yourself» без маппинга «вместо X → Y», без override-маркера. Решение: жёсткие императивы (`CRITICAL`, `FORBIDDEN`, `NO EXCEPTIONS`, `NEVER`, `DELEGATE`, `ALLOWED`) + явный override встроенного промпта + concrete delegation map — по образцу работающего `run-pipeline/SKILL.md`. Sync в `~/.config/opencode/AGENTS.md` — после merge, отдельным шагом (не в этом PR).
## Pending
- После merge: sync `/root/workspace/opencode-config/AGENTS.md``/root/.config/opencode/AGENTS.md` (bind-mount). См. skill `configure-opencode`.
## Watch out
- Override касается ТОЛЬКО секций Doing tasks / Tool usage / Proactiveness встроенного промпта, НЕ всего промпта (безопасность и другие правила не затронуты).
- Quote-блок цитирует промпт opencode v1.18.9 (`Hi`) — может устареть при апгрейде, но это документация намерения, не зависимость от точной формулировки.
- ALLOWED-блок узкий: чтение только `docs/handoff/`, `read-for-context` остаётся в FORBIDDEN (делегируется `explore`).