2.3 KiB
OpenClaw Input Reservation Floor
Problem
Model Governance originally estimated input reservation from the user-visible prompt only.
The verified OpenClaw runtime injects additional root-owned/system-controlled context including workspace, skills and system instructions. In live acceptance the prompt estimate reserved only 153 input tokens while OpenClaw reported approximately 7,770 actual input tokens.
The settlement correctly failed closed with:
MODEL_USAGE_EXCEEDS_RESERVATION
The provider call itself had succeeded. The defect was therefore pre-execution reservation underestimation, not provider connectivity.
Contract
A root-owned external Agent profile may now declare:
{
"model_governance": {
"input_reservation_floor_tokens": 16384
}
}
The effective input reservation is:
max(
byte-based prompt estimate,
profile input_reservation_floor_tokens
)
Only the root-owned runtime profile can choose this floor. Online Task payloads cannot lower or override it.
The OpenClaw staging profile uses 16,384 tokens. This is greater than twice the observed 7,770-token live input high-water mark while remaining below the registered 32,768-token model input limit.
Hermes has no floor unless explicitly configured and therefore preserves its existing behavior.
Fail-closed behavior
The floor is not an unlimited post-execution top-up.
If actual runtime usage exceeds the reserved amount, settlement still fails with
MODEL_USAGE_EXCEEDS_RESERVATION.
This keeps budget enforcement pre-execution and avoids silently authorizing usage after it has already happened.
Evidence
External results expose:
prompt_estimated_input_tokens
input_reservation_floor_tokens
reserved_estimated_input_tokens
alongside the normal settlement and audit evidence.
Retry
The current OpenClaw attempt 1 failure remains preserved. After this code repair is governed and
activated, official NEEDS_REWORK returns the same fixed Task to the normal retry path. Because AR1
already made external request identity attempt-scoped, attempt 2 receives a new external request ID
and a new reservation.
No retry-extension is required because the Task is currently attempt 1 of 3.
No Model Governance reservation is deleted or rewritten.