From 34218fae52972c11705e351307e32c5f4b2fa58a Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Tue, 18 Aug 2026 22:53:23 +0200 Subject: [PATCH] =?UTF-8?q?Mode=20code=20:=20le=20builder=20ne=20re-planif?= =?UTF-8?q?ie=20plus=20=C3=A0=20chaque=20tour,=20=C3=A9tiquettes=20d'outil?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le raisonnement n'étant pas conservé entre les tours (coût de contexte), un modèle à reasoning fort re-déduisait TOUT son plan avant chaque appel d'outil — des minutes de pour écrire un fichier de 200 octets. Le prompt du builder impose maintenant : plan écrit UNE fois dans PLAN.md, une à deux phrases de réflexion entre les appels, chaque fichier complet en un seul write. UI : les outils du mode code (criteria, read, grep, glob, git_*, ask, bash_bg/bash_tail) ont leurs étiquettes — ils retombaient tous sur « mémoire ». Co-Authored-By: Claude Opus 5 --- internal/loki/agents/builder.md | 2 ++ internal/loki/ui/index.html | 11 +++++++++++ internal/loki/ui/src/js/08-chat-render.js | 11 +++++++++++ 3 files changed, 24 insertions(+) diff --git a/internal/loki/agents/builder.md b/internal/loki/agents/builder.md index 60a47e0..caea3e7 100644 --- a/internal/loki/agents/builder.md +++ b/internal/loki/agents/builder.md @@ -8,6 +8,8 @@ Method — in this order: 5. Report briefly what changed and how you verified it. Rules: +- PLAN ONCE. If the task needs a plan, write it to PLAN.md in ONE short write, then follow it. Between tool calls, think one or two sentences at most — NEVER restate or re-derive the plan: it is in PLAN.md and in your criteria, read them instead. +- Write each file COMPLETE in a single write call. Many small writes waste turns. - You may NOT mark a criterion passed — the verification pass does that. - If a command fails, read the error and fix the cause; do not retry the same command unchanged. - Ask the user (ask tool) only for decisions that are genuinely theirs; decide the rest yourself. diff --git a/internal/loki/ui/index.html b/internal/loki/ui/index.html index addb86d..e5925a0 100644 --- a/internal/loki/ui/index.html +++ b/internal/loki/ui/index.html @@ -5377,6 +5377,17 @@ function renderToolMsg(el, tu){ web_open: {lbl:'page web', head:'ouverture'}, web_read: {lbl:'page web', head:'lecture'}, web_grep: {lbl:'page web', head:'recherche'}, + // Outils du mode code : chacun son étiquette, pas le fallback mémoire. + read: {lbl:'lecture', head:'lecture'}, + grep: {lbl:'recherche', head:'grep'}, + glob: {lbl:'fichiers', head:'glob'}, + criteria: {lbl:'critères', head:'critères'}, + ask: {lbl:'question', head:'question'}, + bash_bg: {lbl:'terminal', head:'commande (fond)'}, + bash_tail: {lbl:'terminal', head:'suivi de job'}, + git_status: {lbl:'git', head:'git status'}, + git_diff: {lbl:'git', head:'git diff'}, + git_clone: {lbl:'git', head:'git clone'}, }; // Outils MCP (nom mcp____) : en-tête = nom du serveur, libellé lisible, // pas le fallback mémoire. On extrait serveur et outil du nom namespacé. diff --git a/internal/loki/ui/src/js/08-chat-render.js b/internal/loki/ui/src/js/08-chat-render.js index 3dbc57a..82f5a50 100644 --- a/internal/loki/ui/src/js/08-chat-render.js +++ b/internal/loki/ui/src/js/08-chat-render.js @@ -258,6 +258,17 @@ function renderToolMsg(el, tu){ web_open: {lbl:'page web', head:'ouverture'}, web_read: {lbl:'page web', head:'lecture'}, web_grep: {lbl:'page web', head:'recherche'}, + // Outils du mode code : chacun son étiquette, pas le fallback mémoire. + read: {lbl:'lecture', head:'lecture'}, + grep: {lbl:'recherche', head:'grep'}, + glob: {lbl:'fichiers', head:'glob'}, + criteria: {lbl:'critères', head:'critères'}, + ask: {lbl:'question', head:'question'}, + bash_bg: {lbl:'terminal', head:'commande (fond)'}, + bash_tail: {lbl:'terminal', head:'suivi de job'}, + git_status: {lbl:'git', head:'git status'}, + git_diff: {lbl:'git', head:'git diff'}, + git_clone: {lbl:'git', head:'git clone'}, }; // Outils MCP (nom mcp____) : en-tête = nom du serveur, libellé lisible, // pas le fallback mémoire. On extrait serveur et outil du nom namespacé.