Skip to content

fix(extend): keep the cost limit unless asked; warn when it fires first (#1262) - #1281

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1262-extend-keeps-cost-limit
Oct 24, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1262-extend-keeps-cost-limit

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1262

Root cause

The issue blamed spored reload, but that never reaches the daemon (#1278). The real cause is spawn extend itself. Since #639, its default was to raise spawn:cost-limit to whatever the new deadline needed (decideCostLimit).

In #1262, each c8gn.48xlarge ($11.376/hr) had --ttl 2h --cost-limit 25 and was extended by 1h twice. That raised the cap to about $34, then about $46. The instances ran 152–158 min (about $29) and were terminated by hand before reaching the raised cap. This accounts for every timestamp in the report. extend did print Cost limit: $25 → $…, but that is easy to miss across 8 boxes.

The other suspect was a missing spawn:price-per-hour silently disabling enforcement. That is ruled out for this case: a Linux launch with --cost-limit and no known price is already refused at launch (resolvePricePerHour).

Change (owner decision: never raise, warn)

Gates

Checks run

  • go test -short ./...: pass.
  • make lint: clean in all 10 modules.
  • make gen-docs: regenerated docs-gen/extend.md.

No dependent repos call extend's cost-limit flags. I checked spore-host-mcp and the adapters.

@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/extend.go 72.72% 3 Missing ⚠️
cmd/extend_cost_limit.go 90.90% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 47b877b into main Oct 24, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1262-extend-keeps-cost-limit branch October 24, 2026 01:37
@scttfrdmn scttfrdmn mentioned this pull request Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--cost-limit did not fire: on-demand c8gn.48xlarge with --cost-limit 25 ran ~$29 (after spawn extend + spored reload)

1 participant