mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-21 22:18:13 +02:00
refactor(agent): vérification JS via _verify_written (déjà auto après écriture)
L'auto-check séparé dans la boucle agent doublonnait _verify_written et signalait à tort les fichiers écrits par morceaux (mode append). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c92e4d4a13
commit
d19624b46b
2 files changed
+9
-30
No files matched your search
@@ -334,36 +334,6 @@ async def run_agent(
|
||||
}
|
||||
)
|
||||
|
||||
# Vérification statique automatique après toute écriture de
|
||||
# code : l'erreur revient au modèle dans le même tour
|
||||
# (1 passe de correction max, bornée par MAX_ITERATIONS).
|
||||
if (
|
||||
name in ("write_file", "edit_file")
|
||||
and status == "ok"
|
||||
and str(args.get("path", "")).lower().endswith(
|
||||
(".py", ".js", ".mjs", ".html", ".htm", ".json")
|
||||
)
|
||||
):
|
||||
try:
|
||||
from .tools import run_check
|
||||
check = run_check(args["path"])
|
||||
except ToolError:
|
||||
check = None
|
||||
if check and not check["ok"]:
|
||||
record = {
|
||||
"name": "run_check",
|
||||
"args": {"path": args["path"]},
|
||||
"summary": check["summary"],
|
||||
"status": "error",
|
||||
}
|
||||
collected.append(record)
|
||||
yield {"type": "tool_result", **record}
|
||||
convo.append({
|
||||
"role": "tool",
|
||||
"tool_name": "run_check",
|
||||
"content": json.dumps(check, ensure_ascii=False),
|
||||
})
|
||||
|
||||
# Une commande shell attend une validation : on interrompt la boucle.
|
||||
if awaiting_confirmation:
|
||||
# Laisse le modèle conclure son tour (message d'attente).
|
||||
|
||||
Reference in new issue
Block a user