mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-16 03:39:29 +02:00
Parité d'un tour complet : journal indépendant de Playwright
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016tcGfJWefW5kUGoC2wL8cv
This commit is contained in:
3 files changed
+17
-184
No files matched your search
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user