opencode-config/docs/decisions/083-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

3.2 KiB
Raw Blame History

ADR-083: Strengthen Orchestrator Model with explicit built-in prompt override

Статус

Accepted (2026-07-31)

Контекст

Модель glm-5.2 в главном чате opencode не следовала Orchestrator Model из AGENTS.md — выполняла работу сама (filesystem research, grep/glob, edits, bash, git) вместо делегирования subagent'ам. Анализ выявил, что встроенный промпт opencode прямо приказывает «use the available search tools» / «implement the solution using all tools available to you» и даёт примеры где assistant сам делает grep/glob/edit. Этот промпт сильнее AGENTS.md: длиннее, с примерами, идёт первым, а AGENTS.md воспринимается как «справка о проекте» а не поведенческий протокол. Текущая секция Orchestrator Model была абстрактной — одно мягкое «Never do yourself» без маппинга на конкретные subagent'ы, без override-маркера, без anti-patterns с rationale.

Решение

Переписать секцию ## Orchestrator Model в AGENTS.md с жёсткими императивами по образцу работающего run-pipeline/SKILL.md:

  1. Override-маркер в заголовке: (CRITICAL — overrides built-in prompt).
  2. Quote-блок с явным перебивом встроенного промпта — приоритет THIS file, цитата «use the available search tools» / «implement the solution using all tools», императив DELEGATE. Override касается только секций Doing tasks / Tool usage / Proactiveness.
  3. FORBIDDEN-список с concrete delegation map: explore (filesystem/grep/read-for-context), general (edits/write/implementation), matching subagent (bash/git/tests), reviewer/docs-reviewer/memory-syncer.
  4. Anti-pattern с rationale: оркестратор делает работу сам → теряет plan context + ломает linear execution.
  5. ALLOWED-блок для read-only операций (oracle tools, чтение docs/handoff, progress note).

Альтернативы

  • Правка встроенного промпта opencode (бинарник). Невозможно — промпт зашит в бинарник v1.18.9, не настраивается пользователем.
  • Перевод AGENTS.md на русский. Отвергнуто пользователем: дело не в языке, а в жёсткости формулировок и конкретике процедуры.
  • Дублирование Orchestrator Model в каждом subagent. Избыточно, проблема в оркестраторе, не в subagent'ах.
  • Расширение ALLOWED-блока (разрешить read-for-context). Отвергнуто: read-for-context оставлен в FORBIDDEN (делегируется explore), иначе оркестратор снова начнёт читать всё сам.