abhigyanpatwari/GitNexus · error

Invalid auto-sync work item

Error message

Invalid auto-sync work item

What it means

A sentinel validation error inside runAutoSyncOnce: when iterating the work items produced by buildWorkItems, an entry fails the per-item validity check (missing/invalid repo identifier, malformed entry), so the loop throws this generic guard message instead of attempting to clone/pull an unusable item. The faulty input is the individual work-item object, not the overall config — it usually indicates a bug in work-item construction or a corrupted watch/feed source.

Source

Thrown at gitnexus/src/core/auto-sync/runner.ts:124

  );
  logger.info(
    `[auto-sync] Starting sync loop with max_concurrency=${actualConcurrency} analyze_failure_threshold=${config.analyzeFailureThreshold}.`,
  );

  const workItems = await buildWorkItems(config, deps);
  // What will actually run at once. One repo means one worker, so the common
  // single-project case still hands that worker the whole machine budget.
  const analysisParallelism = Math.max(1, Math.min(actualConcurrency, workItems.length));
  const repoResults = await mapWithConcurrency(
    workItems,
    actualConcurrency,
    options.signal,
    async (item) => {
      const lastSyncTime = now().toISOString();
      try {
        throwIfAborted(options.signal);
        if (!item.cloneRoot || !item.repoName || !item.targetDir) {
          throw new Error(item.error ?? 'Invalid auto-sync work item');
        }
        const repoName = item.repoName;
        const targetDir = item.targetDir;
        const syncResult = await syncFirstAvailableBranch({
          item,
          repoName,
          targetDir,
          timeoutMs: config.repoGitTimeoutMs,
          deps,
          logger,
        });
        throwIfAborted(options.signal);
        if (syncResult.ok === false) {
          logger.error(
            `[auto-sync] Repository sync failed for ${item.remoteUrl}; no configured branch could be pulled: ${syncResult.message}`,
          );
          return {
            kind: 'failed' as const,

View on GitHub (pinned to 0d1aed942f)

Solutions

  1. Inspect the auto-sync configuration/watch feed for entries with missing repo URLs or identifiers that produce malformed work items
  2. Update GitNexus to the latest patch release in case a fixed buildWorkItems bug produced invalid items
  3. Report the issue with the config snippet if no entry looks malformed — the throw indicates an internal invariant break
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at gitnexus/src/core/auto-sync/runner.ts:124 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of abhigyanpatwari/GitNexus@0d1aed942f (2026-09-08). Data as JSON: /api/errors/168d3dd066900bbf. Report an issue: GitHub.