Frontmatter
| id | 8103 |
| title | [GitHub Workflow] Add syncOnStartup configuration |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Dec 13, 2025, 1:46 PM |
| updatedAt | Dec 13, 2025, 2:06 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8103 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 13, 2025, 2:06 PM |
[GitHub Workflow] Add syncOnStartup configuration
tobiu assigned to @tobiu on Dec 13, 2025, 1:52 PM

tobiu
Dec 13, 2025, 2:04 PM
Input from gemini:
✦ I have successfully implemented the
syncOnStartupfeature and hardened the startup sequence.Changes:
- Config: Added
syncOnStartup: truetoai/mcp/server/github-workflow/config.mjs.- HealthService: Implemented In-Flight Deduplication for
healthcheck(). This prevents the "thundering herd" problem where multiple services (Server & SyncService) trigger parallelghCLI calls during startup.- SyncService: Added
initAsync()logic to triggerrunFullSync()on startup only if the system is healthy. It includes a try-catch block to ensure the service initializes even if the sync fails (e.g. network issues).- Server: Updated
initAsync()toawait SyncService.ready(). This ensures the server waits for the cache to be populated (or the attempt to finish) before accepting MCP tool requests.The server is now robust against race conditions and will automatically keep the issue cache fresh.
tobiu closed this issue on Dec 13, 2025, 2:06 PM
Objective
Add a
syncOnStartupconfiguration option to the GitHub Workflow MCP server to automatically trigger a full sync when the server starts. This includes hardening theHealthServiceto handle concurrent checks during the chaotic startup phase.Description
The GitHub Workflow server needs to sync issues on startup to ensure a fresh cache. Since both the
Serverand theSyncServicewill need to check system health during initialization, we must ensure they don't race and trigger parallel, redundantghCLI processes.Implementation Details
Config: Add
syncOnStartup: truetoai/mcp/server/github-workflow/config.mjs.HealthService (
ai/mcp/server/github-workflow/services/HealthService.mjs):#healthCheckPromise) to store the pending check.healthcheck(), if a check is in progress, return the existing promise.this.#performHealthCheck(), store the promise, and clear it upon completion/failure.SyncService (
ai/mcp/server/github-workflow/services/SyncService.mjs):initAsync().aiConfig.syncOnStartup.await HealthService.healthcheck().status === 'healthy': Callawait this.runFullSync().status !== 'healthy': Log a warning ("Skipping startup sync: GitHub CLI unhealthy") and return.try/catchto prevent service crash on sync failure.Server (
ai/mcp/server/github-workflow/Server.mjs):SyncService.initAsync, addawait SyncService.ready()after the server's own health check. This ensures strict ordering: Server verifies environment -> SyncService completes (synced or skipped) -> Server opens for business.