feat(git): land a box branch on the host without publishing (git push --host-only)#130
Merged
Conversation
… --host-only) Add a `--host-only` flag to `agentbox git push <box>` and in-box `agentbox-ctl git push` that makes the box's branch available in the host's *local* repo without pushing to any remote — nothing is published online. The destination branch defaults to the box's current branch name; `--as <branch>` overrides it and `--force` allows a non-fast-forward overwrite. `--host-only` is incompatible with `--remote` (exit 64). Because nothing leaves the host, the relay skips the push-confirm gate / host-initiated-token path entirely. Docker copies the box branch ref within the shared bind-mounted `.git/` via a self-fetch (`handleGitSaveToHost`); cloud reuses the push flow's git-bundle pull-back, stopping before the remote push (`runGitRpc` short-circuit), so all four cloud providers are covered. The in-box agent system prompt (custom-system-CLAUDE.md, all providers) and the docs (host-relay, features, web cli/sync-and-git) document the new mode. Claude-Session: https://claude.ai/code/session_01TmyXca2hNF9TtK6q9MAh1L
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Making `--force` a known option on `push` (for `--host-only`) meant Commander consumed it for every push, but only the host-only path forwarded it — a normal `agentbox git push <box> --force` silently dropped `--force` (`params.force` is only honored on the host-only land path). Re-append `--force` to the forwarded git args on a remote push, in both the host CLI and in-box ctl, so the relay appends it to `git push <remote> <branch>`. The host CLI's predicted params hash stays in lockstep with ctl's normalized args tail. Add a pure unit test for ctl's buildParams covering remote --force re-forwarding vs host-only params. Verified live (docker): non-ff push rejected without --force (exit 1, remote unchanged), forced update succeeds with --force; host-only land still works. Claude-Session: https://claude.ai/code/session_01TmyXca2hNF9TtK6q9MAh1L
Owner
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2ab9f58. Configure here.
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.
What
Adds a
--host-onlyflag toagentbox git push <box>(host CLI) and the in-boxagentbox-ctl git push. It makes the box's branch available in the host's local repo without pushing to any remote — nothing is published online. Useful for pulling a box's work onto your laptop togit checkout/ keep iterating / review before deciding whether to publish.--as <branch>overrides it.--forcepermits a non-ff overwrite.--host-onlyis incompatible with--remote(exit 64).How
Same
git.pushRPC method with a newparams.hostOnly(+as/force). Because nothing leaves the host, the relay skips the push-confirm gate / host-initiated-token path entirely (that gate guards remote pushes).handleGitSaveToHost,server.ts): the box commits already live in the bind-mounted.git/, so it copies the box branch torefs/heads/<dest>via a self-fetch (git -C <hostMainRepo> fetch . <src>:refs/heads/<dest>).dest == src→ no-op success.runGitRpcshort-circuit,host-actions.ts): reuses the push flow's git-bundle pull-back (bundle in sandbox → download →git fetch <bundle> <src>:refs/heads/<dest>) without the final remote push. Covers all four cloud providers (daytona/hetzner/vercel/e2b) via the sharedCloudBoxPoller→executeCloudActionpath.Docs
Updated the in-box agent system prompt (
custom-system-CLAUDE.md, all 5 providers) anddocs/host-relay.md,docs/features.md,apps/web/content/docs/{cli,sync-and-git}.mdx.Verification (docker, live)
--host-only --as host-landed→ branch lands at the box tip on the host;git ls-remote origin host-landedis empty (not published).--as) → no-op "already available".agentbox-ctl git push --host-only --as inbox-landed→ lands on host.--force; forced update with--force.--host-only --remote origin→ rejected (exit 64).pnpm typecheck(25/25),pnpm lint(13/13), relay (187) + ctl (296) unit tests all green.https://claude.ai/code/session_01TmyXca2hNF9TtK6q9MAh1L
Note
Medium Risk
Touches relay git.push gating and ref updates on the host repo; behavior is scoped to a new flag but incorrect ref handling could overwrite local branches.
Overview
Adds
git push --host-onlyonagentbox git push <box>and in-boxagentbox-ctl git push, so a box branch can be copied into the host’s local repo without pushing to any remote. Optional--as <branch>picks the destination ref (default: the box branch);--forceallows a non–fast-forward overwrite.--host-onlywith--remoteis rejected (exit 64).The same
git.pushRPC now carrieshostOnly/as/force. Because nothing is published, the relay skips the push-approval gate and host-initiated token path. Docker lands viahandleGitSaveToHost(self-fetch intorefs/heads/<dest>); cloud reuses bundle pull-back inrunGitRpcwithout the final remote push.The host CLI skips token minting for
--host-only; ctlbuildParamsmaps host-onlyforceto RPC params and re-appends--forcefor normal remote pushes (new unit tests). Docs and in-box agent prompts are updated across providers.Reviewed by Cursor Bugbot for commit 2ab9f58. Configure here.