Files
computer-playbook/roles/web-app-mediawiki/tasks/main.yml
kevinveenbirkenbachandClaude Opus 5 caf84b4673 feat(mediawiki): bind AIEditingAssistant to the platform gateway
The extension is declared as an addon gated on services.litellm.enabled and
bridged to litellm, so it exists only where the gateway is deployed.
VisualEditorPlus is declared alongside it because AIEditingAssistant's
extension.json hard-requires it and the mediawiki image does not bundle it;
without it the AI extension fails to load, which makes the two one feature
rather than two.

02_extensions.yml previously ran only when OIDC was enabled, since OIDC was the
only extension consumer. Its gate now also fires on litellm, otherwise a
litellm-only variant installs no extensions at all and the AI surface is
silently absent from a deploy that reports success.

utils/ai_gateway.yml verifies the shared contract and then reads the running
instance back with `maintenance/run.php getConfiguration --format=json`,
asserting that the active provider is open-ai, that the connection URL is the
in-cluster gateway, and that the model is the one the gateway serves. It reads
MediaWiki's own resolved configuration rather than the template that produced
it, so a template that renders correctly but never lands still fails. The
include runs under IS_STACK_HOST because the read goes through the container.

$wgHTTPTimeout is raised to 120s. It is global to every MediaWiki outbound
request and core defaults to 25s, which is below a cold local model's time to
first token, so the first prompt after a deploy would abort. The trade-off is
deliberate and applies to all outbound calls, not only inference.

MEDIAWIKI_EXT_NAMES derives the loaded extension list from the materialised
addons mapping filtered on enabled, so LocalSettings.php.j2 loads exactly what
the variant turned on and there is no second list to keep in sync.

Not verified: none of this has completed a run. AIEditingAssistant.spec.js has
executed zero times, because the addon bridge gate resolved svc-ai-litellm
against the Playwright role list and skipped it, and no log yet shows the
getConfiguration assertion passing. Widening the 02_extensions.yml gate is a
real behaviour change for litellm-only variants, which have never installed
extensions before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 13:37:51 +02:00

49 lines
1.7 KiB
YAML

---
- name: "🧩 load docker, db and proxy for '{{ application_id }}'"
include_role:
name: sys-stk-full
vars:
compose_handlers_flush: false
- name: "📂 Load install procedures for '{{ application_id }}'"
include_tasks: 01_configuration.yml
- name: "🐳 Finalize compose deploy for '{{ application_id }}'"
include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/finalize.yml') }}"
- name: "🔍 Resolve {{ application_id }} hosting node + container id"
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
vars:
resolve_service_key: mediawiki
resolve_output_prefix: MEDIAWIKI
resolve_compose_cid: "{{ MEDIAWIKI_CONTAINER }}"
when: IS_STACK_HOST | bool
- name: "📂 Load extensions procedures for '{{ application_id }}'"
include_tasks:
file: "02_extensions.yml"
apply:
delegate_to: "{{ MEDIAWIKI_HOST_NODE }}"
when:
- (MEDIAWIKI_OIDC_ENABLED | bool) or (MEDIAWIKI_LITELLM_ENABLED | bool)
- IS_STACK_HOST | bool
- name: "📂 Load update procedures for '{{ application_id }}'"
include_tasks: 03_install.yml
when:
- IS_STACK_HOST | bool
- >-
(_role_templates_render.changed | default(false)) or
(_install_results.changed | default(false)) or
(_ext_composer.changed | default(false)) or
(_vendor.changed | default(false))
- name: "🤖 Bind the native AI surface to the platform gateway"
include_tasks: utils/ai_gateway.yml
when:
- MEDIAWIKI_LITELLM_ENABLED | bool
- IS_STACK_HOST | bool
- name: "📂 Load admin setup procedures for '{{ application_id }}'"
include_tasks: 04_admin.yml