Event wakes#
Let an agent instance sleep until catalog or knowledge-base content it follows changes, instead of rescanning on a timer. A wake calls no model: the controller only checks a queue and, when something relevant arrived, continues the same mission.
Prerequisites#
The agent service is deployed, and
GEONEMO_AGENT_EVENT_WAKES_ENABLED=1is set for its controller. It is off by default.Subscriptions that read the knowledge base need the instance’s
gkb_readcapability.The controller can read the toolkit’s event feeds. See below.
Steps#
Enable the flag. Managed instances then default to catalog subscriptions. Interactive agents stay opt-in. Enabling an existing instance queues one catch-up generation.
Set an instance’s policy:
PUT /v1/agent-instances/{id}/wake-policyField
Meaning
catalog_changesWake on changes to the instance’s collections
gkb_project_changesWake on new knowledge artifacts in its projects
debounce_secondsQuiet period before waking. Default 60
The policy cannot change the instance’s creation scope or tool permissions.
Wake on demand with
POST /v1/agent-instances/{id}/wake, which needs anIdempotency-Key, the owner’s authentication and theagents:controlscope. A terminal deployment cannot wake, and a paused or blocked workflow needs its resume or retry first.Review activity with
GET /v1/agent-instances/{id}/wakes(generations and their execution IDs) and.../wake-deliveries(source revisions, hashes and suppression decisions). The console shows Sleeping instances, triggers, deadlines and Wake now.
How events reach the controller#
The controller reads the toolkit’s read-only feeds, never the backing outboxes:
GET /v1/events/catalog/{collection} and GET /v1/events/gkb/{project}. Each check, for
every collection and project a subscribed instance follows, it reads the events after its
stored position, journals and routes them, then stores the new position. A failure before
the position is stored re-reads the same events, and the journal prevents a double wake.
Nothing is claimed or acknowledged in the toolkit. Meaningful source, media, selector and
factual changes emit catalog events; embeddings, search metadata and identical re-ingestion
do not. New canonical knowledge artifacts emit knowledge events after the Markdown commit;
reindexing never does.
Situation |
Behavior |
|---|---|
A collection or project is followed for the first time |
Starts at the feed’s end; the subscription already queued a catch-up |
The feed answers 410 |
One catch-up generation for every healthy follower, then the position moves to the feed’s end |
The position table is empty (first start) |
One catch-up per follower before any position is stored |
Events during execution |
Combine into one follow-up generation. The first event sets the deadline, which continued ingestion cannot extend |
An agent’s own publication, or an ancestry cycle |
Suppressed per event. Unrelated external changes still deliver |
The feed keeps events seven days. Completed wake and event history is retained 30 days. Failed wakes stay visible and need operator action.
Controller credential#
The controller authenticates with a read-only service credential at
GEONEMO_SERVICES_API_ENDPOINT. It issues itself one named wakes.<container host name>
that lasts a day, renews it at half its life and issues it again once if refused. To use
your own, set GEONEMO_EVENT_FEED_TOKEN, issued on the host with
geonemo-services access issue-service-token --name <name> and printed once. Without
either, event wakes report unavailable and the controller status is degraded. Timers,
intervals and manual wakes keep working.
Result#
A sleeping instance continues when a followed change arrives. The controller publishes
agent.event-queues.v1 observations once a minute: feed availability, feeds followed and
their lag, pending and failed wakes, suppressions and running tasks on sleeping instances.
Investigate any nonzero model-runs-while-sleeping measurement.
Turning the flag off pauses delivery and leaves events, subscriptions, checkpoints and receipts intact.