feat(background-agent): use "interrupt" status for promptAsync errors

Change promptAsync catch blocks to set status = "interrupt" instead of "error".

This distinguishes prompt errors from stale timeouts (cancelled) and TTL expirations (error).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-09 18:25:54 +09:00
parent a37259326a
commit 5b34a98e0a
3 changed files with 5 additions and 5 deletions
@@ -164,7 +164,7 @@ export async function startQueuedTask(args: {
const existingTask = findBySession(sessionID)
if (!existingTask) return
existingTask.status = "error"
existingTask.status = "interrupt"
const errorMessage = error instanceof Error ? error.message : String(error)
if (errorMessage.includes("agent.name") || errorMessage.includes("undefined")) {
existingTask.error = `Agent "${input.agent}" not found. Make sure the agent is registered in your opencode.json or provided by a plugin.`