From 0f56aae8033f8edeaaa627ce6b58b4b366638dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 19 Aug 2026 14:41:29 +0000 Subject: [PATCH] a task the server cannot find is dismissed, not reported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A chip stuck on "running" could not be stopped, killed or dismissed. Stop and Kill both answered {"stopped":false,"reason":"no such task"} — there is no output file, so no pid, so nothing to signal — and dismiss is only offered for a task the tray believes has finished. A chip with no way out. The server saying it cannot find the job is authoritative rather than an error worth reporting: the chip was the last thing claiming it existed. Pressing Stop now clears it. Running chips still have no dismiss button of their own, deliberately — the tray is the only thing watching a live job and a hidden one is a job you have no way back to. This is the escape hatch for a job that is not actually live, and it is reached by pressing the control you would already have pressed. Co-Authored-By: Claude Opus 5 --- .../apps/Chat/components/BackgroundTaskTray.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/workspaces/officerdev/src/apps/Chat/components/BackgroundTaskTray.tsx b/src/workspaces/officerdev/src/apps/Chat/components/BackgroundTaskTray.tsx index cd2c9212..a26a2f24 100644 --- a/src/workspaces/officerdev/src/apps/Chat/components/BackgroundTaskTray.tsx +++ b/src/workspaces/officerdev/src/apps/Chat/components/BackgroundTaskTray.tsx @@ -82,7 +82,19 @@ export const BackgroundTaskTray = ({ messages, sessionId }: BackgroundTaskTrayPr try { await client.delete(`/chat/tasks/${taskId}${force ? '?force=1' : ''}`); } catch (err) { - toast.error(err instanceof Error ? err.message : 'Could not stop that job'); + const message = err instanceof Error ? err.message : ''; + // The server saying it cannot FIND the job is authoritative, not an error to report: there is no + // output file, therefore no pid, therefore nothing running. The chip was the last thing claiming + // otherwise. + // + // Without this the tray showed a job that could not be stopped, killed or dismissed — a chip with + // no way out, because dismiss is only offered for a task the tray believes has finished. Pressing + // Stop then Kill both answered {"stopped":false,"reason":"no such task"} and changed nothing. + if (message.includes('no such task') || message.includes('already stopped')) { + dismiss(taskId); + return; + } + toast.error(message || 'Could not stop that job'); } };