different-ai/openwork · error · Error

Desktop Automation finished without an assistant result

Error message

Desktop Automation finished without an assistant result

What it means

After the thread snapshot reports status 'idle' (the agent finished its turn), executeDesktopAutomation expects an assistant message carrying a result. If the thread has been idle for more than 10 seconds with no assistant result extracted (assistantResult returned nothing usable), it concludes the run finished without producing output and throws. The 10s grace period avoids racing a just-idled session.

Source

Thrown at apps/desktop/electron/automation-runner.mjs:210

        throw error
      }
      const output = assistantResult(snapshot)
      const snapshotError = assistantFailure(snapshot)
      if (snapshotError) {
        const error = new Error(snapshotError.message)
        Object.defineProperty(error, "code", { value: snapshotError.code })
        throw error
      }
      if (snapshot?.status?.type === "idle" && output.hasCompletedOutput) {
        return {
          sessionId,
          workspaceId,
          resultSummary: output.resultSummary,
          usage: output.usage,
        }
      }
      if (snapshot?.status?.type === "idle" && Date.now() - startedAt > 10_000) {
        throw new Error("Desktop Automation finished without an assistant result")
      }
      await sleep(500, options.signal)
    }
  } catch (error) {
    const contextualError = error instanceof Error ? error : new Error(serializedError(error))
    if (Reflect.get(contextualError, "sessionId") === undefined) {
      Object.defineProperty(contextualError, "sessionId", { value: sessionId })
    }
    if (Reflect.get(contextualError, "workspaceId") === undefined) {
      Object.defineProperty(contextualError, "workspaceId", { value: workspaceId })
    }
    throw contextualError
  } finally {
    options.signal.removeEventListener("abort", abort)
  }
}

/** Delivers a remote command as a normal visible local OpenWork session. */

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Inspect the session transcript to see why the assistant produced no result
  2. Ensure the assignment prompt elicits a concrete final answer
  3. Check that no permission/approval prompt stalled the agent into an idle state
  4. Update assistantResult() parsing if the snapshot message schema changed

Example fix

// before: prompt that can end with no answer
{ title: "check things", prompt: "look at the repo" }
// after
{ title: "check things", prompt: "look at the repo and reply with a summary of findings as your final message" }
Defensive patterns

Strategy: try-catch

Validate before calling

// Require prompts that demand a final answer
if (!/respond|reply|summar|report/i.test(assignment.prompt)) {
  assignment.prompt += " End with a final message summarizing your result.";
}

Try / catch

try {
  const result = await executeDesktopAutomation(assignment, options);
} catch (err) {
  if (err.message === "Desktop Automation finished without an assistant result") {
    const transcript = await fetchSessionTranscript(err.sessionId); // sessionId is attached to the error
    console.warn("Idle without result; transcript:", transcript);
  } else throw err;
}

Prevention

When it happens

Trigger: Snapshot status.type === 'idle', >10s since startedAt, and assistantResult(snapshot)/assistantFailure(snapshot) yield no result — e.g. the thread idled after only user/system messages or an empty assistant reply.

Common situations: Agent replied with no parsable result payload; thread aborted early leaving only the initial prompt; assistant hit a permission wall and idled silently; result-extraction helper mismatched the message shape after a protocol change.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/fb637fcedd811931. Report an issue: GitHub.