Wiki source code of Hotfix LLMAI-122: KI-Button im Editor (LLM App 0.8)
Last modified by Claude Code on 2026/07/03 21:06
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{info}} | ||
| 2 | Lokal eingespielter Hotfix für die LLM Application **0.8**. Wird durch das Upgrade auf Version ≥ 0.8.1 abgelöst. Teil der [[AI/LLM-Betriebsdoku>>Documentation.AI-LLM-Setup]]. | ||
| 3 | {{/info}} | ||
| 4 | |||
| 5 | {{toc/}} | ||
| 6 | |||
| 7 | = Problem = | ||
| 8 | |||
| 9 | Im WYSIWYG-Editor ist das ✨-Icon dauerhaft ausgegraut und die {{code}}/{{/code}}-Quick-Action "Generative AI" fehlt — ohne Fehlermeldung in der Konsole. | ||
| 10 | |||
| 11 | * **Upstream-Ticket:** [[LLMAI-122>>https://jira.xwiki.org/browse/LLMAI-122]] (Fix Version 0.8.1, Stand 2026-07-03 noch nicht released) | ||
| 12 | * **Betroffene Version:** 0.8 | ||
| 13 | |||
| 14 | = Ursache = | ||
| 15 | |||
| 16 | Race Condition: {{code}}init(){{/code}} des CKEditor-Plugins ruft {{code}}command.enable(){{/code}} auf, sobald der Berechtigungs-Check zurückkommt — potenziell bevor der Editor {{code}}instanceReady{{/code}} feuert. XWikis WYSIWYG-Editor setzt während {{code}}instanceReady{{/code}} alle Command-States zurück. Der Button bleibt deaktiviert, die Quick-Action-Registrierung hängt an derselben Stelle. Zusätzlich wurde das Modal-Modul in XWiki 18.3.0 von {{code}}modal{{/code}} in {{code}}xwiki-wysiwyg-modal{{/code}} umbenannt. | ||
| 17 | |||
| 18 | Diagnose-Befunde: {{code}}POST /rest/v1/check-access{{/code}} lieferte korrekt {{code}}{"check":true}{{/code}}; das Plugin war geladen, der Command {{code}}llmaction{{/code}} existierte, blieb aber in {{code}}TRISTATE_DISABLED{{/code}}; manuell ausgeführt funktionierte die Aktivierungskette. | ||
| 19 | |||
| 20 | = Angewendeter Fix (2026-07-03) = | ||
| 21 | |||
| 22 | Der Code des {{code}}XWiki.JavaScriptExtension{{/code}}-Objekts (Nr. 0, Property {{code}}code{{/code}}) auf der Seite [[AI.Code.CKEditorPlugin>>AI.Code.CKEditorPlugin]] wurde durch den Stand des Upstream-Fixes ersetzt. | ||
| 23 | |||
| 24 | **Quelle des eingespielten Codes:** | ||
| 25 | |||
| 26 | * Commit [[93cc4a0>>https://github.com/xwiki-contrib/ai-llm/commit/93cc4a06a539bbda86a5f1e67552aa8b13a6f872]] ("LLMAI-122: LLM Button in editor not working", 2026-06-11, Branch main) | ||
| 27 | * Datei: {{code}}application-ai-llm-models/application-ai-llm-models-ui/src/main/resources/AI/Code/CKEditorPlugin.xml{{/code}} | ||
| 28 | * Eingespielt: Inhalt des {{code}}<code>{{/code}}-Propertys (HTML-Entities dekodiert), per REST-PUT auf {{code}}.../objects/XWiki.JavaScriptExtension/0/properties/code{{/code}} aus einer Admin-Session. Kein Neustart nötig, Editor-Seite neu laden genügt. | ||
| 29 | |||
| 30 | = Verifikation = | ||
| 31 | |||
| 32 | * {{code}}editor.getCommand('llmaction').state{{/code}} = aktiv statt {{code}}TRISTATE_DISABLED{{/code}} | ||
| 33 | * Quick-Action registriert: id {{code}}llm-ai{{/code}}, Name "Generative AI" | ||
| 34 | * ✨-Icon in der Toolbar klickbar | ||
| 35 | |||
| 36 | = Rollback = | ||
| 37 | |||
| 38 | Seiten-Historie von [[AI.Code.CKEditorPlugin>>AI.Code.CKEditorPlugin]] → Version vor dem 2026-07-03 wiederherstellen. | ||
| 39 | |||
| 40 | = Beim Upgrade = | ||
| 41 | |||
| 42 | Die Seite gilt für den Extension Manager als lokal modifiziert. Beim Upgrade auf **≥ 0.8.1** den gemeldeten Merge-Konflikt **zugunsten der Extension-Version** auflösen — der Fix ist dort enthalten, danach ist dieser Hotfix obsolet. |