Niveau supérieur : mémoire compressée, outils chirurgicaux, modèle code auto

Faire d'un petit modèle un bon agent :
- memory.py : contexte = invite + résumé des anciens tours + 10 derniers
  messages ; résumé régénéré en arrière-plan après chaque réponse (colonne
  summary sur sessions, migration douce). Contexte court = modèle concentré
  et qui tient sur le GPU.
- tools.py : edit_file (recherche/remplacement exact, erreurs pédagogiques,
  unicité exigée), grep_search (regex bornée, dossiers ignorés), et
  vérification syntaxique auto (.py/.json) après chaque écriture — l'erreur
  revient au modèle qui se corrige dans le même tour.
- coder.pick_code_model : les tâches de code vont au meilleur modèle code
  installé (qwen-coder, deepseek-coder…) via config code_model=auto.
- Branché dans la route chat (mémoire + résolution du modèle code) et la
  boucle agent (code_task) ; UI : descriptions et glyphes des nouveaux outils.

Tests : edit/grep/vérification, compression mémoire (19 msgs -> 12 dont
résumé), pick auto/explicite, chat HTTP de bout en bout, build front.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SVay7z3y7q2gEe54ByAE6N
This commit is contained in:
Claude committed 2026-07-07 09:17:46 +00:00
1 parent 6d13dbf442
commit cf1444f7c0
11 files changed
+356 -11

No files matched your search

+4 -3
View File
@@ -10,6 +10,7 @@ export function ToolCard({ call }: { call: ToolCall }) {
const mainArg =
(call.args?.path as string) ??
(call.args?.query as string) ??
(call.args?.pattern as string) ??
(call.args?.command as string) ??
(call.args?.instruction as string);
const argPreview =
@@ -19,7 +20,7 @@ export function ToolCard({ call }: { call: ToolCall }) {
? "(…)"
: "()";
const write = call.name === "write_file";
const write = call.name === "write_file" || call.name === "edit_file";
return (
<div className="mb-[11px] overflow-hidden border-[3px] border-line bg-card shadow-hard-sm" style={{ borderRadius: 7 }}>
@@ -71,7 +72,7 @@ function ToolGlyph({ name }: { name: string }) {
strokeLinecap: "round" as const,
strokeLinejoin: "round" as const,
};
if (name === "write_file")
if (name === "write_file" || name === "edit_file")
return (
<svg {...common}>
<path d="M5 19h14M7 14l9-9 3 3-9 9-4 1z" />
@@ -89,7 +90,7 @@ function ToolGlyph({ name }: { name: string }) {
<path d="m8 6-5 6 5 6M16 6l5 6-5 6" />
</svg>
);
if (name === "web_search")
if (name === "web_search" || name === "grep_search")
return (
<svg {...common}>
<circle cx="11" cy="11" r="7" />
+2
View File
@@ -7,7 +7,9 @@ import { DownloadIcon, RefreshIcon } from "../components/Icon";
const TOOL_DESC: Record<string, string> = {
read_file: "Lire un fichier du projet",
write_file: "Créer / modifier un fichier",
edit_file: "Modification chirurgicale (recherche/remplacement)",
list_dir: "Lister un répertoire",
grep_search: "Chercher dans les fichiers",
code_task: "Moteur code (multi-fichiers, git)",
web_search: "Recherche web",
run_shell: "Exécuter une commande",