From a7d4b31a0d7a0f9f9b4764800310f30081291cc9 Mon Sep 17 00:00:00 2001 From: Muyue Date: Mon, 27 Apr 2026 12:02:04 +0200 Subject: [PATCH] feat(studio): force advanced reflection during browser-test sessions (v0.7.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When at least one browser_test session is connected, every chat message in Studio now auto-enables advanced reflection regardless of the user toggle. The intent: during AI-driven UI testing, having a second model produce a preliminary [RAPPORT PRÉALABLE] materially improves which clicks the active model decides to perform and the quality of the final ✓/✗ report. - handlers_chat: derive wantReflection from body.AdvancedReflection OR (browserTestStore has any active session). The user toggle still works for normal conversations; tests just override it. - Silent fallback when no inactive provider is configured (no error, no behaviour change for single-provider setups). - Tests.jsx: add a hint explaining the auto-on behaviour so the user understands why the Studio toggle appears bypassed. - Version 0.7.1 → 0.7.2 + CHANGELOG entry. --- CHANGELOG.md | 8 ++++++++ internal/api/handlers_chat.go | 12 +++++++++++- internal/version/version.go | 2 +- web/src/components/Tests.jsx | 3 +++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d92c906..8bf28d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## v0.7.2 + +### Amélioration + +- **feat(studio): réflexion avancée forcée automatiquement pendant les tests** — quand au moins une session `browser_test` est connectée, chaque message à Studio active automatiquement la réflexion avancée (un second modèle, si configuré, produit un rapport préalable injecté dans le prompt actif). Le toggle UI est ignoré tant qu'une session de test est active. Justification : pendant un test piloté par l'IA, avoir une analyse complémentaire d'un autre modèle améliore matériellement la qualité des décisions de clic et la couverture du rapport final. +- Si aucun second provider n'est configuré, le comportement reste silencieux (fallback chat normal — pas d'erreur visible côté utilisateur). +- Hint UI ajouté dans l'onglet Tests pour expliquer le comportement. + ## v0.7.1 ### Fix diff --git a/internal/api/handlers_chat.go b/internal/api/handlers_chat.go index 641263c..e16011b 100644 --- a/internal/api/handlers_chat.go +++ b/internal/api/handlers_chat.go @@ -213,7 +213,17 @@ func (s *Server) handleChat(w http.ResponseWriter, r *http.Request) { orb.SetSystemPrompt(studioPrompt.String()) orb.SetTools(s.agentToolsJSON) - if body.AdvancedReflection { + // Auto-force advanced reflection while a browser-test session is active: + // the user is doing AI-driven UI testing, where having a second model + // produce a preliminary report (when one is configured) materially + // improves which clicks the active model decides to perform. The toggle + // remains user-controllable for non-test conversations. + wantReflection := body.AdvancedReflection + if !wantReflection && s.browserTestStore != nil && len(s.browserTestStore.List()) > 0 { + wantReflection = true + } + + if wantReflection { if report, ok := s.runReflectionReport(enrichedMessage); ok { enrichedMessage = enrichedMessage + "\n\n[RAPPORT PRÉALABLE — produit par un autre modèle, à valider]\n" + report + "\n[/RAPPORT PRÉALABLE]" } diff --git a/internal/version/version.go b/internal/version/version.go index e79fe01..600f85d 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -7,7 +7,7 @@ import ( const ( Name = "muyue" - Version = "0.7.1" + Version = "0.7.2" Author = "La Légion de Muyue" ) diff --git a/web/src/components/Tests.jsx b/web/src/components/Tests.jsx index d7a0927..c8881a2 100644 --- a/web/src/components/Tests.jsx +++ b/web/src/components/Tests.jsx @@ -148,6 +148,9 @@ lesquels déclenchent une erreur console.`}

L'IA dispose de l'outil browser_test avec les actions list_clickables, click, console, eval, type, current_url, wait, summary.

+

+ Réflexion avancée auto : tant qu'au moins une session de test est connectée, chaque message dans Studio utilise automatiquement la réflexion avancée — un second modèle (s'il est configuré) produit un rapport d'analyse préalable injecté dans le prompt actif. Le toggle Studio est ignoré pendant la session. +