fix(deliver): name both first-push errors #222
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/first-push-errors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Agent Foundry gives coding agents their working rules as skills; the
deliverskill'sland.mdtells an agent how to push a finishedbranch. Under Claude Code's sandbox, which keeps git's configuration
read-only, a branch's first push lands and then prints two errors.
land.mdnamed only the second, so an agent met acould not lock config fileerror the skill did not foresee and had toconfirm the push by other means. The branch was also left without an
upstream, and nobody told the user: the sentence on it sits in
docs/SANDBOX.md, which a repository that adopts Agent Foundry does notreceive. It happens on every first push from the sandbox.
Pushing without
-uinside the sandbox was set aside: it gives the sameoutcome, and the agent would have to tell whether the sandbox is on
before pushing. Pushing always without
-uwas set aside becausebranches pushed outside the sandbox would lose their upstream.
Closes #219
What changed
Before, an agent reading
land.mdknew one of the two errors and wenton without a word about the upstream. Now the item quotes both errors,
and when the push prints them the agent goes on and tells the user that
the branch has no upstream, with the command that sets it outside the
sandbox. The command names the branch, so it works from any checkout.
The push itself stays
git push -u <remote> <branch>. The change is inthe first item of
.agents/skills/deliver/land.md, and the first-pushtest of
tests/agent-config/real-source.shnow also checks thatland.mdquotes each error git prints.How to verify
Have Git 2.48 or later and a shell.
The problem. A read-only config, as the sandbox holds it, is an empty
.git/config.lock:The push creates the branch, then prints
error: could not lock config file .git/config: File existsanderror: unable to write upstream branch configuration, and the lastcommand prints nothing. In a clone of this repository,
maindoesnot name the first error:
prints nothing.
The solution. The same search on the branch:
prints
origin/fix/first-push-errors:.agents/skills/deliver/land.md:1,and the item's command,
git branch --set-upstream-to=origin/topic topic, run in/tmp/trialafterrm .git/config.lock, sets theupstream.
The checks of
docs/MAINTENANCE.mdpass on the tip, and the extendedfirst-push test fails on
mainwithland.md quotes no part of: error: could not lock config file .git/config: File exists.Not tried: an agent delivering a branch in a trial repository under the
sandbox with the new text, which needs a session of its own; and the
last command of step 3, which was not run.
Considerations
docs/SANDBOX.mdkeeps its own sentence on this push for developers,since
land.mdis the only copy an adopting repository's agents have.