Skip to content

feat(provisioner): moltbot /workspace is a git repo + TOOLS.md notes (closes #437)#447

Closed
samxu01 wants to merge 1 commit into
mainfrom
worktree-2026-05-24-moltbot-workspace-git-init
Closed

feat(provisioner): moltbot /workspace is a git repo + TOOLS.md notes (closes #437)#447
samxu01 wants to merge 1 commit into
mainfrom
worktree-2026-05-24-moltbot-workspace-git-init

Conversation

@samxu01
Copy link
Copy Markdown
Contributor

@samxu01 samxu01 commented May 24, 2026

Summary

Brings moltbot agents (theo / nova / pixel / ops / aria) to parity with cloud-codex on git operations. Before this, /workspace/<accountId>/ was a plain directory — agents could not git status, git commit, or git push without a manual bootstrap. With the global credential helper already wired in the clawdbot postStart hook, all that was missing was git init on the workspace itself.

Changes

  • ensureWorkspaceGitRepo(accountId, { gateway }) helper — idempotent git init + workspace-local user.name / user.email stamped with the accountId so commits attribute per-agent (Clawdbot Agent (nova)) rather than the generic pod-global identity.
  • Called from provisionOpenClawAccount after normalizeWorkspaceDocs and ensureWorkspaceMemoryFiles. Wrapped in try/catch with non-fatal warning, matching the sibling workspace-setup steps.
  • TOOLS.md "Git workflow" section extended so agents discover the workspace-is-a-repo fact + credential wiring. Both new-file and existing-file paths handled (sed-injects the new line on TOOLS.md from before this change).

Audit deltas

The pre-existing audit (docs/audits/2026-05-24-phase-3/openclaw-moltbot-workspace-audit.md) called for apt-get install -y git as part of the fix. NOT needed — git was already on PATH in the clawdbot image (verified via kubectl exec deploy/clawdbot-gateway -- which git/usr/bin/git 2.39.5). Scope is ~50 LOC across one file instead of the audit's 75 across three.

Test plan

  • CI: backend type-check + unit suite passes
  • Post-Deploy: pick a dev agent (e.g. nova), trigger reprovision-all, then kubectl exec deploy/clawdbot-gateway -- ls /workspace/nova/.git — should exist after the next provision cycle.
  • Manual: have nova run cd /workspace/nova && git status in an acpx_run shell — should report a clean tree, not "fatal: not a git repository".

Closes #437.

🤖 Generated with Claude Code

…d notes

Brings moltbot agents to parity with cloud-codex on git operations. Before
this, /workspace/<accountId>/ was a plain directory — agents could not
`git status`, `git commit`, or `git push` without a manual bootstrap. With
the global credential helper already wired in the clawdbot postStart hook,
all that was missing was `git init` on the workspace itself.

- Adds ensureWorkspaceGitRepo(accountId, { gateway }) — idempotent git init
  + workspace-local user.name/user.email stamped with the accountId so
  commits attribute per-agent ("Clawdbot Agent (nova)" etc.) rather than
  the generic pod-global identity.
- Calls it from provisionOpenClawAccount after normalizeWorkspaceDocs and
  ensureWorkspaceMemoryFiles. Wrapped in try/catch with non-fatal warning,
  matching the sibling workspace-setup steps.
- Extends the TOOLS.md "Git workflow" section so agents discover the
  workspace-is-a-repo fact + credential wiring. Both new-file and existing-
  file paths handled (sed-injects on TOOLS.md from before #437).

The audit's "apt-get install -y git outside the guard" step was NOT needed
— git was already on PATH in the clawdbot image (verified via
`kubectl exec deploy/clawdbot-gateway -- which git` → /usr/bin/git 2.39.5).
Scope is ~50 LOC across one file instead of the audit's 75 across three.

Closes #437.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@samxu01
Copy link
Copy Markdown
Contributor Author

samxu01 commented May 24, 2026

Squash-merged to main per feedback-pr-merge-pattern.

samxu01 added a commit that referenced this pull request May 24, 2026
…d notes (#447, closes #437)

Brings moltbot agents (theo / nova / pixel / ops / aria) to parity with cloud-codex
on git operations. Before this, /workspace/<accountId>/ was a plain directory —
agents could not `git status`, `git commit`, or `git push` without a manual
bootstrap step. With the global credential helper already wired in the clawdbot
postStart hook, all that was missing was `git init` on the workspace itself.

- ensureWorkspaceGitRepo(accountId, { gateway }): idempotent git init + workspace-
  local user.name/user.email stamped with the accountId so commits attribute
  per-agent ("Clawdbot Agent (nova)" etc.).
- Called from provisionOpenClawAccount after normalizeWorkspaceDocs and
  ensureWorkspaceMemoryFiles, wrapped in try/catch (non-fatal).
- TOOLS.md "Git workflow" section extended: both new-file and existing-file
  paths handled; sed-injects the workspace-is-a-repo line on pre-change
  TOOLS.md files.

The audit's apt-get install -y git step was NOT needed — git already on PATH
in the clawdbot image (verified via `kubectl exec deploy/clawdbot-gateway --
which git` → /usr/bin/git 2.39.5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@samxu01 samxu01 closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant