fix: создавать каталог worktree при старте app (decider запускается до воркера)
All checks were successful
CI / test (push) Successful in 54s
CI / build-and-package (amd64, linux) (push) Successful in 51s
CI / build-and-package (amd64, windows) (push) Successful in 47s

This commit is contained in:
Hermes
2026-08-16 22:13:36 +05:00
parent e055d1937c
commit 4044c0866f
2 changed files with 46 additions and 0 deletions

View File

@@ -58,6 +58,15 @@ func New(configPath, version, updateToken string) (*App, error) {
// Относительные пути (db, worktree) — рядом с .exe, а не от CWD запуска.
cfg.ResolveExePaths()
// Каталог worktree может отсутствовать на свежей машине. Decider (analyst) и
// воркер запускают opencode с cwd=worktree, а git clone не создаёт родительский
// каталог — поэтому создаём его заранее, до любых запусков субагентов.
if cfg.Paths.Worktree != "" {
if err := os.MkdirAll(cfg.Paths.Worktree, 0o755); err != nil {
return nil, fmt.Errorf("app: создать каталог worktree %s: %w", cfg.Paths.Worktree, err)
}
}
// SQLite для задач и трасс
ctx := context.Background()