Skip to content

fix: retry repository ref updates after concurrent pushes - #3245

Open
lorenzozanee wants to merge 1 commit into
github:mainfrom
lorenzozanee:fix/retry-concurrent-ref-updates
Open

fix: retry repository ref updates after concurrent pushes#3245
lorenzozanee wants to merge 1 commit into
github:mainfrom
lorenzozanee:fix/retry-concurrent-ref-updates

Conversation

@lorenzozanee

Copy link
Copy Markdown

Summary

Retry repository file-operation ref updates after concurrent pushes by rebuilding the change from the latest branch tip.

Why

A concurrent writer can advance a branch between the initial read and the non-force ref update, causing the prepared commit to be rejected.
Fixes #2481

What changed

  • Share tree, commit, and ref-update logic between push_files and delete_file.
  • Retry fast-forward conflicts by reading the current branch tip and rebuilding the commit.
  • Normalize file argument encodings accepted by MCP hosts.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@lorenzozanee
lorenzozanee requested a review from a team as a code owner September 7, 2026 23:53
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.

Intermittent commit/push failures when using GitHub MCP connector for file operations and branch management, via Grok official Connector

1 participant