26 Commits
Author SHA1 Message Date
oqyude ef0dbd59ba nix flake update
nixos flake checks / invariant-checks (push) Failing after 12s
test-runner / smoke (push) Successful in 1s
2026-11-09 22:37:17 +03:00
oqyude d6d64d21c3 treefmt + samba dir changed
nixos flake checks / invariant-checks (push) Failing after 7s
test-runner / smoke (push) Successful in 1s
2026-11-07 18:37:42 +03:00
oqyude 765c7a7fdb opencode: webpage MCP выключен в объявлении (disabled, не enabled)
nixos flake checks / invariant-checks (push) Successful in 2m1s
test-runner / smoke (push) Successful in 1s
2026-11-04 03:01:45 +03:00
oqyude 6b1c9de6b1 opencode: modelFast -> opencode-go/deepseek-v4.1-flash (квота minimax кончается)
nixos flake checks / invariant-checks (push) Successful in 7m23s
test-runner / smoke (push) Successful in 2s
2026-11-04 00:19:40 +03:00
oqyude 574a8b010d opencode: modelFast -> minimax-coding-plan (консольные аккаунты больше не используются)
test-runner / smoke (push) Successful in 0s
nixos flake checks / invariant-checks (push) Successful in 1m37s
2026-11-03 23:12:11 +03:00
oqyude 1d32eab7e3 opencode: автоматическое одобрение прав (permissions)
nixos flake checks / invariant-checks (push) Successful in 1m33s
test-runner / smoke (push) Successful in 1s
Владелец: «нужно, чтобы разрешения выдавались автоматически, без открытых
вкладок и auto-accept». Причина: любой путь вне рабочей папки сессии поднимает
`external_directory`, и ход стоит, пока человек не нажмёт кнопку — агент,
который работает с хостом (~/.local/share/metaagent, /etc/nixos, другой
репозиторий), без присмотра работать не может.

Форма — v2 `permissions`, упорядоченный набор {action, resource, effect}
(устаревший `permission` с ask|allow|deny не используется). Разрешены
external_directory, read, edit, bash, webfetch, websearch.

Это заменяет человеческий клик, а не правила безопасности агента: secrets/,
*.env, *.pem и .ssh остаются закрытыми политикой, а не запросом.
2026-11-03 12:37:51 +03:00
oqyude dd190f445f home-manager: force=true для oh-my-opencode-slim.json (HM падал на ручном файле)
nixos flake checks / invariant-checks (push) Successful in 1m18s
test-runner / smoke (push) Successful in 1s
Файл на sapphira лежал с 2026-11-01 руками (правка моделей до 0c3e0d5),
HM отказывался затирать и падал с 'would be clobbered' — ДО применения
остальных домашних изменений. Из-за этого home-manager-oqyude.service
в failed, а дом. генерация стояла на 30 октября (721e6e8, 0c3e0d5 не
активированы). Содержимое совпадает с объявленным, перезапись безопасна.

НЕ активировано намеренно: активация перезапускает opencode-web
(ловушка 11). Применять switch'ем, когда сессия может умереть.
2026-11-02 16:31:01 +03:00
oqyude 0c3e0d556c feat(models): агенты на console-oqyude/MiniMax-M3.1-Flash (minimax через opencode console) 2026-11-01 17:35:25 +03:00
opencode-agent 721e6e8705 opencode-web: declarative egress proxy (3x-ui host-egress on 127.0.0.1:10808)
sapphira has no direct route to opencode.ai: opencode serve hangs on
GET https://opencode.ai/console/api/v2/config and dies with 'failed to
load OpenCode provider config'. The provider registry stays empty
(opencode-go missing -> all oh-my-opencode-slim agents fail) and the
context7/gh_grep MCP servers hang until TimeoutError.

