environment skill: put git checkouts on local disk, and push before stopping - #50
Open
lvwerra wants to merge 1 commit into
Open
environment skill: put git checkouts on local disk, and push before stopping#50lvwerra wants to merge 1 commit into
lvwerra wants to merge 1 commit into
Conversation
…topping Two failure modes this Space produces reliably, neither of which the skill warned about. A git repo on the /data bucket is slow (every object read is a round trip to object storage) and quietly wrong: object storage holds no exec bit, so hooks never fire — the git-lfs pre-push hook silently doesn't run and the push sends pointers with no objects, which the Hub rejects with a confusing message (README "LFS objects go up first") — and the mount's phantom directories have broken `git commit` outright by materialising a directory where git expected a hook file (docs/fuse-phantom-directories.md). The obvious fix is to clone onto $AM_LOCAL, which introduces the second failure mode: that disk dies with the container, and the hourly backup copies the bucket and nothing else. An agent that clones there and stops mid-task with unpushed commits loses the work, silently, whenever the Space next restarts. So the skill now says both halves together: clone into $AM_LOCAL/git/<repo>, and commit and push at the end of every turn that produced work worth keeping — with `git bundle` into the workspace as the fallback when there is no remote. Also notes $AM_LOCAL's volatility in "What persists", which previously mentioned local disk only as an OpenClaw footnote. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
environmentskill (generated inserver/src/index.js, published into every agent's skills directory) told agents to keep work in their workspace folder and said nothing about git. Two failure modes follow from that, and both are things this Space reliably produces.A git repo on
/datais slow and quietly wrong. Every object read is a round trip to object storage. Worse, object storage holds no exec bit, so git hooks never fire — thegit lfspre-push hook silently doesn't run and the push sends LFS pointers with no objects behind them, which the Hub rejects with a confusing error (already documented in the README under "LFS objects go up first"). And the mount's phantom directories have brokengit commitoutright by materialising a directory where git expected a hook file (docs/fuse-phantom-directories.md).The fix for that introduces the second failure mode.
$AM_LOCALis the container's own disk: it dies with the container, and the hourly backup Job copies the/databucket and nothing else. An agent that clones there, does good work, and stops with unpushed commits loses it silently at the next restart. Nothing in the skill said so — local disk appeared only as an OpenClaw footnote under "What persists".So the skill now carries both halves together, as a new "Git repos: clone on local disk, push before you stop" section:
$AM_LOCAL/git/<repo>, not under/data, with the concrete reasons above so it doesn't read as a style preference;git bundle create /data/workspaces/$AM_SESSION/<repo>.bundle --allon the bucket;Plus three one-line touch-ups for consistency: a
$AM_LOCALvolatility bullet under "What persists", a pointer from "Keep work inside your workspace folder", and "git checkouts" added to what$AM_LOCALis for.Text only — no logic, no new config, nothing conditional. The skill is regenerated on the Space at startup and whenever secret notes change, so this lands the next time the Space restarts.
Verified
$AM_LOCAL/$AM_SESSIONsurvive as literal shell variables rather than being eaten as${}interpolation.node --check server/src/index.jsclean.npm testinserver/— all 7 suites pass (spawn-group, repin, opencode-resume, terminal-modes, trace-tail, migration, resize).No test asserts on skill content, so the render check above is what actually covers this.