merge(application,backend,web-server,app-tauri,frontend): fix #369 — libère l'état busy avant le Final visible (QA verte)

This commit is contained in:
2026-09-17 09:46:31 +02:00
5 changed files with 217 additions and 15 deletions

View File

@ -1105,6 +1105,7 @@ export function CustomAgentChatView({
} | null>(null);
const [queueAnnouncement, setQueueAnnouncement] = useState("");
const [queueDrainReady, setQueueDrainReady] = useState(false);
const [terminalWorkStatePending, setTerminalWorkStatePending] = useState(false);
const [slashCommands, setSlashCommands] = useState<SlashCommand[]>([]);
const [slashMenuOpen, setSlashMenuOpen] = useState(false);
const [slashActiveIndex, setSlashActiveIndex] = useState(0);
@ -1342,6 +1343,7 @@ export function CustomAgentChatView({
const effectiveBusy =
busy ||
stopping ||
terminalWorkStatePending ||
Boolean(restart && restart.outcome !== "failed") ||
(!stopTerminalOverride &&
(requesterDelegation.currentAgentBusy || delegationActive));
@ -1709,17 +1711,21 @@ export function CustomAgentChatView({
markProjectCliInteractionFinished(projectId, activeInteractionIdRef.current);
activeInteractionIdRef.current = null;
}
stopTerminalOverrideRef.current = true;
setStopTerminalOverride(true);
setRequesterDelegation({
currentAgentBusy: false,
delegationTargetName: null,
});
setBusy(false);
void refreshRequesterDelegation();
if (workState) {
setTerminalWorkStatePending(true);
void refreshRequesterDelegation().finally(() => {
if (mountedRef.current) setTerminalWorkStatePending(false);
});
} else {
setRequesterDelegation({
currentAgentBusy: false,
delegationTargetName: null,
});
}
}
},
[projectId, refreshRequesterDelegation, updateChatViewState],
[projectId, refreshRequesterDelegation, updateChatViewState, workState],
);
useEffect(() => {