Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion runcycles/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions runcycles/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runcycles/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading