You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each specialist agent registers with the registry at startup and then stays status: active in registry.json for its whole lifetime. When an agent process stops cleanly — a Render redeploy, a SIGTERM, a local Ctrl-C — it never tells the registry it's going away. The record lingers as active, the orchestrator's planner can still select it, and the failure is only caught later by the executor's runtime health check — wasting a planning cycle and adding task latency. Clean shutdowns should not require the registry to discover the agent is gone.
Goal
On graceful shutdown, an agent tells the registry it's leaving (deregister, or mark itself inactive) before the process exits.
Requirements & constraints
Add a registry endpoint to deregister / mark-inactive an agent, scoped to the agent's own identity (an agent must not be able to deregister a different agent). If a suitable endpoint doesn't exist, adding it is part of this work.
Each agent installs SIGTERM and SIGINT handlers that call it, then close the HTTP server and exit 0.
The shutdown call must be timeout-bounded so a slow or unreachable registry can never hang the process exit.
This pairs with the stale-agent TTL expiry work (draft issue [Task]: Add unit tests for the CleverVault contract #10): graceful shutdown handles the clean case, TTL expiry handles crashes. They're complementary and independent — neither blocks the other.
Design decisions left to the implementer
Endpoint shape (DELETE /agents/:id vs POST /agents/:id/inactive) and how the agent authenticates ownership (its keypair / the id it registered with).
Each specialist agent registers with the registry at startup and then stays
status: activeinregistry.jsonfor its whole lifetime. When an agent process stops cleanly — a Render redeploy, aSIGTERM, a local Ctrl-C — it never tells the registry it's going away. The record lingers asactive, the orchestrator's planner can still select it, and the failure is only caught later by the executor's runtime health check — wasting a planning cycle and adding task latency. Clean shutdowns should not require the registry to discover the agent is gone.Goal
On graceful shutdown, an agent tells the registry it's leaving (deregister, or mark itself inactive) before the process exits.
Requirements & constraints
SIGTERMandSIGINThandlers that call it, then close the HTTP server and exit0.Design decisions left to the implementer
DELETE /agents/:idvsPOST /agents/:id/inactive) and how the agent authenticates ownership (its keypair / the id it registered with).Edge cases to consider
SIGTERMs) → deregister once, exit once.Acceptance criteria
SIGTERM/SIGINThandler calls it, then closes the server and exits 0npm testpassesRelevant files
packages/registry/src/server.ts,packages/registry/src/server.test.ts, eachpackages/agents/*/src/server.ts(or shared startup helper)Notes for contributors
If you'd like to work on this, comment below so we can assign it to you.
Questions welcome — see CONTRIBUTING.md for setup
and workflow.