feat(backend,frontend): lot utilisateur #346 #347 #348 — exécution workspace plugin contrôlée par l'hôte, réordonnancement des onglets projet par glisser-déposer, Final restauré après stop d'agent CLI custom (QA verte)

#346 — capacités plugin SCM: le manifeste permissions.workspaceExec
(contrat SDK 8ff0f47) est appliqué côté hôte — domain PluginWorkspaceExec
Rule/Effect + audit sink, port WorkspaceToolRunner, adapter
LocalWorkspaceToolRunner sandboxé (concurrence 4, timeout, bornes
stdout/stderr, résolution bare executable sans shell), service
application + DTO backend + commandes app-tauri, gateway frontend
execTool exposée au runtime plugin — fin des lectures ad hoc du store
interne .git par les plugins.
#347 — onglets projet réordonnables par glisser-déposer (Tabs DnD,
onReorder, persistance de l'ordre via useProjects).
#348 — stop d'agent CLI custom: le message Final vert réapparaît au tour
suivant (override terminal stop armé correctement, reset de
l'interaction, refresh de la délégation requester).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-13 12:23:44 +02:00
parent 2b0d82efa3
commit 561c50f6ed
28 changed files with 1761 additions and 51 deletions

View File

@ -1564,6 +1564,7 @@ describe("CustomAgentChatView", () => {
it("cancels only the current request and keeps the structured session usable", async () => {
let resolveCancel: (result: CancelAgentChatResult) => void = () => {};
let firstTurnChunk: (chunk: ReplyChunk) => void = () => {};
let reattachedChunk: (chunk: ReplyChunk) => void = () => {};
let rejectFirstTurn: (reason: unknown) => void = () => {};
const system = new MockSystemGateway();
const workState = new MockWorkStateGateway();
@ -1581,10 +1582,12 @@ describe("CustomAgentChatView", () => {
});
const agent = {
launchAgentChat: vi.fn(),
reattachAgentChat: vi.fn(async (sessionId: string) => ({
sessionId,
scrollback: [],
})),
reattachAgentChat: vi.fn(
async (sessionId: string, onChunk: (chunk: ReplyChunk) => void) => {
reattachedChunk = onChunk;
return { sessionId, scrollback: [] };
},
),
sendAgentChat: vi
.fn()
.mockImplementationOnce((_sessionId: string, _prompt: string, onChunk) => {
@ -1594,6 +1597,41 @@ describe("CustomAgentChatView", () => {
});
})
.mockImplementationOnce(async (_sessionId: string, _prompt: string, onChunk) => {
reattachedChunk({ kind: "final", content: "Stale cancelled answer" });
onChunk({
kind: "progress",
progress: {
source: "providerNative",
kind: "tool",
stage: "completed",
label: "web_search",
provider: "codex",
nativeEvent: "item.completed",
},
});
onChunk({
kind: "progress",
progress: {
source: "providerNative",
kind: "message",
stage: "completed",
label: "message intermédiaire",
text: "Complete intermediate answer",
provider: "codex",
nativeEvent: "item.completed",
},
});
onChunk({
kind: "progress",
progress: {
source: "providerNative",
kind: "turn",
stage: "completed",
label: "tour terminé côté provider",
provider: "codex",
nativeEvent: "turn.completed",
},
});
onChunk({ kind: "final", content: "Next answer" });
}),
stopLiveAgent: vi.fn(),
@ -1729,7 +1767,11 @@ describe("CustomAgentChatView", () => {
"next turn",
expect.any(Function),
);
expect(await screen.findByText("web_search")).toBeTruthy();
expect(await screen.findByText("Complete intermediate answer")).toBeTruthy();
expect(await screen.findByText("Next answer")).toBeTruthy();
expect(screen.queryByText("Stale cancelled answer")).toBeNull();
expect(screen.queryByRole("button", { name: "Stop" })).toBeNull();
});
it.each(["alreadyCancelled", "alreadyCompleted"] as const)(