diff --git a/agents/console/server.mjs b/agents/console/server.mjs index 84d0a21..701bf88 100644 --- a/agents/console/server.mjs +++ b/agents/console/server.mjs @@ -493,8 +493,15 @@ async function runDesignTask(task) { // Pre-flight: the auto-publish commit is scoped to GIT_SCOPE, so a dirty tree // would get swept into this task's commit. Refuse rather than clobber WIP. + // Uploaded assets under app/public/media/ are expected (they're this task's + // images) and get committed with it, so they don't count as "dirty". const pre = await git(["status", "--porcelain", "--", ...GIT_SCOPE]); - if (pre.tail.trim() !== "") { + const dirty = pre.tail + .split("\n") + .map((l) => l.slice(3).trim()) // strip the "XY " status prefix + .filter(Boolean) + .filter((p) => !p.startsWith("app/public/media/")); + if (dirty.length) { return { ok: false, error: "Working tree wasn't clean — commit or discard pending changes before running the queue." }; }