LearnNewsExamplesServices
Frontmatter
id9800
title[MCP] GitHub Workflow: Autonomous Swarm Synchronization & Post-Sync Auto-Push
stateClosed
labels
enhancementai
assigneestobiu
createdAtApr 9, 2026, 1:16 AM
updatedAtApr 9, 2026, 1:17 AM
githubUrlhttps://github.com/neomjs/neo/issues/9800
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 9, 2026, 1:17 AM

[MCP] GitHub Workflow: Autonomous Swarm Synchronization & Post-Sync Auto-Push

Closedenhancementai
tobiu
tobiu commented on Apr 9, 2026, 1:16 AM

The Problem

The autonomous agent swarm requires a reliable transport mechanism to sync episodic memory across distributed hardware nodes (e.g., Mac 1 and Mac 2). Without a shared raw SQLite database, the agent instances suffer from "Boot Amnesia." While we have an hourly CI pipeline that syncs GitHub issues to the local filesystem for knowledge retrieval, the AI agents themselves could not push their newly generated context back to the remote repository.

The Architectural Reality

We implemented a robust auto-commit and push mechanism directly within the GitHub Workflow MCP server to handle remote syncing.

  • Target Path: ai/mcp/server/github-workflow/services/SyncService.mjs
  • Mechanism: Inside runFullSync(), we check the Git status for the resources/content directory.
  • Metadata Filtering: If only .sync-metadata.json changed, we automatically roll it back (git restore) to prevent pointless, noisy commits.
  • Push & Merge Strategy: For actual content changes, it uses git pull --rebase --autostash before pushing to handle potential conflicts with the hourly CI node or other swarm instances without detached HEAD states.
  • Security Configuration: Integrated with dynamic viewer permission gating (RepositoryService.getViewerPermission()) to ensure the agent has WRITE, MAINTAIN, or ADMIN roles before auto-pushing. Added configuration toggles (pushToRepoAfterSync) in config.template.mjs and config.mjs.

Avoided "Gold Standards" / Traps

  • Avoided Standard Stash/Pop: Standard Git workflows often suggest git stash followed by a git stash pop. In an autonomous, stateless background daemon, resolving merge conflicts from popped stashes is a death trap. Instead, --rebase --autostash ensures clean history and atomic re-application, avoiding interactive prompt deadlocks.
  • Avoided Blind Pushes: Pushing blindly without explicit permission checks leads to unhandled permission-denied crashes. By integrating GraphQL permission scoping, the MCP server guarantees safety up front.
tobiu added the enhancement label on Apr 9, 2026, 1:16 AM
tobiu added the ai label on Apr 9, 2026, 1:16 AM
tobiu referenced in commit 055e464 - "feat: Add post-sync auto-push to MCP GitHub Workflow (#9800)" on Apr 9, 2026, 1:17 AM
tobiu assigned to @tobiu on Apr 9, 2026, 1:17 AM
tobiu
tobiu Apr 9, 2026, 1:17 AM

Input from Antigravity (Gemini 3.1 Pro):

✦ Implementation pushed and verified. The SyncService now automatically commits and pushes episodic memory data using --rebase --autostash to prevent staging deadlocks. The ticket is ready to close.

tobiu closed this issue on Apr 9, 2026, 1:17 AM