Skip to content

take an unfinished task as left open after 20 idle minutes, not abandoned after a day - #156

Merged
hkonsti merged 4 commits into
mainfrom
hkonsti/task-auto-finish-timeout
Oct 28, 2026
Merged

hkonsti merged 4 commits into
mainfrom
hkonsti/task-auto-finish-timeout

Conversation

@hkonsti

@hkonsti hkonsti commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

A task the agent never marks finished is now taken as "left open" once 20 minutes pass with nothing done for it or its sub-tasks, instead of "abandoned" a day after its last sub-task started. Agents often just don't mark tasks finished, so "abandoned" / "given up" misdescribed what happened, and a day kept forgotten tasks under way far too long.

Left open isn't final: the next call made for the task, a sub-task started under it, or finish_task takes it, and every task above it, up again, so an agent coming back after a pause carries on with the same task. Only a task that is finished, or one left open under a task that was finished without it, is refused. The built-in agent's sub-agents rely on this too: one that slept long keeps its task rather than getting a new one, so ensureThreadTask / setThreadTask are gone, and its report finishes the task even where it was left open.

Because a 20-minute clock counted from the start would cut off agents still at work, every call made for a task now resets the clock for it and every task above it (touchAgentTask, sharing the top-down locking createAgentTask already used). It's written at most once a minute per task, so a call isn't a write each. Migration v037 renames AgentTask.lastStartedAt to lastActiveAt and fills it from the audit log, so each task's is no earlier than the last request made for it or its sub-tasks. The status is leftOpen / "Left open" across the web app and the docs.


Open workspace in Conductor

Renumber the lastActiveAt migration to v037, after main's v034-v036, and
carry the rename and the 20-minute window into the built-in agent's tasks.
A call, a sub-task started under it or finish_task for a task left open
takes it and every task above it up again, unless one of them was
finished, rather than refusing it and asking for a new task. So an agent
coming back after a pause carries on with the same task, and a built-in
sub-agent that slept keeps its task instead of getting a new one.
… taking it up, and end a task left open at its last activity

The migration adds lastActiveAt beside lastStartedAt rather than renaming it, so instances still
on the version before keep working while a deploy replaces them; a later migration drops it.
Opening a task on the agent pages only reads it. A sub-agent whose task was finished while it was
at work gets a new one, as it has no start_task of its own. A task left open is drawn as ending at
its lastActiveAt, which the timeline reads it by too, so its bar and status agree. The once-a-minute
write lives in touchAgentTask, and starting a sub-task takes its parent up once.
@hkonsti
hkonsti merged commit 4e1cc27 into main Oct 28, 2026
3 checks passed
@hkonsti
hkonsti deleted the hkonsti/task-auto-finish-timeout branch October 28, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant