From 911501ac0b4d34d8b557ad78ca9726ca3344ec85 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 15 Oct 2026 12:34:59 +0000 Subject: [PATCH] =?UTF-8?q?Parit=C3=A9=20d'un=20tour=20complet=20:=20journ?= =?UTF-8?q?al=20ind=C3=A9pendant=20de=20Playwright?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit En mode Code, le Go n'annonce web_screenshot que si Playwright est installé : présent dans le conteneur qui avait tiré les journaux, absent des machines de la CI, d'où deux tours de référence qui ne s'y retrouvaient plus. Le test retire Playwright du PATH : le journal ne dépend plus de la machine qui le tire (Linux et macOS vérifiés sur la sortie de la CI). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016tcGfJWefW5kUGoC2wL8cv --- internal/loki/parity_turn_test.go | 17 +++ .../parity_turn/code_contrat_abandonne.json | 138 ------------------ .../parity_turn/code_contrat_deja_tenu.json | 46 ------ 3 files changed, 17 insertions(+), 184 deletions(-) diff --git a/internal/loki/parity_turn_test.go b/internal/loki/parity_turn_test.go index 1312487..9a83a36 100644 --- a/internal/loki/parity_turn_test.go +++ b/internal/loki/parity_turn_test.go @@ -9,6 +9,7 @@ import ( "net/http/httptest" "net/url" "os" + "os/exec" "path/filepath" "regexp" "strings" @@ -126,6 +127,22 @@ func runParityTurn(t *testing.T, sc parityTurnScenario) parityTurnFixture { t.Helper() testHome(t) t.Setenv(internalTokenEnv, jetonTest) + // Playwright installé ou non selon la machine : web_screenshot entrerait ou + // non dans les outils du mode Code. Hors du PATH, le journal ne dépend plus + // de la machine qui le tire. + for { + p, err := exec.LookPath("playwright") + if err != nil { + break + } + var keep []string + for _, d := range filepath.SplitList(os.Getenv("PATH")) { + if filepath.Clean(d) != filepath.Dir(p) { + keep = append(keep, d) + } + } + t.Setenv("PATH", strings.Join(keep, string(os.PathListSeparator))) + } var ( mu sync.Mutex requests []any diff --git a/rust/loki-rs/tests/parity_turn/code_contrat_abandonne.json b/rust/loki-rs/tests/parity_turn/code_contrat_abandonne.json index c83a08c..4bb701e 100644 --- a/rust/loki-rs/tests/parity_turn/code_contrat_abandonne.json +++ b/rust/loki-rs/tests/parity_turn/code_contrat_abandonne.json @@ -617,29 +617,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }, @@ -1362,29 +1339,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }, @@ -1920,29 +1874,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }, @@ -2486,29 +2417,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }, @@ -3261,29 +3169,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }, @@ -4044,29 +3929,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }, diff --git a/rust/loki-rs/tests/parity_turn/code_contrat_deja_tenu.json b/rust/loki-rs/tests/parity_turn/code_contrat_deja_tenu.json index 13f8087..9078d75 100644 --- a/rust/loki-rs/tests/parity_turn/code_contrat_deja_tenu.json +++ b/rust/loki-rs/tests/parity_turn/code_contrat_deja_tenu.json @@ -561,29 +561,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }, @@ -1306,29 +1283,6 @@ } }, "type": "function" - }, - { - "function": { - "description": "Photographie une page web (JS exécuté) pour la MONTRER. La réponse donne la ligne markdown à recopier. Tu ne vois pas l'image.", - "name": "web_screenshot", - "parameters": { - "properties": { - "full_page": { - "description": "Page entière (lourd). Défaut false.", - "type": "boolean" - }, - "url": { - "description": "URL complète", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "type": "function" } ] }