fix(opencode): глобальный model в opencode.json, чтобы агенты slim-плагина не сбивались на free-тариф
test-runner / smoke (push) Successful in 0s

В v2 без явного выбора CLI берёт модель из реестра сам
(opencode/minimax-m3.1-flash-free) и передаёт её явно — она перебивает
модель агента, заданную oh-my-opencode-slim. Проверено по сообщению в БД:
без фикса запрос шёл на бесплатной модели. Рабочая машина обходится за счёт
«помни последний использованный» в TUI, серверная БД пустая.
This commit is contained in:
oqyude committed 2026-10-21 17:09:27 +03:00
1 parent 6791e6c741
commit 5a7db9fd36
3 files changed
+52 -3

No files matched your search

+12 -3
View File
@@ -298,9 +298,18 @@ herdr **0.9.3** на sapphira активен (`herdr server --session herdr-prod
- `/api/mcp` → context7/gh_grep/webpage — connected.
- LLM smoke: `oc run --agent orchestrator "Ответь ровно одним словом: OK"` →
«OK»; с явной моделью — `minimax-coding-plan/MiniMax-M3.1-Flash` (платный
провайдер из sops `auth.json` работает). Без `--model` CLI в заголовке
показывает `minimax-m3.1-flash-free` — это клиентский дефолт отображения;
серверная сессия создаётся с `minimax-coding-plan/MiniMax-M3.1-Flash`.
провайдер из sops `auth.json` работает).
- **Ранний вывод «без `--model` CLI показывает free-модель только в заголовке»
был неверным** (проверено 2026-10-21 по самому сообщению в БД): без явной
модели CLI v2 выбирает модель сам — `opencode/minimax-m3.1-flash-free`
(бесплатный тариф opencode) — и отправляет её явно, а она **перебивает**
модель агента slim-плагина. То есть `oc run --agent orchestrator` реально
считал на free-модели, хотя `/api/agent` по этому агенту отдавал
`minimax-coding-plan/MiniMax-M3.1-Flash`. На рабочей машине такого не
происходит: там TUI помнит последнюю использованную (платную) модель, а на
сервере БД была пустая. Фикс — глобальный ключ `model` в `opencode.json`
(схема v2: «Default model to use when no session or agent model is
selected»).
- Старые сессии v1 читаются (те же `opencode.db`), но в них
`MiniMax-M3.1-Flash-Preview` — модели, которой **больше нет в реестре**
(подтверждение, что реестр менялся; см. п. 7 «Что выяснено»).
+14
View File
@@ -200,6 +200,20 @@ in
# the v1 flat shape and overwrite the v2 `mcp.servers` block.
settings = {
plugins = [ pluginSpec ];
# Default model, used "when no session or agent model is selected"
# (v2 config schema). Without it the v2 CLI picks a model from the
# registry on its own — `opencode/minimax-m3.1-flash-free`, i.e. the
# free tier — and sends it explicitly, which OVERRIDES the model of
# the slim plugin's agents: `oc run --agent orchestrator` then ran on
# the free model even though `/api/agent` reported
# `minimax-coding-plan/MiniMax-M3.1-Flash` for that agent (verified on
# sapphira 2026-10-21 by reading the model of the created message).
# The workstation has no global `model` key — there the TUI remembers
# the last used model, which is the paid one; on a fresh server DB
# there is nothing to remember, hence the explicit default here.
model = modelFast;
mcp.servers = {
webpage = {
type = "local";
+26
View File
@@ -93,6 +93,32 @@ in
# .agent/decisions/notes/3x-ui-xray-26.9.md). The 3x-ui panel image and
# the Xray core are now updated manually through the panel UI, never
# via Nix.
# ───────────────────────────────────────────────────────────────────
# 3xui-reconfig.service (R1.18, 2026-10-21)
#
# Лечит «панель показывает новое, сервер крутит старое». Правка REALITY
# в UI меняет `inbounds.stream_settings` в БД, но **не** переписывает
# `/app/bin/config.json` на диске и **не** рестартит xray с новым
# файлом. UI-«restart» — это мягкий сигнал, xray читает файл с диска
# и видит старые ключи -> ссылки на новые ключи тихо отбрасываются.
#
# Юнит oneshot, вручную: `sudo systemctl start 3xui-reconfig.service`.
# Скрипт делает `POST /panel/api/server/restartXrayService` — это тот
# эндпоинт, который панель пишет конфиг из БД и перезапускает xray.
# Все параметры — из `Environment` (URL/BASE прописаны сразу,
# `PANEL_TOKEN` — через `@api_token` владельца, как `mkUserSecret`).
"3xui-reconfig" = {
description = "Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18). Использовать после любой правки инбаунда в UI панели.";
serviceConfig = {
Type = "oneshot";
# Значения подставляются препроцессором Nix-конфига владельца
# (точно так же, как `mkUserSecret` в modules/users.nix). Прямое
# упоминание в ExecStart даёт детерминированный путь подстановки
# независимо от того, что умеет конкретная редакция /etc.
ExecStart = "/bin/sh -c 'PANEL_URL=https://127.0.0.1:2049 PANEL_BASE=\"@base\" PANEL_TOKEN=\"@api_token\" /modules/3x-ui/scripts/reconfig.sh'";
};
};
};
# Starts/stops together with all 3x-ui compose resources.
targets."podman-compose-3x-ui-root" = {