← Catalog

@agimon-ai/doompi-autostop

Shuts a DoomPi session down once the agent settles and stays idle.

Extension

Install

Install with PiG

pig install npm:@agimon-ai/doompi-autostop

Install with Pi

pi install npm:@agimon-ai/doompi-autostop
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./dist/extensions/pi.mjs"
  ]
}

README

Written by the package's publisher, shown as published in version 0.0.1-alpha.105 (README.md). PiG does not review it.

@agimon-ai/doompi-autostop

Shuts a DoomPi session down once the agent settles and stays idle.

A scripted run wants the session to exit on its own when the work is done. Waiting for agent_settled alone is not enough: the agent can settle and immediately pick up a queued message, and it can settle while the last response is still streaming. So this package settles, waits, looks again, and only then stops.

The policy

MomentSession stateOutcome
agent_settledmessages queuedstand down
agent_settledqueue emptylook again in 5s
the scheduled lookmessages queuedstand down
the scheduled lookbackground runner or agent activelook again in 5s
the scheduled lookstill streaminglook again in 100ms
the scheduled lookidle, queue and background emptycontext.shutdown()

Any input or agent_start event disarms a pending stop. The cooldown is the grace period; the 100 ms recheck waits out a stream that has not finished draining. Only two kinds of background work keep a settled session alive: supervised Doom Runner processes (doom-runner) while running or awaiting asynchronous completion admission (published without a status). A runner listed as completed or failed no longer counts. Subagents (team-direct-runs, doom-task) owned by the current session also hold it open, including provider errors from them. The holding rule is shared with workflow step supervision through core's holdsSettledSession. Workflow runs (workflow-mcp) do not hold a session open.

Each wait is recorded as doom_autostop.waiting_on_background_work telemetry naming the work holding the session, along with doom_autostop.stood_down and doom_autostop.shutdown_requested.

decideOnSettled and decideOnRecheck handle the plain Pi session state. The idle shutdown watch adds the authoritative background-work gate before the policy may stop the session.

What it registers

EntrySurface
./extensions/piinput, agent_start and agent_settled hooks, plus the shutdown that disarms them

The extension owns a Cordis fiber; session_shutdown disposes it, which cancels any armed stop. That matters because Pi reloads extensions in process. A timer left armed by the previous load would stop the session it was reloaded into.

Installation

DoomPi depends on this package and activates it when a run asks for --auto-stop. It is not selectable from .doom/modes.yaml.

License

MIT