Skip to content
Agent

Background commands

Dev servers and long builds: how the agent runs them, and how you see and stop them.


Mel's agent runs commands that don't finish, such as a dev server, a file watcher or a long build, in the background: it keeps working while they run and checks their output when it needs to. You see every background job above the message box and can stop any of them.

Recording needed: the agent starting a dev server in the background, the "Background jobs (1)" strip above the input, and Stop

How the agent uses them

  • Starting. The agent starts a command in the background when it expects it to keep running. It goes through the same approval as any command, and the approval card says it's a background command.
  • Long commands are handed off. A command the agent ran normally that's still going after 120 seconds is moved to the background instead of being killed: same process, no output lost. The agent is told the job's number and keeps going. If the agent gave the command its own time limit, that limit still applies.
  • Waiting and reading. The agent can wait for a job to finish (or print something), read its latest output, and see which jobs are running.
  • Answering prompts. If a job stops at a prompt (Password:, >>>, Continue? [y/N]), the agent sees the prompt and can type an answer into the job, or close its input.
  • Stopping. The agent can stop a job it started, along with everything that job started.

Interactive programs

The agent works with programs that read lines: it can answer a Password: or Continue? [y/N] prompt, type more input into a job it started, and close a job's input when it's done. It types only into jobs it started itself, and that never needs a card (Settings → Agent mode lists it as always allowed).

It doesn't operate full-screen programs such as vim, top or htop; those are for you, in a terminal pane. To have agents drive other agents' screens, use orchestration with CLI workers.

The jobs strip

While a conversation has jobs running, Background jobs (N) appears above the message box, one row per job with its command.

  • Stop stops that job and everything it started. The row says stopping..., then how the job ended, or not stopped with the reason.
  • With many jobs, the strip shows the first few and says how many more are running.

Stopping the turn

Pressing Stop on the agent's turn ends the turn, including any wait for a job, right away. It doesn't stop the jobs: the turn's last line says how many background jobs are still running, and you can stop them from the strip.

Quitting Mel

If background jobs are running when you quit, Mel tells you (for example "1 background job is running.") before it closes, as long as Warn before quitting is on in Settings ▸ Features.

Limitations

  • Over a Melted SSH session, the agent can't start background jobs. It runs commands normally there.
  • Quitting Mel stops every background job, so no dev server is left running after Mel closes.

FAQ

Can an AI agent run a dev server and keep working? Yes. Mel's agent starts it in the background, carries on, and checks the server's output or makes a request to it when it needs to.

Can I see a job's whole output? Ask the agent; it reads the job's output on request. The strip shows only that the job is running.

Why did my command keep running after 120 seconds? That's the hand-off: Mel moved it to the background so the agent could carry on. Stop it from the strip if you don't need it.