{"record":{"id":"a462f034dd0c55bd","repo":"coleam00/Archon","slug":"failed-to-sync-repository-to-defaultbranch-try","errorCode":null,"errorMessage":"Failed to sync repository to ${defaultBranch}. Try /reset or check if the branch exists.","messagePattern":"Failed to sync repository to (.+?)\\. Try /reset or check if the branch exists\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/adapters/src/community/forge/gitea/adapter.ts","lineNumber":520,"sourceCode":"      const err = error as NodeJS.ErrnoException;\n      if (err.code !== 'ENOENT') {\n        // Real error - permission denied, I/O failure, etc.\n        getLog().error({ repoPath, errorCode: err.code, err }, 'repo_path_access_failed');\n        throw new Error(\n          `Cannot access repository at ${repoPath}: ${err.code ?? err.message}. ` +\n            'Check permissions and disk health.'\n        );\n      }\n      // ENOENT means directory doesn't exist - we'll clone below\n    }\n\n    if (directoryExists) {\n      if (shouldSync) {\n        getLog().info({ repoPath, defaultBranch }, 'repo_syncing');\n        const syncResult = await syncRepository(toRepoPath(repoPath), toBranchName(defaultBranch));\n        if (!syncResult.ok) {\n          getLog().error({ repoPath, defaultBranch }, 'repo_sync_failed');\n          throw new Error(\n            `Failed to sync repository to ${defaultBranch}. ` +\n              'Try /reset or check if the branch exists.'\n          );\n        }\n      }\n      return;\n    }\n\n    // Directory doesn't exist - clone the repository\n    getLog().info({ owner, repo, repoPath }, 'repo_cloning');\n\n    // Create project structure (source/, worktrees/, artifacts/, logs/) before\n    // cloning so worktree paths resolve correctly on first webhook clone.\n    await ensureProjectStructure(owner, repo);\n\n    // Parse URL to get host for authenticated clone\n    const urlObj = new URL(this.baseUrl);\n    const repoUrl = `${urlObj.protocol}//${urlObj.host}/${owner}/${repo}.git`;","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/adapters/src/community/forge/gitea/adapter.ts#L502-L538","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Replace the spec with a concrete 'provider/model' string so resolution is not needed.","Fix the profile so the named tier/alias resolves: define or correct the missing alias entry the tier points to.","List the profile's defined aliases and tiers and use one that exists.","Resolve the spec yourself with resolveModelSpec + isLiteralSpec before calling, to see where the chain breaks."],"exampleFix":"// before\ncould not resolve '@fasttrack'  // alias not defined\n// after\nresolveRunModelOverrides(profile, { fast: 'openai/gpt-4o-mini' });","handlingStrategy":"validation","validationCode":"import { resolveModelSpec, isLiteralSpec } from '@archon/workflows/model-validation';\nfor (const spec of Object.values(overrides)) {\n  if (isTierName(spec) || spec.startsWith('@')) {\n    if (isLiteralSpec(resolveModelSpec(profile, spec))) throw new Error(`cannot resolve: ${spec}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  resolveRunModelOverrides(profile, overrides);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('could not resolve')) {\n    console.error('Tier/alias chain did not resolve to a concrete model:', e.message);\n  } else throw e;\n}","preventionTips":["Point tier/alias overrides at concrete 'provider/model' strings when unsure","Keep every tier's alias target defined in the profile; audit after renames","Resolve specs with resolveModelSpec ahead of time in tooling/scripts","Validate the whole AI profile on load so dangling alias references surface early"],"tags":["configuration","resolution","model-override"],"backgroundTag":"unresolved-reference","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}