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§
Functions§
- earlier
- The answers waiting for
calleras 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 withoutEarlier::present(a call that failed early), they wait again. - submit
- Queue
jobforcaller(e.g.ctx_agent:<agent id>). Its line, if any, is shown with the caller’s next answer. - submit_
once submit, unless a job withkeyis already queued or running (a cache refresh asked for twice is fetched once).falsewhen 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);
falsewhentimeoutpassed first. - with_
answers textwith the answers waiting forcallerin front of it.