Admin AI settings silently reset the assistant prompt, which cannot be edited in the UI
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
Comienza en ui/src/pages/Admin/AiSettings/index.tsx e inspecciona el payload creado para guardar la configuración de AI; después, compáralo con el campo prompt_config aceptado por el backend. Añade campos de prompt editables y asegúrate de que el prompt existente se incluya al guardar otras configuraciones. Verifica que un prompt personalizado permanezca sin cambios después de guardar el formulario Admin → AI Settings.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The AI assistant's prompt (prompt_config) can be stored and returned by the API, but there is no way to edit it, and saving AI settings silently overwrites whatever is stored with the built-in default.
SaveSiteAI substitutes the defaults whenever a request omits prompt_config:
https://github.com/apache/answer/blob/main/internal/service/siteinfo/siteinfo_service.go#L384-L389
if req.PromptConfig == nil {
req.PromptConfig = &schema.AIPromptConfig{
ZhCN: constant.DefaultAIPromptConfigZhCN,
EnUS: constant.DefaultAIPromptConfigEnUS,
}
}
The admin form in ui/src/pages/Admin/AiSettings/index.tsx builds its payload from enabled, chosen_provider and ai_providers only, so it never sends prompt_config. Every save from that page therefore resets the prompt.
Combined, this means:
- The prompt cannot be customised through the UI at all — there is no field for it.
- A prompt set directly through the API survives only until somebody saves the AI settings page, then reverts silently with no warning and no indication in the UI that anything changed.
The backend side is fully implemented: SiteAIReq accepts prompt_config, SaveSiteAI persists it, GetSiteAI returns it, and getPromptByLanguage reads it and falls back to the constant when empty. Only the form is missing.
Expected behavior
The prompt is editable in Admin → AI Settings, and saving other AI settings does not discard it.
Steps to reproduce
- Set a custom
en_usprompt viaPUT /answer/admin/api/ai-configwith aprompt_configobject. - Confirm it is stored (
GET /answer/admin/api/ai-config). - In Admin → AI Settings, change nothing of substance and press Save.
- Read the config again — the prompt is back to
DefaultAIPromptConfigEnUS.
Version
Reproduced on main (3b9f137) and on 2.0.2.
Additional context
This surfaced while running the assistant against a vector-search plugin. semantic_search returns a link for every result, but the default prompt never asks the model to cite sources, so whether an answer links the thread it came from is left to the model. Being able to ask for citations in the prompt is the natural fix — which needs the prompt to be editable and to stay edited.
Happy to send a PR: the change is frontend-only, since the backend already supports the field.
- Lenguaje dominante
- Go
- Estrellas
- 15.7k
- Forks
- 1.4k
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 6
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/answer
-
List button click not working Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
The Gin engine is initialized without a recovery middleware, causing connection drops on panic Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Todos los issues de apache/answer
Issues similares
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
kind/bug status/0-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
🤔 refinement needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
equinor/radix-operator#1979 ·