Waiting on CI and deploys
How agents wait for something outside their agent environment, and what you see when a turn ends with work still running.
An agent works in turns. When a turn ends, whatever the agent left running in the background stops reporting: Claude Code stops its background tasks and monitors, and a process any agent started on its own is no longer watched. n8v makes both visible, and gives agents a way to wait that does not keep an agent environment running.
These features are being rolled out and may not be on for your account yet.
Waiting with wait_for
Agents have a wait_for tool for anything outside the agent environment:
- GitHub checks: every check and commit status on a commit has finished. n8v hears it from GitHub as it happens.
- A URL: a deploy, a health check or a job status. n8v requests it every minute until it answers, optionally with a given text in the response.
- A wake URL: a single-use URL a CI or deploy step calls when it is done, with its token in an
Authorization: Bearerheader (keep it in a CI secret). Any JSON it sends reaches the agent.
The agent names a deadline (up to 24 hours, one hour by default) and ends its turn. The chat shows what it waits for and when it gives up, for example Waiting for CI on feat/login · gives up in 58 min, and its agent environment pauses. When the wait is over, or the deadline passes, n8v resumes the chat and tells the agent what happened. Sending a message, or stopping the chat, ends the wait.
Local work, such as tests and builds, still runs in the foreground of a turn.
When a turn ends with work still running
If a turn ends while something it started is still running, the chat finishes and shows Ended with work still running, with what was left. Ask the agent to finish it sends the agent a message to complete that work. The API and MCP report it as pendingWork (pending_work over MCP).