Skip to main content

Module background

Module background 

Source
Expand description

Cloud requests a tool call hands off (connector rule “Cloud never blocks a tool call”).

A tool call that needs Cloud (ctx_tasks, the Cloud side of a ctx_agent lease) checks what it can locally, queues the request here with submit and answers at once that it is pending. One low-priority thread per process runs the queue in order, so a later request of the same caller (a lease release after its acquire, an update after a claim) always goes out after the earlier one. What Cloud answered is kept per caller and put in front of that caller’s next answer of the same tool (earlier); nothing is presented as confirmed before Cloud confirmed it.

The queue lives in this process: requests of a process that ends before they ran are never sent, and the agent’s session ended with it.

Structs§

Earlier
See earlier.

Functions§

earlier
The answers waiting for caller as a call starts, taken before the call queues anything: an answer to this call’s own request, however fast Cloud answers it, always comes with the next call (CI #2183). Dropped without Earlier::present (a call that failed early), they wait again.
submit
Queue job for caller (e.g. ctx_agent:<agent id>). Its line, if any, is shown with the caller’s next answer.
submit_once
submit, unless a job with key is already queued or running (a cache refresh asked for twice is fetched once). false when skipped.
take
The answers waiting for caller, taken (shown once).
wait_idle
Wait until every queued request has run (tests and CLI commands that end the process); false when timeout passed first.
with_answers
text with the answers waiting for caller in front of it.