{"record":{"id":"b896f753197fb510","repo":"coleam00/Archon","slug":"gitea-api-error-string-response-status","errorCode":null,"errorMessage":"Gitea API error: ${String(response.status)}","messagePattern":"Gitea API error: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/adapters/src/community/forge/gitea/adapter.ts","lineNumber":419,"sourceCode":"  /**\n   * Fetch comment history from issue or PR\n   * Returns comments in chronological order (oldest first)\n   */\n  private async fetchCommentHistory(\n    owner: string,\n    repo: string,\n    number: number\n  ): Promise<string[]> {\n    try {\n      const url = `${this.baseUrl}/api/v1/repos/${owner}/${repo}/issues/${String(number)}/comments`;\n      const response = await fetch(url, {\n        headers: {\n          Authorization: `token ${this.token}`,\n        },\n      });\n\n      if (!response.ok) {\n        throw new Error(`Gitea API error: ${String(response.status)}`);\n      }\n\n      const comments = (await response.json()) as {\n        user?: { login: string } | null;\n        body?: string | null;\n      }[];\n\n      // Gitea returns comments in chronological order by default\n      // Take last 20 for context\n      return comments.slice(-20).map(comment => {\n        const author = comment.user?.login ?? 'unknown';\n        const body = comment.body ?? '';\n        return `${author}: ${body}`;\n      });\n    } catch (error) {\n      getLog().error(\n        { err: error, owner, repo, issueNumber: number },\n        'comment_history_fetch_failed'","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/adapters/src/community/forge/gitea/adapter.ts#L401-L437","documentation":"normalizeRunOverridePreset normalizes a run-level model override preset through normalizeStrictRunModelPreset, which enforces the strict preset shape (valid provider, model string, allowed fields). When that validator throws RunModelPresetValidationError, it is re-thrown as a plain Error that names the override target and embeds the validator's message, so the developer knows which override entry is malformed.","triggerScenarios":"Calling resolveRunModelOverrides where an override value like `tier='x'` expands (or is given directly) to a RawAliasEntry with an unknown provider, missing model, empty string, or extra/invalid fields — anything normalizeStrictRunModelPreset rejects.","commonSituations":"YAML/env run overrides like `MODEL_OVERRIDE_reasoning='gpt-5'` omitting the provider; unsupported provider slug ('open ai', 'anthropicx'); trailing whitespace or quoting artifacts; copying a preset shape from an older Archon version with fields that no longer exist.","solutions":["Read the embedded error.message after the target name — it states exactly which field is invalid.","Provide the full strict preset shape: a valid provider slug plus a model string, e.g. { provider: 'anthropic', model: 'claude-sonnet-4' }.","Use the 'provider/model' shorthand spec instead of a raw object if you only know provider and model.","Validate the preset with normalizeStrictRunModelPreset in a try/catch before passing it if constructing programmatically."],"exampleFix":"// before\n{ reasoning: { provider: 'openai' } }            // missing model\n// after\n{ reasoning: { provider: 'openai', model: 'gpt-4o' } }","handlingStrategy":"validation","validationCode":"import { normalizeStrictRunModelPreset } from '@archon/workflows/model-validation';\ntry { normalizeStrictRunModelPreset(preset); } catch (e) { console.error('invalid preset', e); }","typeGuard":"function isValidPreset(p: unknown): p is { provider: string; model: string } {\n  return typeof p === 'object' && p !== null &&\n    'provider' in p && typeof (p as any).provider === 'string' &&\n    'model' in p && typeof (p as any).model === 'string';\n}","tryCatchPattern":"try {\n  resolveRunModelOverrides(profile, overrides);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Model override')) {\n    console.error('Fix the malformed override entry:', e.message);\n  } else throw e;\n}","preventionTips":["Always specify both provider and model in override presets","Use provider slugs exactly as documented (lowercase, no spaces)","Prefer the 'provider/model' string shorthand over raw objects in env/YAML","Validate presets with normalizeStrictRunModelPreset before passing them programmatically"],"tags":["configuration","validation","model-preset"],"backgroundTag":"schema-validation-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}