{"record":{"id":"aefa232e43418621","repo":"diegosouzapw/OmniRoute","slug":"the-model-omniroute-table-exists-and-omniroute-d","errorCode":null,"errorMessage":"The [model.omniroute] table exists and OmniRoute does not own it","messagePattern":"The \\[model\\.omniroute\\] table exists and OmniRoute does not own it","errorType":"validation","errorClass":"GrokBuildConfigConflictError","httpStatus":null,"severity":"error","filePath":"src/shared/services/grokBuildConfig.ts","lineNumber":229,"sourceCode":"  const section = parseModelSection(toml, GROK_MAIN_MODEL_SLOT);\n  if (!section) return false;\n  const body = getSectionBody(toml, `model.${GROK_MAIN_MODEL_SLOT}`) ?? \"\";\n  const keys = [...body.matchAll(/^\\s*([A-Za-z0-9_-]+)\\s*=/gm)].map((match) => match[1]);\n  const allowed = new Set([\"model\", \"base_url\", \"name\", \"description\", \"api_backend\", \"api_key\"]);\n  return (\n    keys.every((key) => allowed.has(key)) &&\n    section.model !== null &&\n    section.base_url !== null &&\n    section.name === \"OmniRoute\" &&\n    section.api_backend === \"chat_completions\" &&\n    getSectionString(toml, `model.${GROK_MAIN_MODEL_SLOT}`, \"description\") === LEGACY_DESCRIPTION\n  );\n};\n\nconst assertMainSlotOwnership = (toml: string): void => {\n  const body = getSectionBody(toml, `model.${GROK_MAIN_MODEL_SLOT}`);\n  if (body === null || body.includes(MANAGED_MARKER) || isLegacyOwnedMainSection(toml)) return;\n  throw new GrokBuildConfigConflictError();\n};\n\nexport class GrokBuildConfigConflictError extends Error {\n  constructor() {\n    super(\"The [model.omniroute] table exists and OmniRoute does not own it\");\n    this.name = \"GrokBuildConfigConflictError\";\n  }\n}\n\n/** Parse the Grok Build fields that OmniRoute manages. */\nexport function parseGrokBuildConfig(toml: string): GrokBuildSettings {\n  if (toml.trim()) parseToml(toml);\n  const subagentModels = {} as Record<GrokSubagentType, GrokModelConfig | null>;\n  const subagentMappings = {} as Record<GrokSubagentType, string | null>;\n  for (const type of GROK_SUBAGENT_TYPES) {\n    const mapping = getSectionString(toml, SUBAGENT_MODELS_SECTION, type);\n    subagentMappings[type] = mapping;\n    subagentModels[type] = mapping === modelSlot(type) ? parseModelSection(toml, mapping) : null;","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/services/grokBuildConfig.ts#L211-L247","documentation":"Error \"The [model.omniroute] table exists and OmniRoute does not own it\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/shared/services/grokBuildConfig.ts:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}