fix(cli): les annonces MCP/inter-agent restent affichées pendant qu'un agent est busy — #232

This commit is contained in:
2026-08-21 19:40:13 +02:00
parent a51813fc44
commit aa85d4dfc8
6 changed files with 258 additions and 32 deletions

View File

@ -625,7 +625,7 @@ function LeafView({
// F3 lifecycle state (busy) for this cell's agent — shared here so the
// write-portal veil can be mutually excluded with the F3 overlay (exactly one
// full-cell veil at a time, F3 first). Same source the overlay itself reads.
const { active: busyActive } = useTargetAnnouncements(agentId ?? "");
const { active: announcementBusyActive } = useTargetAnnouncements(agentId ?? "");
// Ticket #54 — local model-server launch state for this cell's pinned agent.
// Correlated `agentId → profileId → opencode.localModelServerId → status` via
// the shared hook (same reduction as `useAgents`). While the bound server is
@ -768,6 +768,10 @@ function LeafView({
) ?? [];
const busyByWorkState = agentWork?.busy.state === "busy" || Boolean(activeTicket);
const delegatedTicket = activeTicket?.source.kind === "agent" ? activeTicket : undefined;
const busyActive = announcementBusyActive || busyByWorkState;
const targetAnnouncementsFallback = delegatedTicket?.requesterLabel
? `Travaille sur une demande de ${delegatedTicket.requesterLabel}.`
: "Travaille sur une demande en cours.";
const [restartPending, setRestartPending] = useState(false);
const [restartError, setRestartError] = useState(false);
const [freshRestartedSession, setFreshRestartedSession] =
@ -1561,8 +1565,13 @@ function LeafView({
busy state (agentBusyChanged + read-model hydration), never by the raw
PTY — it retracts at idle even when a turn ends without a completion
event. Self-guards on `active` (busy) and renders null otherwise. */}
{!modelServerOverlay && cellMode !== "custom" && agentId != null && (
<TargetAnnouncementsOverlay projectId={projectId} agentId={agentId} />
{!modelServerOverlay && agentId != null && (
<TargetAnnouncementsOverlay
projectId={projectId}
agentId={agentId}
busyFallbackActive={busyByWorkState}
fallbackText={targetAnnouncementsFallback}
/>
)}
{/* Ticket #54 — model-server launch veil. Top-priority full-cell overlay
(suppresses the write-portal + F3 veils above): while the pinned