# Manual meta-task selection overwritten when using model pack without MetaCAT models

**URL:** <https://discourse.cogstack.org/t/manual-meta-task-selection-overwritten-when-using-model-pack-without-metacat-models/403>\
**Category:** MedCAT\
**Created:** [June 21, 2026, 8:43pm UTC](https://discourse.cogstack.org/t/manual-meta-task-selection-overwritten-when-using-model-pack-without-metacat-models/403 "2026-06-21T20:43:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ollielloyd](https://avatars.discourse-cdn.com/v4/letter/o/71c47a/32.png) [@ollielloyd](https://discourse.cogstack.org/u/ollielloyd)\
**Post date:** [June 21, 2026, 8:43pm UTC](https://discourse.cogstack.org/t/manual-meta-task-selection-overwritten-when-using-model-pack-without-metacat-models/403/1 "2026-06-21T20:43:04Z")

</div>

### **Summary**

In MedCAT Trainer 3.6.1, manually selected meta-annotation tasks are automatically cleared when a project uses a model pack that does not contain MetaCAT models. This prevents users from setting up manual meta-annotation tasks for training MetaCAT models from scratch.

### **Environment**

- **\*\*MedCAT Trainer version:\*\*** 3.6.1 (broken), 3.6.0 (working)

- **\*\*Deployment:\*\*** Docker container

- **\*\*Model pack:\*\*** Base NER+L model without MetaCAT models

### **Steps to Reproduce**

1. Spin up a new instance of MedCAT Trainer 3.6.1

2. Upload a model pack that does **\*\*not\*\*** contain MetaCAT models (e.g. a base NER+L model pack)

3. Upload a dataset and import the CDB to Solr

4. Create a MetaTask (e.g. “Presence”) with MetaTaskValues (e.g. current, hypothetical, negated)

5. In Django admin, edit a `ProjectAnnotateEntities` project and select the “Presence” meta-task in the tasks field

6. Save the project

7. Check the project’s meta\_tasks via mctclient or Django admin

### **Expected Behaviour**

Manually selected meta-tasks persist on the project, allowing users to configure manual meta-annotation workflows when training MetaCAT models from scratch.

### **Actual Behaviour**

The manually selected meta-tasks are immediately cleared and replaced with an empty list.

So I pushed this through claude and it suggested the following problem:

The signal handler `project_tasks_changed` overwrites the selection with tasks derived from the model pack’s MetaCAT models — which is empty when the model pack has none.

and fix:

```python

def project\_tasks\_changed(sender, instance, action, \*\*kwargs):

if (action.startswith(‘post’) and isinstance(instance, ProjectAnnotateEntitiesFields) and

```
        instance.model_pack is not None and instance.model_pack.meta_cats.exists()):

    instance.tasks.set(\[MetaTask.objects.filter(prediction_model_id=meta_cat.id).first()

```

for meta\_cat in instance.model\_pack.meta\_cats.all()])

```

but unfortunately this doesn’t seem to actually fix the problem. I am not good enough at python to be able to solve the root cause of this problem unfortunately.

Very happy to help try to give more information to solve this problem, or be pointed in correct direction if I am doing something wrong; fix for me at present it to move back 3.6.0 which does work with meta annotation.

---

<div class="post-metadata">

**Author:** ![mart.ratas](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mart.ratas](https://discourse.cogstack.org/u/mart.ratas)\
**Post date:** [June 22, 2026, 3:59pm UTC](https://discourse.cogstack.org/t/manual-meta-task-selection-overwritten-when-using-model-pack-without-metacat-models/403/2 "2026-06-22T15:59:51Z")

</div>

Thank you for the feedback along with the suggested fix.

My initial look would suggest that claude was right and that should be the fix. But we will investigate.

When you say that didn’t work for you, do you mean that it didn’t fix it for existing projects or that it didn’t fix it for new ones either? Did you verify that you were running your patched version of the software?

---

<div class="post-metadata">

**Author:** ![mart.ratas](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mart.ratas](https://discourse.cogstack.org/u/mart.ratas)\
**Post date:** [June 23, 2026, 6:21pm UTC](https://discourse.cogstack.org/t/manual-meta-task-selection-overwritten-when-using-model-pack-without-metacat-models/403/3 "2026-06-23T18:21:25Z")

</div>

Thanks again for your query and input!

As far as we can tell this should be fixed in the next release of medcat trainer (2.6.2 or 2.7.0). We should be able to push that out in the coming days.

---

<div class="post-metadata">

**Author:** ![ollielloyd](https://avatars.discourse-cdn.com/v4/letter/o/71c47a/32.png) [@ollielloyd](https://discourse.cogstack.org/u/ollielloyd)\
**Post date:** [June 24, 2026, 6:09am UTC](https://discourse.cogstack.org/t/manual-meta-task-selection-overwritten-when-using-model-pack-without-metacat-models/403/4 "2026-06-24T06:09:29Z")

</div>

Thanks for such a prompt reply & great project. I’ll give it a spin once it’s available.

---

<div class="post-metadata">

**Author:** ![ollielloyd](https://avatars.discourse-cdn.com/v4/letter/o/71c47a/32.png) [@ollielloyd](https://discourse.cogstack.org/u/ollielloyd)\
**Post date:** [June 27, 2026, 2:53pm UTC](https://discourse.cogstack.org/t/manual-meta-task-selection-overwritten-when-using-model-pack-without-metacat-models/403/5 "2026-06-27T14:53:51Z")

</div>

Can confirm that 3.7.0 seems to be working correctly. Thanks for fixing.
