coleam00/Archon · error

Gitea API error: ${String(response.status)} ${response.statu

Error message

Gitea API error: ${String(response.status)} ${response.statusText} - ${body}

What it means

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.

Source

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

    );

    // Gitea uses issues endpoint for PR comments too
    const url = `${this.baseUrl}/api/v1/repos/${parsed.owner}/${parsed.repo}/issues/${String(parsed.number)}/comments`;

    for (let attempt = 1; attempt <= maxRetries; attempt++) {
      try {
        const response = await fetch(url, {
          method: 'POST',
          headers: {
            Authorization: `token ${this.token}`,
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({ body: markedMessage }),
        });

        if (!response.ok) {
          const body = await response.text();
          throw new Error(
            `Gitea API error: ${String(response.status)} ${response.statusText} - ${body}`
          );
        }

        getLog().debug({ conversationId }, 'comment_posted');
        return;
      } catch (error) {
        const isRetryable = this.isRetryableError(error);
        if (attempt < maxRetries && isRetryable) {
          const delay = this.retryDelayFn(attempt);
          getLog().warn(
            { attempt, maxRetries, conversationId, delayMs: delay },
            'comment_post_retry'
          );
          await new Promise(resolve => setTimeout(resolve, delay));
          continue;
        }
        // Log with full context for debugging

View on GitHub (pinned to 0773b97458)

Solutions

  1. Define the alias first in the AI profile config, then apply the run override.
  2. Fix the alias name in the override to match an existing profile alias exactly.
  3. If the target should be a built-in tier, use the tier name instead of a custom alias.
  4. Dump profile.aliases (or the resolved profile) to list the valid names before overriding.

Example fix

// before (profile has no alias '@fasttrack')
resolveRunModelOverrides(profile, { '@fasttrack': { provider: 'openai', model: 'gpt-4o-mini' } });
// after: define '@fasttrack' in the profile first, or target an existing alias
resolveRunModelOverrides(profile, { '@fast': { provider: 'openai', model: 'gpt-4o-mini' } });
Defensive patterns

Strategy: validation

Validate before calling

if (!isTierName(name) && profile.aliases[name] === undefined) {
  throw new Error(`alias '${name}' must be defined in the profile before overriding`);
}

Type guard

function isKnownAlias(profile: ResolvedAiProfile, name: string): boolean {
  return isTierName(name) || Object.prototype.hasOwnProperty.call(profile.aliases, name);
}

Try / catch

try {
  resolveRunModelOverrides(profile, overrides);
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Cannot rebind unknown alias')) {
    console.error('Define this alias in the AI profile first:', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


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