Expand description
Worker mode (Cloud plan v3 L1, owner decision O1): the person’s own agent pulls tasks through MCP; the engine never starts an agent by itself.
Every claim and every result passes this gate first:
- The engine’s opt-in lives on the server (
GET /v1/me/optin): which vaults its agents may work on, whether it is active, and the daily budget. It is read fresh for every claim; when it cannot be read, nothing is claimed (fail closed). - The daily budget has three limits and the first one reached stops the work: tasks per day (checked before a claim), and optionally tokens and USD per day (counted from the usage each result reports; the result that crosses a limit still goes through, the next claim does not).
[cloud.worker]may only tighten these limits on this machine, never widen them.cloud worker pausestops claiming here untilresume, and held claims are no longer renewed (they end at their expiry);cloud worker stopalso switches the opt-in off on the server, which ends every claim of this engine at once. Only the owner turns it on again, on the web.
Cloud enforces the same rules (C0 1.9 section 4: 403 optin_scope /
vetoed, 409 optin_inactive / optin_changed, 429 daily_budget);
this gate makes a refusal local and content-free instead of a request
that would leak which task was attempted.
Structs§
- Admission
- An admitted claim: the opt-in it works under and what is left after it.
- Budget
Left - What is left of today’s budget;
Noneis no limit. - Cloud
Worker Config [cloud.worker]: stricter local caps on top of the server’s budget.- Evidence
Summary - What a result reports it cost, for today’s budget.
- Task
Scope - The task a claim or result is for.
- Usage
- What a day has used on this machine.
- Worker
State - The local worker state: pause flag and what this machine used today.
Enums§
- Limit
- The limit a budget refusal hit.
- Refusal
- Why the gate refused; its text never names the task or its content.
Constants§
- OPTIN_
PATH - The engine’s own opt-in record (engine auth, own instance only).
- PROVIDER_
TERMS_ NOTE - The provider-terms note every worker opt-in shows (plan X1; the web opt-in form carries the same text). LeanCTX never handles subscription credentials: the agent is one the person started and signed in to.
Functions§
- admit_
claim - Admit a claim: whether this machine may ask Cloud for it. Nothing is
counted yet;
count_claimcounts it once Cloud granted it, so a claim Cloud refuses costs no task of today’s budget. - admit_
claim_ for admit_claimon an opt-in the caller just read.- admit_
submit - Add the usage a result reports to today’s.
- count_
claim - Count a claim Cloud granted (or a verification commit it took) against today’s tasks on this machine. A refused claim is never counted: it used to be, and refusals then ate the local budget until this machine refused on its own.
- decide_
claim - The claim decision on a read opt-in and the local state (no I/O).
- fetch_
optin - The server’s opt-in for this engine.
- fetch_
optin_ via - The opt-in through
client(a bounded client of a tool call). - read_
state - The local state as stored (today’s counters reset on a new day). Fail
closed: a file that cannot be read or parsed counts as paused, and so
does a missing one on an engine enrolled with Cloud — deleting it never
lifts a pause or resets today’s counts. Only enrollment
(
prepare_enrollment) andcloud worker resume, both of which the person runs (an agent shell refuses them), write it unpaused. - set_
paused - Stop or resume claiming on this machine.
- stop
- Stop worker mode for this engine: pause here and switch the opt-in off on the server, which ends every claim of this engine at once.
Type Aliases§
- Optin
- The engine’s opt-in (C0 1.9 section 4).