coleam00/Archon · error

Failed to sync repository to ${defaultBranch}. Try /reset or

Error message

Failed to sync repository to ${defaultBranch}. Try /reset or check if the branch exists.

What it means

When a run override spec names a tier or '@'-prefixed alias (isTierName(spec) || spec.startsWith('@')), resolveRunOverrideSpec resolves it through resolveModelSpec against the profile. If the result is still a literal spec (i.e. the tier/alias chain did not bottom out in a concrete provider/model preset), the override cannot be honored and this error is thrown naming both the override target and the unresolvable spec.

Source

Thrown at packages/adapters/src/community/forge/gitea/adapter.ts:520

      const err = error as NodeJS.ErrnoException;
      if (err.code !== 'ENOENT') {
        // Real error - permission denied, I/O failure, etc.
        getLog().error({ repoPath, errorCode: err.code, err }, 'repo_path_access_failed');
        throw new Error(
          `Cannot access repository at ${repoPath}: ${err.code ?? err.message}. ` +
            'Check permissions and disk health.'
        );
      }
      // ENOENT means directory doesn't exist - we'll clone below
    }

    if (directoryExists) {
      if (shouldSync) {
        getLog().info({ repoPath, defaultBranch }, 'repo_syncing');
        const syncResult = await syncRepository(toRepoPath(repoPath), toBranchName(defaultBranch));
        if (!syncResult.ok) {
          getLog().error({ repoPath, defaultBranch }, 'repo_sync_failed');
          throw new Error(
            `Failed to sync repository to ${defaultBranch}. ` +
              'Try /reset or check if the branch exists.'
          );
        }
      }
      return;
    }

    // Directory doesn't exist - clone the repository
    getLog().info({ owner, repo, repoPath }, 'repo_cloning');

    // Create project structure (source/, worktrees/, artifacts/, logs/) before
    // cloning so worktree paths resolve correctly on first webhook clone.
    await ensureProjectStructure(owner, repo);

    // Parse URL to get host for authenticated clone
    const urlObj = new URL(this.baseUrl);
    const repoUrl = `${urlObj.protocol}//${urlObj.host}/${owner}/${repo}.git`;

View on GitHub (pinned to 0773b97458)

Solutions

  1. Replace the spec with a concrete 'provider/model' string so resolution is not needed.
  2. Fix the profile so the named tier/alias resolves: define or correct the missing alias entry the tier points to.
  3. List the profile's defined aliases and tiers and use one that exists.
  4. Resolve the spec yourself with resolveModelSpec + isLiteralSpec before calling, to see where the chain breaks.

Example fix

// before
could not resolve '@fasttrack'  // alias not defined
// after
resolveRunModelOverrides(profile, { fast: 'openai/gpt-4o-mini' });
Defensive patterns

Strategy: validation

Validate before calling

import { resolveModelSpec, isLiteralSpec } from '@archon/workflows/model-validation';
for (const spec of Object.values(overrides)) {
  if (isTierName(spec) || spec.startsWith('@')) {
    if (isLiteralSpec(resolveModelSpec(profile, spec))) throw new Error(`cannot resolve: ${spec}`);
  }
}

Try / catch

try {
  resolveRunModelOverrides(profile, overrides);
} catch (e) {
  if (e instanceof Error && e.message.includes('could not resolve')) {
    console.error('Tier/alias chain did not resolve to a concrete model:', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Overriding a tier with another tier or alias that itself fails to resolve — e.g. the profile has a tier pointing at an undefined alias, or the '@alias' referenced in the override is missing from profile.aliases, or a tier falls back to nothing under resolveTierWithFallback.

Common situations: Tier config chain referencing an alias that was renamed/deleted; '@'-prefixed target whose alias definition was removed; cyclic or dangling alias references left after refactoring the AI profile; profile loaded from a stale config file.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/a462f034dd0c55bd. Report an issue: GitHub.