Ich habe Szenen mit der Aktion „IA fragen“ verwendet und später festgestellt, dass einige davon zur Erstellung einer Szene geführt haben. Da ich aber nicht weiß, wie sie benannt wurden und ich mehrere hundert Szenen habe, ist es schwierig, sie zu finden, um „aufzuräumen“.
Es sollte möglich sein, die von der KI erstellten Szenen zu filtern. Entweder mit einer dedizierten Schaltfläche oder indem ein Label „von KI erstellt“ automatisch an dieser Art von Szene angehängt wird.
Idealerweise sollte dieses Filtern auch bei Szenen funktionieren, die in letzter Zeit erstellt wurden, und nicht nur bei zukünftigen…
Für neue Nachrichten ist es einfach. Für alte denke ich, dass es technisch keine Möglichkeit gibt.
Hallo zusammen!
Dieses Thema ist nun in Entwicklung .
Ein Pull Request wurde eröffnet, um automatisch Szenen zu taggen, die von KI erstellt wurden, und den Tag-Filter zu korrigieren:
master ← cicoub13:claude/filter-ai-generated-scenes-pcgaoc
ouvert 12:56PM - 07 Sep 26 UTC
### Description
Scenes created by the AI through the `scene.create` tool — re… achable from the "Ask AI" scene action, the AI chat and external MCP clients — were indistinguishable from hand-made ones. With hundreds of scenes there is no way to find them back to clean them up, since you don't know how the AI named them.
Every scene created that way now automatically carries the `AI` tag. The existing scene card badge and the "Filter by tags" dropdown already handle tags, so **no front-end change is needed**: the `AI` entry shows up in the filter as soon as the first AI-created scene exists.
Tags supplied by the model are kept, deduplicated case-insensitively (`t_tag_scene` has a composite primary key `(scene_id, name)`, so a duplicate name would fail the insert), and the AI tag is always stored with its canonical casing since the filter matches on an exact name.
**The tag filter had to be fixed first.** `scene.get` matched tag names with a substring `LIKE '%tag%'`, then grouped the matched rows by the tag name actually found and intersected the groups. With a short tag like `AI`, `%AI%` also matches `Maison`, `Salaire`, … and those unrelated groups were then intersected together, so the filter returned nothing. The front only ever sends exact tag names picked from the dropdown (`SceneTagFilter.jsx`), so the lookup now matches on the exact name. Requested tags that no scene carries also get their own empty group, which keeps the AND semantics when several tags are selected — previously such a tag was silently ignored and widened the result set.
Known limitation: scenes created by the AI *before* this change are not tagged retroactively.
## Forum
Forum: https://community.gladysassistant.com/t/pouvoir-filtrer-les-scenes-qui-ont-ete-generees-par-lia/10817
### Checklist
- [x] Tests pass: `cd server && npm run coverage` (Codecov requires 100% coverage on changed lines) and Cypress (`npm run cypress:run`) if the UI changed
- [x] Linter and prettier pass on both front and server (`npm run eslint`, `npm run prettier`)
- [x] No undocumented breaking change
Coverage on the changed files is 100% statements/branches/functions/lines for `lib/scene/scene.get.js` and `utils/constants.js`; the only uncovered lines reported in `services/mcp/lib/buildSchemas.js` are pre-existing ones in the `device.turn-on-off` tool, outside this diff. Cypress was not re-run because no front-end file changed.
7 tests were added: the AI tag being applied with and without model-supplied tags, deduplication and canonical casing, exact-vs-substring tag matching, and filtering on a tag no scene carries.
## Summary by CodeRabbit
* **New Features**
* Scenes created through the AI scene creation tool are automatically tagged “AI.”
* Existing tags are preserved, while duplicate AI tags are avoided.
* **Bug Fixes**
* Scene searches now match complete tag names rather than partial matches.
* Searches requiring multiple tags correctly return no results when any requested tag is missing.
* Tag searches now work safely for names that resemble built-in object properties.
Zögert nicht, dem Pull Request zu folgen, zu testen (optional, vor allem bei kleinen Anfragen) und euer Feedback hier zu hinterlassen, falls nötig.