Declare HTTP_PROXY/HTTPS_PROXY (+ lowercase) and NO_PROXY/no_proxy on the
opencode-web user service instead of the hand-written systemd drop-in.
The proxy is the 3x-ui 'host-egress' inbound (mixed socks5+http),
published on the host loopback by modules/containers/3x-ui.nix.
NO_PROXY keeps podman (10.88/10.89), tailscale (100.64/10), LAN
(192.168.1/24), localhost and the internal *.zeroq.su zone direct.
2026-10-30 12:55:11 +03:00
oqyude fd776bfc20 chore(opencode): default model -> opencode-go/deepseek-v4.1-flash
nixos flake checks / invariant-checks (push) Successful in 1m38s
test-runner / smoke (push) Successful in 0s
The MINIMAX Token Plan keeps its own ceiling, invisible to the director's
quota probe: on 2026-10-26 every sub-agent died on spawn with
"Token Plan usage limit reached (2056)" while the probe for the same
provider reported decision=ok. The director already mints its worker
sessions on opencode-go/deepseek-v4.1-flash (state/quota.json
provider_selection), so this makes agents, workers and the gate share one
provider and one budget.

modelFast drives all five slim agents and the global default model, so the
whole set moves together. Build-verified: nixos-rebuild build --flake
.#sapphira -> rc=0. Not activated: switch restarts opencode-web, where the
sessions doing the deploy live.
2026-10-26 16:09:42 +03:00
oqyude 8079536db2 chore(opencode): drop legacy oh-my-openagent config 2026-10-25 00:42:17 +03:00
oqyude 5a7db9fd36 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, серверная БД пустая.
2026-10-21 17:09:27 +03:00
oqyude 1323982ac3 fix(opencode): oc добавляет --server только тем подкомандам, которые его принимают
test-runner / smoke (push) Successful in 1s
v2 разбирает --server per subcommand: run/attach/tui/api/models/agent его
берут, mcp/service/auth/serve/plugin — нет ("Unrecognized flag: --server in
command opencode plugin list"). Обёртка добавляла флаг всем подряд, из-за
чего локальные команды (plugin list, auth, service) падали.

Дополнительно: если сервер на 4096 не поднят — понятная подсказка вместо
connection refused.
2026-10-21 14:42:22 +03:00
opencode d98636ed6a feat(opencode): миграция sapphira на OpenCode v2 (2.0.32) из nixpkgs master
test-runner / smoke (push) Successful in 1s
v2 есть только в nixpkgs master (nixos-unstable = 1.19.0), поэтому пакет
берётся из inputs.nixpkgs-master, а конфиг пишется вручную: HM-модуль
programs.opencode — v1-only (plugin ед.ч., mcp плоской картой, tui.json,
validateFiles.tui требует отсутствующего passthru.jsonschema.tui).

- home/modules/opencode.nix: v2-конфиг (plugins/mcp.servers), cli.json,
  oh-my-opencode-slim 3.0.5 (единственный v2-совместимый плагин), --port 4096
  (дефолт serve в v2 — 4097, nginx проксирует на 4096), фон-сервис v2 выключен,
  обёртка oc (CLI к работающему юниту: пароль из sops server.env, --server
  после подкоманды), cgroup-защита в [Service], активация ставит пакет
  плагина и прогревает npx-кэш MCP
- flake.lock: nixpkgs-master -> c4f353ac
- ADR-0006 (контекст, факты, инциденты деплоя, herdr) + index.json + T36

Деплой выполнен 2026-10-21 на самой sapphira (сборка + nixos-rebuild switch),
проверено: юнит active на 0.0.0.0:4096, 10 агентов, 3 MCP connected,
LLM smoke на minimax-coding-plan/MiniMax-M3.1-Flash.

AGENTS.md и .agent/rules/project-rules.md оставлены в рабочем дереве:
там вперемешку правки 3x-ui/REALITY/WARP (чужие) — не смешивать.
2026-10-21 13:43:05 +03:00
oqyude 7f301765b5 refactor(home): extract pkgs.bun into herdr-runtime.nix, drop duplication
test-runner / smoke (push) Canceled after 0s
Раньше bun для пользовательского shell PATH приходил двумя путями:
на sapphira — через opencode.nix:339 (home.packages=[... pkgs.bun ...]),
на rydiwo — добавлен вручную в home/secondary.nix (commit ffd85dc) для
herdr-web-ui plugin'а, который без bun в PATH скачивает generic-linux
runtime и ломается о NixOS dynamic linker.

Теперь:
  • home/modules/herdr-runtime.nix — единый источник pkgs.bun для
    пользовательского PATH (импортируется и в server.nix, и в
    secondary.nix).
  • home/secondary.nix — добавлен импорт herdr-runtime.nix, убран
    прямой home.packages = with pkgs; [ bun ]; и его 10-строчный
    комментарий-объяснение (переехал в herdr-runtime.nix).
  • home/server.nix — добавлен импорт herdr-runtime.nix.
  • home/modules/opencode.nix — pkgs.bun удалён из home.packages
    (он теперь из herdr-runtime.nix), но ОСТАВЛЕН в
    programs.opencode.extraPackages (line 271) — это другой PATH
    (--suffix PATH внутри opencode-wrapped env), не дубликат.

Результат для обоих хостов:
  - shell PATH: bun из /nix/store/...-bun-*/bin/bun
  - opencode-wrapped env (только sapphira): bun через extraPackages
  - herdr-web-ui plugin auto-install на rydiwo: находит bun в PATH,
    не скачивает generic-linux runtime

После этого оба хоста пересобираются (sapphira: opencode/server.nix;
rydiwo: secondary.nix + новый модуль).
2026-10-15 15:07:54 +03:00
oqyude 3babee5392 opencode: remove opencode-loop plugin
test-runner / smoke (push) Successful in 1s
Reverts the plugin registration added in 4ff7188 ("opencode:
opencode-loop added"). The entry had to be dropped from both places
inside programs.opencode, otherwise the plugin keeps loading in the
TUI:

  settings.plugin -> ~/.config/opencode/opencode.json
  tui.plugin      -> ~/.config/opencode/tui.json

oh-my-openagent is untouched; its agent and category overrides in
~/.omo/omo.jsonc still apply.
2026-10-14 23:44:01 +03:00
oqyude dfb7830d75 nix flake update 2026-10-13 16:16:20 +03:00
oqyude 13552039c7 opencode: opencode fix 2026-10-13 04:33:47 +03:00
oqyude 4ff7188678 opencode: opencode-loop added 2026-10-13 03:46:43 +03:00
oqyude 02927a26bb vtimeline added and formatted 2026-10-09 16:59:45 +03:00
oqyude bc5aad87da opencode remapping 2026-10-09 16:38:16 +03:00
oqyude e7c0fde0b1 tty added and opencode fixed 2026-10-09 14:48:12 +03:00
oqyude 5e9641602a opencode: dynamic HM symlink, env via xlib, document migration journal
Three small things together:

1. relinkHomeManager was pinning the versioned symlink name to
   'home-manager-24-link'. That breaks on every HM major-version bump:
   HM 25 will move the alias to 'home-manager-25-link' and the script
   will silently stop relinking. Derive the name from one hop of the
   stable 'home-manager' symlink, with a guard against the missing case
   so a fallback never accidentally rewrites the profiles/ directory
   itself.

2. programs.opencode.web.environmentFile now reads from
   xlib.dirs.opencode-server-env (added previously in users.nix + dirs.nix).
   The sops materialization and the systemd EnvironmentFile can no
   longer silently desync.

3. Document the oh-my-openagent 2026-07-opencode-config-unification
   migration trap that logs 'Migration backup path already exists' on
   every startup: the backup path embeds the content-hashed store path,
   which stays valid in /nix/store across HM activations, so the
   deterministic collision never resolves itself. Recovery is
   'rm -rf ~/.omo/migration-backup-*' to let omo retry; if it keeps
   failing on the same path the plugin version probably expects a new
   schema and this file needs changes.

Also trim the over-explained [Service] / serviceConfig comment: the
home-manager attrset-union behavior is general, not specific to this
unit, so the explanation got shorter without losing the invariant.
2026-10-07 11:38:16 +03:00
oqyude c73a698857 opencode fix linger 2026-10-04 22:27:55 +03:00
oqyude cc20ee637d opencode oom fixes 2026-10-04 17:41:32 +03:00
oqyude fb56f6310b opencode 2026-10-03 20:21:19 +03:00