Skip to content

Add agent sleeping#214

Draft
CaelumF wants to merge 2 commits into
masterfrom
feat/sleep
Draft

Add agent sleeping#214
CaelumF wants to merge 2 commits into
masterfrom
feat/sleep

Conversation

@CaelumF

@CaelumF CaelumF commented Dec 6, 2025

Copy link
Copy Markdown
Collaborator

Context from message I sent in discussion in our community discord:

Since this relates to token savings, scaling and noise reduction, and the interface seems relatively stable it is a core functionality rather than a plugin.

With sleeping, agent instances will have a sleep state in the coral server, which is a changeable boolean.

A REST interface, looking something like GET, PUT, POST (for custom tools) /sessions///sleeping will expose that sleeping state.

Agents in the graph will have added "sleep events" and "wake events" fields, which will be lists of events that cause the agent to be set to sleep or set to not sleep.

available wake events:

  • added to any thread
  • added to a thread the first time
  • mentioned

available sleep events:

  • removed from last thread
  • last thread closed
  • agent started

Agents start out not sleeping, unless they have the agent started sleep event.

When an agent's state is sleeping, any MCP call (including MCP resource GET, which should happen before every LLM request in supporting agents), or proxied LLM request will hang until the agent is awoken.


A common pattern would be to have all agents apart from 1 or a few starting agents in the graph set to sleep on agent started, and to awake when included in a thread, this would be well suited for search or chat applications,

Since there is a REST interface for sleeping agents, more advanced sleeping behaviour can be implemented by applications, and tools could be used to let agents to intentionally put themselves or others to sleep or awake.

In general this should help to make applications much more LLM token efficient

@CaelumF CaelumF requested review from alanpq and seafraf December 6, 2025 06:52
@alanpq alanpq force-pushed the master branch 7 times, most recently from 2128416 to e8a3115 Compare March 10, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant