Skip to content

Commit 766db46

Browse files
authored
Merge pull request #19 from runcycles/claude/review-protocol-updates-TBGQh
Change default overage policy from REJECT to ALLOW_IF_AVAILABLE
2 parents 449b3af + 7ee6b76 commit 766db46

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ Control what happens when actual usage exceeds the estimate at commit time:
312312
```python
313313
from runcycles import CommitOveragePolicy
314314
315-
# REJECT (default) — commit fails if budget is insufficient for the overage
316-
# ALLOW_IF_AVAILABLE — commit succeeds if remaining budget covers the overage
315+
# REJECT — commit fails if budget is insufficient for the overage
316+
# ALLOW_IF_AVAILABLE (default) — commit succeeds if remaining budget covers the overage
317317
# ALLOW_WITH_OVERDRAFT — commit always succeeds, may create debt
318318
319319
@cycles(estimate=1000, overage_policy="ALLOW_WITH_OVERDRAFT", client=client)

runcycles/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
DEFAULT_READ_TIMEOUT = 5.0
99
DEFAULT_TTL_MS = 60_000
1010
DEFAULT_GRACE_PERIOD_MS = 5_000
11-
DEFAULT_OVERAGE_POLICY = "REJECT"
11+
DEFAULT_OVERAGE_POLICY = "ALLOW_IF_AVAILABLE"
1212
DEFAULT_UNIT = "USD_MICROCENTS"
1313

1414
RESERVATIONS_PATH = "/v1/reservations"

runcycles/decorator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def cycles(
6262
unit: Unit | str = Unit.USD_MICROCENTS,
6363
ttl_ms: int = 60_000,
6464
grace_period_ms: int | None = None,
65-
overage_policy: str = "REJECT",
65+
overage_policy: str = "ALLOW_IF_AVAILABLE",
6666
dry_run: bool = False,
6767
tenant: str | None = None,
6868
workspace: str | None = None,
@@ -87,7 +87,7 @@ def cycles(
8787
unit: Cost unit. Default: USD_MICROCENTS.
8888
ttl_ms: Reservation TTL in milliseconds. Default: 60000.
8989
grace_period_ms: Grace period after TTL expiry in milliseconds.
90-
overage_policy: REJECT, ALLOW_IF_AVAILABLE, or ALLOW_WITH_OVERDRAFT.
90+
overage_policy: REJECT, ALLOW_IF_AVAILABLE (default), or ALLOW_WITH_OVERDRAFT.
9191
dry_run: If True, evaluate without persisting (method won't execute).
9292
tenant: Subject tenant override.
9393
workspace: Subject workspace override.

runcycles/lifecycle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class DecoratorConfig:
5353
unit: str = "USD_MICROCENTS"
5454
ttl_ms: int = 60_000
5555
grace_period_ms: int | None = None
56-
overage_policy: str = "REJECT"
56+
overage_policy: str = "ALLOW_IF_AVAILABLE"
5757
dry_run: bool = False
5858
tenant: str | None = None
5959
workspace: str | None = None

0 commit comments

Comments
 (0)