{"record":{"id":"5ba8036584aa2842","repo":"srbhr/Resume-Matcher","slug":"unsupported-prompt-id-request-default-prompt-id","errorCode":null,"errorMessage":"Unsupported prompt id: {request.default_prompt_id}. Supported: {sorted(option_ids)}","messagePattern":"Unsupported prompt id: (.+?)\\. Supported: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"warning","filePath":"apps/backend/app/routers/config.py","lineNumber":376,"sourceCode":"\n    return PromptConfigResponse(\n        default_prompt_id=default_prompt_id,\n        prompt_options=options,\n    )\n\n\n@router.put(\"/prompts\", response_model=PromptConfigResponse)\nasync def update_prompt_config(\n    request: PromptConfigRequest,\n) -> PromptConfigResponse:\n    \"\"\"Update prompt configuration for resume tailoring.\"\"\"\n    stored = _load_config()\n    options = _get_prompt_options()\n    option_ids = {option.id for option in options}\n\n    if request.default_prompt_id is not None:\n        if request.default_prompt_id not in option_ids:\n            raise HTTPException(\n                status_code=400,\n                detail=(\n                    \"Unsupported prompt id: \"\n                    f\"{request.default_prompt_id}. Supported: {sorted(option_ids)}\"\n                ),\n            )\n        stored[\"default_prompt_id\"] = request.default_prompt_id\n\n    _save_config(stored)\n\n    default_prompt_id = stored.get(\"default_prompt_id\", DEFAULT_IMPROVE_PROMPT_ID)\n    if default_prompt_id not in option_ids:\n        default_prompt_id = DEFAULT_IMPROVE_PROMPT_ID\n\n    return PromptConfigResponse(\n        default_prompt_id=default_prompt_id,\n        prompt_options=options,\n    )","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/srbhr/Resume-Matcher/blob/116f9cc3b00e1ac91734a6c2679bf41ea64a0edc/apps/backend/app/routers/config.py#L358-L394","documentation":"A 400 HTTPException raised by update_prompt_config when request.default_prompt_id is not among the ids of currently available prompt options. The default prompt must reference an existing option known to _get_prompt_options().","triggerScenarios":"PUT/POST prompt config with default_prompt_id pointing to a prompt that no longer exists, was renamed, was added by a plugin/extension that isn't loaded, or is a hardcoded stale id.","commonSituations":"Config persisted from an older version whose prompt ids changed; referencing a custom prompt defined in a plugin that failed to load; typo in the prompt id.","solutions":["Fetch current prompt options (GET prompt config/options) and use one of the returned ids","If migrating configs, remap old prompt ids to their new equivalents","Ensure any plugin providing custom prompts is installed/enabled before setting its id"],"exampleFix":"// before\nawait api.updatePromptConfig({ default_prompt_id: 'legacy_professional_v1' })\n// after\nconst { options } = await api.getPromptOptions()\nawait api.updatePromptConfig({ default_prompt_id: options[0].id })","handlingStrategy":"validation","validationCode":"const { options } = await api.getPromptOptions()\nconst validIds = new Set(options.map(o => o.id))\nif (promptId && !validIds.has(promptId)) {\n  promptId = options[0].id\n}","typeGuard":null,"tryCatchPattern":"try {\n  await api.updatePromptConfig({ default_prompt_id: id })\n} catch (e) {\n  if (e.response?.status === 400 && String(e.response.data.detail).startsWith('Unsupported prompt id')) {\n    const { options } = await api.getPromptOptions()\n    await api.updatePromptConfig({ default_prompt_id: options[0].id })\n  } else throw e\n}","preventionTips":["Always resolve prompt ids from the live options endpoint, never hardcode them","Remap stored ids when upgrading versions with renamed prompts","Verify plugins providing custom prompts are loaded","Fall back to the default option id when a stored id is rejected"],"tags":["validation","http-400","prompt","config"],"backgroundTag":"invalid-option-id","analyzedSha":"116f9cc3b00e1ac91734a6c2679bf41ea64a0edc","analyzedAt":"2026-08-28T22:51:40.999Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}