feat: opencode.config_dir — каталог с агентами (OPENCODE_CONFIG_DIR)
All checks were successful
CI / test (push) Successful in 43s
CI / build-and-package (amd64, darwin) (push) Successful in 40s
CI / build-and-package (amd64, linux) (push) Successful in 39s
CI / build-and-package (amd64, windows) (push) Successful in 41s
CI / build-and-package (arm64, darwin) (push) Successful in 42s
CI / build-and-package (arm64, linux) (push) Successful in 41s

This commit is contained in:
Hermes
2026-08-15 14:59:10 +05:00
parent 87fae9b82c
commit 9e7c95e1d8
5 changed files with 36 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ type Runner struct {
Bin string // путь к opencode (по умолчанию "opencode")
DBPath string // путь к opencode.db (idle-детекция активности)
Config string // путь к opencode.json (OPENCODE_CONFIG)
ConfigDir string // путь к каталогу с агентами (OPENCODE_CONFIG_DIR)
IdleTimeout time.Duration // нет новых сообщений в БД → зависание
HardTimeout time.Duration // общий лимит на запуск
PollInterval time.Duration
@@ -120,6 +121,9 @@ func (r *Runner) Run(ctx context.Context, prompt, cwd, agent, sessionID string)
if r.Config != "" {
env = append(env, "OPENCODE_CONFIG="+r.Config)
}
if r.ConfigDir != "" {
env = append(env, "OPENCODE_CONFIG_DIR="+r.ConfigDir)
}
proc := exec.CommandContext(ctx, cmd[0], cmd[1:]...)
proc.Env = env