From 7ee6b7605792e7c265abe4ae95b670118b9dba10 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 14:37:58 +0000 Subject: [PATCH] chore: update default overage policy to ALLOW_IF_AVAILABLE per protocol v0.1.24 https://claude.ai/code/session_01Vzg6nWZUwXaLWEHd2i59mT --- README.md | 4 ++-- runcycles/_constants.py | 2 +- runcycles/decorator.py | 4 ++-- runcycles/lifecycle.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index edbe5c0..5402786 100644 --- a/README.md +++ b/README.md @@ -312,8 +312,8 @@ Control what happens when actual usage exceeds the estimate at commit time: ```python from runcycles import CommitOveragePolicy -# REJECT (default) — commit fails if budget is insufficient for the overage -# ALLOW_IF_AVAILABLE — commit succeeds if remaining budget covers the overage +# REJECT — commit fails if budget is insufficient for the overage +# ALLOW_IF_AVAILABLE (default) — commit succeeds if remaining budget covers the overage # ALLOW_WITH_OVERDRAFT — commit always succeeds, may create debt @cycles(estimate=1000, overage_policy="ALLOW_WITH_OVERDRAFT", client=client) diff --git a/runcycles/_constants.py b/runcycles/_constants.py index 156b891..bae629b 100644 --- a/runcycles/_constants.py +++ b/runcycles/_constants.py @@ -8,7 +8,7 @@ DEFAULT_READ_TIMEOUT = 5.0 DEFAULT_TTL_MS = 60_000 DEFAULT_GRACE_PERIOD_MS = 5_000 -DEFAULT_OVERAGE_POLICY = "REJECT" +DEFAULT_OVERAGE_POLICY = "ALLOW_IF_AVAILABLE" DEFAULT_UNIT = "USD_MICROCENTS" RESERVATIONS_PATH = "/v1/reservations" diff --git a/runcycles/decorator.py b/runcycles/decorator.py index 0581673..b4751bb 100644 --- a/runcycles/decorator.py +++ b/runcycles/decorator.py @@ -62,7 +62,7 @@ def cycles( unit: Unit | str = Unit.USD_MICROCENTS, ttl_ms: int = 60_000, grace_period_ms: int | None = None, - overage_policy: str = "REJECT", + overage_policy: str = "ALLOW_IF_AVAILABLE", dry_run: bool = False, tenant: str | None = None, workspace: str | None = None, @@ -87,7 +87,7 @@ def cycles( unit: Cost unit. Default: USD_MICROCENTS. ttl_ms: Reservation TTL in milliseconds. Default: 60000. grace_period_ms: Grace period after TTL expiry in milliseconds. - overage_policy: REJECT, ALLOW_IF_AVAILABLE, or ALLOW_WITH_OVERDRAFT. + overage_policy: REJECT, ALLOW_IF_AVAILABLE (default), or ALLOW_WITH_OVERDRAFT. dry_run: If True, evaluate without persisting (method won't execute). tenant: Subject tenant override. workspace: Subject workspace override. diff --git a/runcycles/lifecycle.py b/runcycles/lifecycle.py index 5323aa9..26b0f98 100644 --- a/runcycles/lifecycle.py +++ b/runcycles/lifecycle.py @@ -53,7 +53,7 @@ class DecoratorConfig: unit: str = "USD_MICROCENTS" ttl_ms: int = 60_000 grace_period_ms: int | None = None - overage_policy: str = "REJECT" + overage_policy: str = "ALLOW_IF_AVAILABLE" dry_run: bool = False tenant: str | None = None workspace: str | None = None