Skip to content

openclaw moltbot workspace should be git-worktree-ready so moltbots can ship code (Phase-4 #14) #437

Closed

Description

@samxu01

Summary

Surfaced from the 2026-05-23 multi-agent huddle. Cody (cloud-codex) shipped 5 of 5 code commits while Theo/Nova/Pixel/Ops (openclaw moltbots) shipped 0 — Theo explicitly said:

"I'm blocked on the repo side here: /workspace/theo isn't a git worktree in this session, so I can't patch or commit the draft from here."

Without code-commit affordance, moltbots get stuck in review-and-acknowledge mode while only the cloud-codex agent ships changes. Bad for the multi-agent collab loop the platform is positioning toward.

Audit doc (in main as of PR #436)

docs/audits/2026-05-24-phase-3/openclaw-moltbot-workspace-audit.md captures:

  • Where moltbot workspaces are provisioned today: backend/services/agentProvisionerServiceK8s.ts writes /workspace/<accountId>/ as a plain directory on the clawdbot-workspace PVC. Contains HEARTBEAT.md, SOUL.md, IDENTITY.md, TOOLS.md, memory/ subdir, skills/ subdir.
  • Cloud-codex parity reference: k8s/helm/commonly/templates/agents/cloud-codex-deployment.yaml boot script does git config --global credential.helper store + writes /state/.git-credentials from $GITHUB_PAT. The clawdbot-gateway postStart hook (lines 565–589) does the same wiring, so credentials ARE pod-wide for moltbot agents too — the gap is that moltbots don't know to use /tmp for cloning, or the workspace itself isn't initialized as a git repo for their own files.
  • Concrete fix shape (~75 LOC across 3 files):
    1. New ensureWorkspaceGitRepo(accountId, { gateway }) helper in agentProvisionerServiceK8s.ts — runs git init /workspace/<accountId> + workspace-local user config. Idempotent (skip if .git/ exists).
    2. Documentation patch to TOOLS.md template (added by provisioner) explaining the clone-to-/tmp workflow.
    3. Optional: HEARTBEAT.md template tweak so moltbots default-mention the option to do code work via /tmp clone.

Why this isn't a quick one-line PR

The fix is straightforward in code but the verification loop is long:

  1. Deploy to dev cluster (~8-12 min via deploy-dev workflow)
  2. Re-provision a moltbot agent via /api/registry/admin/installations/reprovision-all
  3. Trigger a chat.mention to a moltbot in a test pod
  4. Confirm the agent both (a) sees the new TOOLS.md content and (b) can actually git clone && commit && push in its session

Worth doing in a dedicated session where the full ship-deploy-verify cycle has time. Tagging as phase-3 to track.

Companion principle

Per feedback-no-infra-leak-in-public-repo: GH PAT injection is at the runtime-tier (deployment env), never per-pod. Any new dev-tier runtime adapter needs the same env block. Moltbots already have this; the gap is the workspace-side affordance discovery.

Acceptance criteria

  • A moltbot agent (Theo/Nova/Pixel/Ops) successfully runs git clone https://github.com/Team-Commonly/commonly.git /tmp/x && cd /tmp/x && <make a small change> && git commit && git push origin <branch> from a chat.mention session, end-to-end, without operator intervention.
  • The resulting commit attributes to Clawdbot Agent <clawdbot@commonly.me> (or per-agent override if GIT_AUTHOR_NAME/EMAIL are set).
  • Idempotency: re-provisioning the same agent doesn't lose any uncommitted workspace state.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions