diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-21 21:23:42 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-21 21:23:42 +0000 |
| commit | 888f3014b42ff48f597d0a81e9f52104d19be6db (patch) | |
| tree | 133d1c2e45affe293624991c3b8239b2429c21e9 /internal/executor | |
| parent | a10e7478a130d6453abbd8fb0694948785dd2155 (diff) | |
feat: Phase 2 — project registry, legacy field cleanup, credential path fix
- task.Project type + storage CRUD + UpsertProject + SeedProjects
- Remove AgentConfig.ProjectDir, RepositoryURL, SkipPlanning
- Remove ContainerRunner fallback git init logic
- Project API endpoints: GET/POST /api/projects, GET/PUT /api/projects/{id}
- processResult no longer extracts changestats (pool-side only)
- claude_config_dir config field; default to credentials/claude/
- New scripts: sync-credentials, fix-permissions, check-token
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor')
| -rw-r--r-- | internal/executor/container.go | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/internal/executor/container.go b/internal/executor/container.go index ba0c03a..2c5b7d3 100644 --- a/internal/executor/container.go +++ b/internal/executor/container.go @@ -48,20 +48,7 @@ func (r *ContainerRunner) Run(ctx context.Context, t *task.Task, e *storage.Exec var err error repoURL := t.RepositoryURL if repoURL == "" { - repoURL = t.Agent.RepositoryURL - } - if repoURL == "" { - // Fallback to project_dir if repository_url is not set (legacy support). - // Prefer the 'local' bare remote so that git push succeeds after execution - // (pushing to a non-bare working copy on a checked-out branch is rejected by git). - if t.Agent.ProjectDir != "" { - repoURL = t.Agent.ProjectDir - if out, err2 := exec.Command("git", "-C", t.Agent.ProjectDir, "remote", "get-url", "local").Output(); err2 == nil { - repoURL = strings.TrimSpace(string(out)) - } - } else { - return fmt.Errorf("task %s has no repository_url or project_dir", t.ID) - } + return fmt.Errorf("task %s has no repository_url", t.ID) } image := t.Agent.ContainerImage @@ -362,25 +349,3 @@ func (r *ContainerRunner) buildInnerCmd(t *task.Task, e *storage.Execution, isRe return []string{"sh", "-c", claudeCmd.String()} } - -func (r *ContainerRunner) fallbackGitInit(repoURL, workspace string) error { - // Ensure directory exists - if err := os.MkdirAll(workspace, 0755); err != nil { - return err - } - // If it's a local directory but not a repo, init it. - cmds := [][]string{ - gitSafe("-C", workspace, "init"), - gitSafe("-C", workspace, "add", "-A"), - gitSafe("-C", workspace, "commit", "--allow-empty", "-m", "chore: initial commit"), - } - // If it was a local path, maybe we should have copied it? - // git clone handle local paths fine if they are repos. - // This fallback is only if it's NOT a repo. - for _, args := range cmds { - if out, err := r.command(context.Background(), "git", args...).CombinedOutput(); err != nil { - return fmt.Errorf("git init failed: %w\n%s", err, out) - } - } - return nil -} |
