FIX CRITIQUE WEVIA MASTER API 500→200 - double déclaration _oaa_sse() — Yacine signale WEVIA Master ne répond pas. Cause racine: Fatal error Cannot redeclare function _oaa_sse() car 2 fichiers déclarent la même fonction (wevia-opus-arch-early.php:6 V41 + wevia-opus-arch-actions-intents.php:4 V40). Le @include masque le warning mais PHP crash sur fatal redeclare → HTTP 500 silencieux visible seulement avec display_errors=1. Fix: wrap chaque function _oaa_sse déclaration dans if (!function_exists) {} guard sur les 2 fichiers + PHP lint check avant cp sudo + GOLD backups pre-oaa-guard. Résultat: HTTP 200 sur POST wevia-master-api.php - test hello répond bonjour-llm llama3.1-8b - test coverage global répond via dynamic-resolver - WEVIA Master chat fonctionnel bout en bout. Note: chat passe par wevia-master-router.php pas wevia-sse-orchestrator donc intents V74/V75 wirés SSE répondent via chemin SSE distinct (considérer pour futures intégrations).
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled

This commit is contained in:
Opus-Yacine
2026-04-19 15:46:25 +02:00
parent 912cb3f8c7
commit eb65f6ddd7
7 changed files with 9679 additions and 5 deletions

View File

@@ -1,15 +1,15 @@
{
"generated_at": "2026-04-19T15:40:01.380067",
"generated_at": "2026-04-19T15:45:01.786996",
"stats": {
"total": 435,
"pending": 831,
"total": 436,
"pending": 833,
"kaouther_surfaced": 29,
"chrome_surfaced": 10,
"notif_only_done": 0,
"autofix_archived": 0,
"cerebras_archived": 0,
"older_3d_archived": 0,
"unknown": 396,
"unknown": 397,
"errors": 0
},
"actions": [

View File

@@ -0,0 +1,11 @@
{
"id": "task_20260419134502_395de4",
"name": "Blade self-heal 15:45",
"type": "powershell",
"command": "\n# Blade self-heal\nWrite-Host \"Self-heal triggered $(Get-Date)\"\n$agentProc = Get-Process powershell | Where-Object { $_.CommandLine -match 'sentinel-agent' }\nif (!$agentProc) {\n Write-Host \"Agent not running, starting...\"\n Start-Process powershell -ArgumentList \"-ExecutionPolicy\",\"Bypass\",\"-File\",\"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1\" -WindowStyle Hidden\n}\n# Clear stale tasks > 3 days locally\n$cutoff = (Get-Date).AddDays(-3)\nGet-ChildItem \"C:\\ProgramData\\WEVAL\\tasks\\*.json\" -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -lt $cutoff } | Move-Item -Destination \"C:\\ProgramData\\WEVAL\\tasks\\archived\\\" -Force -ErrorAction SilentlyContinue\nWrite-Host \"Self-heal complete\"\n",
"cmd": "\n# Blade self-heal\nWrite-Host \"Self-heal triggered $(Get-Date)\"\n$agentProc = Get-Process powershell | Where-Object { $_.CommandLine -match 'sentinel-agent' }\nif (!$agentProc) {\n Write-Host \"Agent not running, starting...\"\n Start-Process powershell -ArgumentList \"-ExecutionPolicy\",\"Bypass\",\"-File\",\"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1\" -WindowStyle Hidden\n}\n# Clear stale tasks > 3 days locally\n$cutoff = (Get-Date).AddDays(-3)\nGet-ChildItem \"C:\\ProgramData\\WEVAL\\tasks\\*.json\" -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -lt $cutoff } | Move-Item -Destination \"C:\\ProgramData\\WEVAL\\tasks\\archived\\\" -Force -ErrorAction SilentlyContinue\nWrite-Host \"Self-heal complete\"\n",
"priority": "high",
"status": "pending",
"created": "2026-04-19T13:45:02+00:00",
"created_by": "blade-control-ui"
}

View File

@@ -1,7 +1,7 @@
{
"ok": true,
"version": "V83-business-kpi",
"ts": "2026-04-19T13:40:33+00:00",
"ts": "2026-04-19T13:45:14+00:00",
"summary": {
"total_categories": 7,
"total_kpis": 56,

View File

@@ -1,12 +1,14 @@
<?php
// wevia-opus-arch-actions-intents.php - V40 FIXED
if (!isset($__bm) || !isset($_mam)) return;
if (!function_exists('_oaa_sse')) {
function _oaa_sse($type, $text, $engine='Resolver/opus-arch-actions') {
header('Content-Type: text/event-stream');
echo 'data: ' . json_encode(['type'=>$type, 'text'=>$text, 'engine'=>$engine]) . "\n\n";
@ob_flush(); @flush();
exit;
}
}
// 1 Registry unlock + add tools
if (preg_match('/(unlock|register|add.*tools?).*registry|registry.*(unlock|update|add.*tools?|opus.arch)/i', $__bm)) {

View File

@@ -3,12 +3,14 @@
if (!isset($_mam) || empty($_mam)) return;
$_oaa_m = mb_strtolower(trim($_mam));
if (!function_exists('_oaa_sse')) {
function _oaa_sse($type, $text, $engine='Resolver/opus-arch-actions-v41') {
header('Content-Type: text/event-stream');
echo 'data: ' . json_encode(['type'=>$type, 'text'=>$text, 'engine'=>$engine]) . "\n\n";
@ob_flush(); @flush();
exit;
}
}
if (preg_match('/unlock\s+registry\s+opus.?arch|register.*opus.?arch.*tools?/i', $_oaa_m)) {
$r = '/opt/wevia-brain/tool-registry-v2.json';

File diff suppressed because it is too large Load Diff

View File

@@ -1223,3 +1223,32 @@ Sépare les 2 consommateurs:
### Lesson racine
V75 n'aurait jamais dû ÉCRASER le format de agent-avatars.json. La migration aurait dû créer un fichier SÉPARÉ dès le départ (doctrine SoC). Toujours vérifier quels consommateurs existent avant de changer un format partagé.
## 19avr 15h50 — FIX CRITIQUE WEVIA MASTER API 500 → 200
### Symptôme Yacine
"non tst vcwbiapmaster paaygjreted" = WEVIA Master ne répondait pas (HTTP 500 depuis /api/wevia-master-api.php)
### Cause racine identifiée
Double déclaration de la fonction `_oaa_sse()`:
- /var/www/html/api/wevia-opus-arch-early.php:6 (V41)
- /var/www/html/api/wevia-opus-arch-actions-intents.php:4 (V40)
`@include` masque le warning mais PHP émet quand même Fatal "Cannot redeclare function _oaa_sse()" qui crash le response → HTTP 500 silencieux.
### Fix
Wrap chaque déclaration dans `if (!function_exists('_oaa_sse')) { ... }` sur les 2 fichiers.
Lint PHP check avant cp sudo.
GOLD backups pre-oaa-guard.
### Résultat
- HTTP 200 sur POST /api/wevia-master-api.php ✅
- Test "hello" → répond bonjour-llm (llama3.1-8b)
- Test "coverage global" → répond avec résolution Qdrant + Groq
- WEVIA Master chat fonctionnel de bout en bout
### Note routing
Le chat WEVIA Master passe par wevia-master-router.php (pas wevia-sse-orchestrator.php).
Les intents V74/V75 wirés dans SSE orchestrator répondent via le chemin SSE (pas le chat direct).
C'est un chemin de routing différent à considérer pour futures intégrations.