srbhr/Resume-Matcher · warning · HTTPException
Unsupported prompt id: {request.default_prompt_id}. Supporte
Error message
Unsupported prompt id: {request.default_prompt_id}. Supported: {sorted(option_ids)} What it means
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().
Source
Thrown at apps/backend/app/routers/config.py:376
return PromptConfigResponse(
default_prompt_id=default_prompt_id,
prompt_options=options,
)
@router.put("/prompts", response_model=PromptConfigResponse)
async def update_prompt_config(
request: PromptConfigRequest,
) -> PromptConfigResponse:
"""Update prompt configuration for resume tailoring."""
stored = _load_config()
options = _get_prompt_options()
option_ids = {option.id for option in options}
if request.default_prompt_id is not None:
if request.default_prompt_id not in option_ids:
raise HTTPException(
status_code=400,
detail=(
"Unsupported prompt id: "
f"{request.default_prompt_id}. Supported: {sorted(option_ids)}"
),
)
stored["default_prompt_id"] = request.default_prompt_id
_save_config(stored)
default_prompt_id = stored.get("default_prompt_id", DEFAULT_IMPROVE_PROMPT_ID)
if default_prompt_id not in option_ids:
default_prompt_id = DEFAULT_IMPROVE_PROMPT_ID
return PromptConfigResponse(
default_prompt_id=default_prompt_id,
prompt_options=options,
)View on GitHub (pinned to 116f9cc3b0)
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
Example fix
// before
await api.updatePromptConfig({ default_prompt_id: 'legacy_professional_v1' })
// after
const { options } = await api.getPromptOptions()
await api.updatePromptConfig({ default_prompt_id: options[0].id }) Defensive patterns
Strategy: validation
Validate before calling
const { options } = await api.getPromptOptions()
const validIds = new Set(options.map(o => o.id))
if (promptId && !validIds.has(promptId)) {
promptId = options[0].id
} Try / catch
try {
await api.updatePromptConfig({ default_prompt_id: id })
} catch (e) {
if (e.response?.status === 400 && String(e.response.data.detail).startsWith('Unsupported prompt id')) {
const { options } = await api.getPromptOptions()
await api.updatePromptConfig({ default_prompt_id: options[0].id })
} else throw e
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- ${message = data.detail or Failed to update LLM config (stat
- ${data.detail || Failed to update feature config (status ${r
- ${data.detail || Failed to update language config (status ${
- Unsupported UI language: {request.ui_language}. Supported: {
- Unsupported content language: {request.content_language}. Su
AI-assisted analysis of srbhr/Resume-Matcher@116f9cc3b0 (2026-08-28).
Data as JSON: /api/errors/5ba8036584aa2842.
Report an issue: GitHub.