AI media harness for planning, generating, and editing locally
TypeScript
Clear agent input on send
Bitti4d4d861e4cc2
diff --git a/src/components/workspace/AgentDock.test.tsx b/src/components/workspace/AgentDock.test.tsxindex 349edd3..e6a6af3 100644--- a/src/components/workspace/AgentDock.test.tsx+++ b/src/components/workspace/AgentDock.test.tsx@@ -188,7 +188,7 @@ describe("Slop output panel", () => {expect(onPromptStart).toHaveBeenCalledTimes(1);});- it("shows the running turn with a progress ring, stops it with Esc, and recalls the last prompt with Up", async () => {+ it.each(["Enter", "button"])("clears the composer on %s submission, stops with Esc, and recalls the last prompt with Up", async (submit) => {let finish!: (value: Awaited<ReturnType<typeof runAgentTurn>>) => void;vi.mocked(runAgentTurn).mockImplementation(() => new Promise((resolve) => { finish = resolve; }));const onPromptStart = vi.fn();@@ -197,7 +197,10 @@ describe("Slop output panel", () => {const field = screen.getByRole("textbox", { name: "Ask Slop about this generation queue" });fireEvent.change(field, { target: { value: "Create four shots" } });- fireEvent.keyDown(field, { key: "Enter" });+ if (submit === "Enter") fireEvent.keyDown(field, { key: "Enter" });+ else fireEvent.click(screen.getByRole("button", { name: "Send to Slop" }));+ expect(field).toHaveValue("");+ expect(field).toBeDisabled();await waitFor(() => expect(runAgentTurn).toHaveBeenCalled());expect(onPromptStart).toHaveBeenCalledTimes(1);@@ -256,6 +259,8 @@ describe("Slop output panel", () => {expect(log).toHaveTextContent("Leonard and Penny, in live action");expect(log).toHaveTextContent("Agent turn timed out after 300 seconds.");expect(screen.queryByRole("status")).not.toBeInTheDocument();+ expect(field).toHaveValue("");+ fireEvent.keyDown(field, { key: "ArrowUp" });expect(field).toHaveValue("Leonard and Penny, in live action");});diff --git a/src/components/workspace/AgentDock.tsx b/src/components/workspace/AgentDock.tsxindex 91bf5d0..5be5c1f 100644--- a/src/components/workspace/AgentDock.tsx+++ b/src/components/workspace/AgentDock.tsx@@ -157,6 +157,7 @@ export function AgentDock({ context, record, mode = record.config.generationTypesetError(null);setPendingPrompt(clean);setLastPrompt(clean);+ setPrompt("");setActivity([]);try {// The native agent uses this legacy field to select its instructions.@@ -173,11 +174,9 @@ export function AgentDock({ context, record, mode = record.config.generationType// correction notes that led to it would only repeat it.setActivity([]);setPendingPrompt(null);- setPrompt("");} catch (reason) {if (activeController.current?.signal.aborted) {setPendingPrompt(null);- setPrompt("");} else {const detail = describeDiagnosticError(reason);writeDiagnostic("error", "agent", "turn.failed", detail, { requestId: id, provider, projectId: record.config.id, ...errorContext(reason) });