fix: create branch on reuse if not found, add dolt+beads to Dockerfile

This commit is contained in:
sam committed 2026-07-24 11:31:27 +10:00
1 parent 1ce6489823
commit 920c56a14b
2 files changed
+14 -2

No files matched your search

+8
View File
@@ -67,6 +67,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN curl -fsSL https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
# ── Dolt + Beads ───────────────────────────────────────────────────────
# Dolt: version-controlled SQL database (beads backend).
RUN curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/dolt-linux-amd64.tar.gz \
| tar xz -C /tmp && mv /tmp/dolt-linux-amd64/bin/dolt /usr/local/bin/ && \
rm -rf /tmp/dolt-linux-amd64
# Beads: agent-native graph issue tracker.
RUN npm install -g @beads/bd && npm cache clean --force
# ── archie-agent ──────────────────────────────────────────────────────
COPY --from=builder /usr/local/bin/archie-agent /usr/local/bin/archie-agent
+6 -2
View File
@@ -104,11 +104,15 @@ func (m *Manager) prepare(ctx context.Context, owner, repo, base string, issue i
if _, err := m.git(ctx, dir, "fetch", "origin"); err != nil {
return "", "", err
}
if _, err := m.git(ctx, dir, "checkout", branch); err == nil {
if _, err := m.git(ctx, dir, "reset", "--hard", "origin/"+base); err != nil {
// Try switching to the branch; create it if it doesn't exist yet.
if _, err := m.git(ctx, dir, "checkout", branch); err != nil {
if _, err := m.git(ctx, dir, "checkout", "-b", branch); err != nil {
return "", "", err
}
}
if _, err := m.git(ctx, dir, "reset", "--hard", "origin/"+base); err != nil {
// Non-fatal — the branch may not have been pushed yet.
}
return dir, branch, nil
}
if err := os.RemoveAll(dir); err != nil {