{"record":{"id":"18fdc3728c76b24e","repo":"coleam00/Archon","slug":"gitea-api-error-string-response-status-resp","errorCode":null,"errorMessage":"Gitea API error: ${String(response.status)} ${response.statusText} - ${body}","messagePattern":"Gitea API error: (.+?) (.+?) - (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/adapters/src/community/forge/gitea/adapter.ts","lineNumber":195,"sourceCode":"    );\n\n    // Gitea uses issues endpoint for PR comments too\n    const url = `${this.baseUrl}/api/v1/repos/${parsed.owner}/${parsed.repo}/issues/${String(parsed.number)}/comments`;\n\n    for (let attempt = 1; attempt <= maxRetries; attempt++) {\n      try {\n        const response = await fetch(url, {\n          method: 'POST',\n          headers: {\n            Authorization: `token ${this.token}`,\n            'Content-Type': 'application/json',\n          },\n          body: JSON.stringify({ body: markedMessage }),\n        });\n\n        if (!response.ok) {\n          const body = await response.text();\n          throw new Error(\n            `Gitea API error: ${String(response.status)} ${response.statusText} - ${body}`\n          );\n        }\n\n        getLog().debug({ conversationId }, 'comment_posted');\n        return;\n      } catch (error) {\n        const isRetryable = this.isRetryableError(error);\n        if (attempt < maxRetries && isRetryable) {\n          const delay = this.retryDelayFn(attempt);\n          getLog().warn(\n            { attempt, maxRetries, conversationId, delayMs: delay },\n            'comment_post_retry'\n          );\n          await new Promise(resolve => setTimeout(resolve, delay));\n          continue;\n        }\n        // Log with full context for debugging","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/adapters/src/community/forge/gitea/adapter.ts#L177-L213","documentation":"When a run-level model override targets a custom alias, presetForOverrideTarget looks up the existing preset in the resolved profile's alias table. If the name is not a tier, not reserved, has a valid custom-alias prefix, but no alias with that name has been defined in the profile, this error is thrown: you cannot rebind an alias that does not exist yet.","triggerScenarios":"Calling resolveRunModelOverrides with an override key (or '@'-style target) that is not a TierName and not present in profile.aliases — e.g. overriding '@myfastmodel' when the profile only defines '@fast'; renaming an alias in the profile but not in run overrides.","commonSituations":"Typo in the alias name in the run override; alias deleted from the AI profile config while old run configs still reference it; assuming overrides can create new aliases (they only rebind existing ones).","solutions":["Define the alias first in the AI profile config, then apply the run override.","Fix the alias name in the override to match an existing profile alias exactly.","If the target should be a built-in tier, use the tier name instead of a custom alias.","Dump profile.aliases (or the resolved profile) to list the valid names before overriding."],"exampleFix":"// before (profile has no alias '@fasttrack')\nresolveRunModelOverrides(profile, { '@fasttrack': { provider: 'openai', model: 'gpt-4o-mini' } });\n// after: define '@fasttrack' in the profile first, or target an existing alias\nresolveRunModelOverrides(profile, { '@fast': { provider: 'openai', model: 'gpt-4o-mini' } });","handlingStrategy":"validation","validationCode":"if (!isTierName(name) && profile.aliases[name] === undefined) {\n  throw new Error(`alias '${name}' must be defined in the profile before overriding`);\n}","typeGuard":"function isKnownAlias(profile: ResolvedAiProfile, name: string): boolean {\n  return isTierName(name) || Object.prototype.hasOwnProperty.call(profile.aliases, name);\n}","tryCatchPattern":"try {\n  resolveRunModelOverrides(profile, overrides);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Cannot rebind unknown alias')) {\n    console.error('Define this alias in the AI profile first:', e.message);\n  } else throw e;\n}","preventionTips":["Keep the set of run-override targets derived from the profile's alias keys, not hand-written","Search your profile config for the alias before adding an override for it","Treat run overrides as rebinding-only; create new aliases in the profile config","After renaming an alias, grep configs for the old name"],"tags":["configuration","validation","alias"],"backgroundTag":"unknown-identifier","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}