fix(agent): v4.13.2 - saisie libre redaction avec doc ouvert -> proposition appliquer/rejeter (generate sans outils)
FlowDeck CI / test (push) Failing after 9s
FlowDeck CI / docker (push) Skipped

This commit is contained in:
2026-09-06 01:24:14 -04:00
parent 75b7f29826
commit 3025a7a44e
5 changed files with 43 additions and 3 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ async def lifespan(_app: FastAPI):
app = FastAPI(
title="FlowDeck",
version="4.13.1",
version="4.13.2",
docs_url="/docs" if settings.log_level == "DEBUG" else None,
redoc_url=None,
lifespan=lifespan,
+1 -1
View File
@@ -381,7 +381,7 @@ class LLMClient:
)
# ── Generic drafting verb, no title (typing directly in the chat) ──
if re.search(r"^(r[ée]dige|[ée]cris|g[ée]n[èe]re|produis|d[ée]veloppe|"
if re.search(r"^(r[ée]dige|[ée]cris|[ée]crire|g[ée]n[èe]re|produis|d[ée]veloppe|"
r"[ée]cris\s+un|g[ée]n[èe]re\s+un|r[ée]dige\s+un)\b", low):
return (
"## Introduction\n"
+23
View File
@@ -424,6 +424,20 @@
},
// ── Document actions (no tools) → proposition à approuver / rejeter ──
_isContentRequest(t){
var low = (t || '').toLowerCase();
var kws = ['écris','écrire','écrit un','rédige','rédiger','génère','générer','produis',
'développe','texte sur','paragraphe','article sur','rédaction','résume','résumer',
'résumé de','traduis','traduire','améliore','améliorer','note de réunion',
'série tv','série','contenu de la page','poème','histoire sur','sujet de','courriel','email sur'];
for(var i=0;i<kws.length;i++){ if(low.indexOf(kws[i]) !== -1) return true; }
return false;
},
_docModeFor(t){
var low = (t || '').toLowerCase();
if(low.indexOf('traduis') !== -1 || low.indexOf('traduire') !== -1 || low.indexOf('translate') !== -1) return 'replace';
return 'insert';
},
runDocAction(q){
var self = this;
this.ensureConversation().then(function(){
@@ -720,6 +734,15 @@
self.input = '';
this.resizeInput();
self.errorMsg = '';
// A writing/content request typed while a document is open → route it to
// headless text generation and offer the result with Apply / Reject,
// instead of sending the agent into tool calls (search/create).
if(self.activeContext && self.activeContext.kind === 'page' && self._isContentRequest(text)){
self.refreshContext();
return self.runDocAction({prompt: text, label: text, mode: self._docModeFor(text)});
}
self.streaming = true;
self.liveReasoning = '…';
self.messages.push({id:'u-'+Date.now(), role:'user', content: text});