Skip to main content

How runs work

This page explains what happens between the moment a task is due and the moment its run ends. You do not need it to use scheduled tasks. Read it when a run waits longer than you expect, or fails and you want to know why.

From schedule to run​

  1. When a task is due (or you select Run now), MINEO puts a run in the queue. The run shows Queued.
  2. A background worker takes the run. The run shows Running.
  3. MINEO checks that the run can start. If a check fails, the run ends before it opens a conversation. See Checks before a run starts.
  4. The run opens a conversation and sends the prompt.
  5. The run ends with a final status: Completed, Awaiting approval, Failed or Cancelled.

In Chat mode a task never has two runs at the same time: if a run is still queued or running when the task is due again, the new run is skipped. Run now tells you when this happens. In Work mode a run lasts as long as its Work session: if the session of the previous run is still open, the new run is Failed with the reason The previous run is still working.

Why a run stays queued​

Background workers run the scheduled tasks of all projects, and other scheduled work of MINEO too. When all workers are busy, a run waits in the queue until a worker is free. This usually takes seconds. Many tasks that run at the same minute (for example, all at 08:00) wait longer. If you can, spread the schedules of your tasks across different minutes.

Waiting for a free Work session​

Your organization has a limit of Work sessions that can be open at the same time. When the limit is reached, a run in Work mode does not fail. It goes back to the queue and tries again:

  • It tries again every minute, up to 8 times.
  • While it waits, it shows Queued with the reason Waiting for a free Work session, and the number of attempts.
  • If a Work session is free before then, the run starts as usual.
  • After 8 attempts, the run shows Failed with the reason Gave up after 8 attempts.

The 8 minutes are shorter than the 10 minutes between two runs of the same task, so a retry never overlaps the next scheduled run.

A Work session stops when the turn of the task ends and nobody wrote in it. If someone wrote in it, it stays open until it is inactive for some minutes. A task with long turns that runs often can use the whole limit of your organization. If runs often wait or fail for this reason, run the task less often.

Checks before a run starts​

Before a run opens a conversation, MINEO checks:

CheckIf it fails
The AI budget of your user, project and organization is not spent. You get the usual 80% and 100% warnings.Cancelled. Nothing is retried: the next scheduled run tries again.
Your user is active and still in the project, your license includes threads, the plan has the Scheduled tasks option, Scheduled tasks and Assistants are shown to you in the project, and you can still use the Assistant, which exists.Failed, with the reason, and the task is paused: it cannot run again until this changes.
The Assistant does not start with a form.Failed, with the reason, and the task is paused.
Work: the Work session of the previous run is closed.Failed, with the reason. The next scheduled run tries again.
Chat: a model with prices and an API key is available.Failed, with the reason.
Work: Work is enabled for the Assistant and allowed for the organization, and you can open the working directory.Failed, with the reason, and the task is paused. A run that is already working continues until it ends.
Work: a Work session is free.Waits and retries. See Waiting for a free Work session.

A failed check does not open a conversation and does not cost anything.

How a run ends​

Chat mode

  • The run ends when the Assistant answers. Its status comes from that answer: Completed, Awaiting approval (a tool asks for approval), or Failed (the model or a tool returned an error).
  • A Chat run stops after 15 minutes, as if you had pressed Stop. What the Assistant did, and the AI cost until then, are kept. The run shows Failed with the reason Stopped after 15 minutes.
  • If the Assistant does not stop 2 minutes after that, the run is cut and shows Failed with the reason Did not stop after 15 minutes and was cut. In this case, the AI cost of the turn is not recorded.

Work mode

  • The run shows Running while its Work session is open.
  • When the turn of the task ends and nobody wrote in the session, the session stops and the run shows Completed, or Failed if the turn failed.
  • When someone stops the turn, or stops or deletes the session, the run shows Cancelled. If nobody wrote in the session, the session stops too.
  • When someone restarts the session, the run goes on in the new session. It shows Cancelled only if the session cannot start again.
  • When the session closes because it is inactive, the run shows Completed.
  • When the turn runs past the maximum time of your plan, the run shows Failed. If the turn waited for a tool approval that nobody gave, the reason says so.
  • When the session or its worker fails, the run shows Failed with the reason.

If MINEO stops unexpectedly

If a background worker stops in the middle of a Chat run (for example, during an update), MINEO marks the run Failed, with the reason The run was interrupted by a server restart. This happens a few minutes later, and at most 20 minutes after the run started. The next run can start as usual. A run that no worker takes in 30 minutes, also one waiting to try again, is marked Failed with the reason No worker took the run in 30 minutes. No run stays queued or running forever.

Cancelled runs​

A run is Cancelled when the AI budget is spent, or when someone stops it before it ends. To stop a run, open its conversation and select Stop.