fix(dolt): exit 0 when push/pull finds no remote configured#3194
Open
sjsyrek wants to merge 1 commit intogastownhall:mainfrom
Open
fix(dolt): exit 0 when push/pull finds no remote configured#3194sjsyrek wants to merge 1 commit intogastownhall:mainfrom
sjsyrek wants to merge 1 commit intogastownhall:mainfrom
Conversation
bd dolt push and bd dolt pull now exit 0 with an informational message when no Dolt remote is configured, instead of exiting 1 with an error. This makes the session close protocol safe for agents to follow regardless of whether the user has set up Dolt replication. Also deduplicates the "no remote" guidance that was copy-pasted across the force-push and regular-push branches into a shared helper, and applies the same treatment to bd dolt pull. Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
Fixes #3031.
bd dolt pushandbd dolt pullexit 1 when no Dolt remote is configured, causing agent session-close protocols to error out. This changes both commands to exit 0 with an informational message when the error is specifically "remote not found", since the absence of a remote is a valid configuration — not a failure.Changes Made
printNoRemoteGuidance()helper incmd/bd/dolt.go— prints the existing "no remote" guidance to stdout (not stderr) and returns without error. Replaces the duplicated guidance blocks in push and pull.bd dolt pushexit behavior — whenisRemoteNotFoundErr()is true, callsprintNoRemoteGuidance()and returns (exit 0) instead ofos.Exit(1). Other errors (diverged history, connection failures) still exit 1.bd dolt pullexit behavior — same treatment: graceful exit 0 on remote-not-found, error exit on everything else.TestPrintNoRemoteGuidance— verifies the guidance mentions "No remote is configured", "skipping", and how to add a remote.Backward Compatibility
✅ No behavioral change for configured remotes: push/pull with a valid remote work exactly as before
✅ No behavioral change for other errors: diverged history, connection failures, auth errors still exit 1
✅ Agents benefit immediately: session close protocols that call
bd dolt pushwill no longer fail on fresh workspacesTechnical Details
The key behavioral changes:
bd dolt push(no remote)bd dolt pull(no remote)bd dolt push(diverged)bd dolt push(auth fail)The guidance text is written to stdout (not stderr) because it's informational, not an error condition.
Size: Small ✓
Two-file change with a net reduction in code (deduplication removes ~20 lines of copy-pasted guidance).
🤖 Generated with Claude Code