Skip to content

Using the CLI

Background Agents & Jobs

Two different things share the word "background".

JobBackground agent
What it isA long-running command the agent started, such as a build, a test run, or a dev serverA whole conversation running in a detached process
Lives inThe current conversationIts own process and process group
Survives the terminal closingNoYes
Managed with/jobs/agents, oasis-agent agents

Jobs

When the agent starts something long-running, a row appears under the prompt with a live timer:

text

  2 jobs ⚙ npm test 1m34s ⚙ vite dev 2m07s  ·  /jobs

Managing jobs

/jobs opens the list.

KeyAction
Choose a job
Show its output
kKill it
dDetach it. It keeps running, the turn stops waiting

The cursor follows the job row, not a line number. A job finishing above the one you are about to kill will not slide a different one under your keypress.

/jobs works mid-turn, so you can inspect or kill a job while the model is still working.

Releasing a job mid-turn

Ctrl+B releases a foreground job the turn is waiting on, for when the model should have backgrounded something and did not. The job keeps running; find it in /jobs. With nothing waiting, Ctrl+B does what /background does.

Waiting without polling

The Monitor tool waits for a named line in a job's output rather than polling it. It is the right way to express "wait until the dev server says it is listening", and cheaper than repeated reads, and it does not burn turns.

Fieldbus sessions appear here

An EtherCAT live I/O session shows up in /jobs like any other job, so you can stop it yourself without the agent's cooperation. It holds physical outputs energised between turns, and if the model gets stuck you are not reduced to killing the process.

Background agents

A background agent is a whole conversation in a detached process. It outlives your terminal.

Dispatching one

bash
# Stops at the first mutating tool and waits for you
oasis-agent --bg -p "port the modbus tests"

# Runs unattended inside the current directory
oasis-agent --bg --mode auto -p "run the test suite"

The command prints the conversation id and exits immediately. The work continues in its own session and process group.

The permission mode is fixed at dispatch, so choose how much rope it has with --mode.

Handing over the conversation you are in

From the REPL, /background moves the current conversation to a background agent. It keeps working if you leave, and your prompt becomes a new empty conversation.

Used from /agents on a conversation an agent is still working on, /background does the reverse: it lets go of that conversation and takes a fresh prompt, leaving the agent to run.

/bg and /handoff are the same command.

Tracking them

bash
$ oasis-agent agents
ID                    STATE     UPDATED           TURNS  NAME
20260819-011449-bfd8  blocked   2026-08-19 01:14      1  port the modbus tests
                      ! needs approval: Bash

1 agent is stopped and waiting on you. `oasis-agent --resume <id>` to pick one up.
FlagEffect
--allInclude finished and failed agents, not just live ones
--cwd <dir>Only agents dispatched under this directory
--stop <id>Stop one, so --resume can take the conversation over
--jsonPrint as a JSON array and exit. Needs no terminal

From the REPL, /agents lists background agents and saved conversations, and switches to one in place without leaving your session. /resume is the same command.

States

StateMeaning
runningWorking now
blockedStopped and waiting on you, for an approval or a question
stoppedEnded, by --stop or on its own
failedEnded with an error

An agent that meets something it may not do does not guess. It stops, saves state, and goes blocked.

Picking one up

bash
oasis-agent --resume 20260819-011449-bfd8

A unique prefix of the id is enough. Resume it where there is someone to answer the question it stopped on.

Output files

Three files are left per agent:

FileContents
<id>-agent.logProse output, as you would have seen it
<id>-agent.errDiagnostics
<id>-agent.jsonlThe full event stream, one JSON object per line

The .jsonl file is the one to parse if you are wiring an agent into something else.

Which should I use?

You wantUse
The agent to run a build and keep working while it runsA job. The agent does this itself
To keep working while a long conversation continues elsewhere/background
To fire off work from a script and check on it lateroasis-agent --bg -p "…"
A conversation to survive an SSH disconnect--bg, or /background before you leave
Structured events streamed to another program as they happenControl Protocol

software-defined automation