apexive / apexive/odoo-llm

llm_comfyui: orphan llm.prompt.template records cause KeyError on uninstall

Aberta
#238 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
219
Forks
159
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

## Bug

The model `llm.prompt.template` was removed during the consolidation into `llm.prompt` (via `llm_assistant`), but `llm_comfyui/data/llm_prompt_data.xml` still contains two `` blocks referencing it:

- `llm_prompt_template_comfyui_workflow` (line 29)
- `llm_prompt_template_comfyui_character_gen_v1` (line 205)

## Impact

Attempting to uninstall the `llm` module (or any llm_* module) via the Odoo Apps UI fails with:

```
KeyError: 'llm.prompt.template'
```

Traceback path: `ir_module.py > button_immediate_uninstall > registry.new > load_modules > module_uninstall > _module_data_uninstall > env[model_name] > KeyError`

## Root cause

The two orphan records contain ComfyUI workflow JSON templates (~3280 lines of JSON node definitions). These records used fields (`prompt_id`, `role`, `sequence`, `content`) that belonged to the now-removed `llm.prompt.template` model.

## Discussion: workflow template data migration

The removed records contained valuable ComfyUI workflow definitions. If this data should be preserved, a migration path is needed. However, `llm.prompt` does not have the equivalent fields that `llm.prompt.template` had.

Options:
1. Accept the removal (data was already non-functional)
2. Recreate a compatible model or add fields to `llm.prompt`
3. Store the workflow JSON in an existing text field on `llm.prompt`

We would appreciate guidance from maintainers on the preferred approach.

## Environment

- Odoo 16.0 CE
- odoo-llm branch 16.0 (latest)
- Tested on Windows 10 Pro, PostgreSQL 12.4

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.