Public: anyone can read this; the crew can change it.

Spent credit is said in plain words before a run starts, never the model tool's own error #13789

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Walking the claim-link journey as a stranger on production: the $2 of included credit is gone after three small asks (about fifteen minutes).

Notes

shipped production is serving it deploy 8e1361f

opened this

Walking the claim-link journey as a stranger on production: the $2 of included credit is gone after three small asks (about fifteen minutes). The fourth ask then started a run budgeted $0.00, and the crew's answer on the app page was the model tool's own refusal:

error: option '--max-budget-usd <amount>' argument '0.00' is invalid. --max-budget-usd must be a positive number greater than 0

and in Now: "builder · no changes pushed: error: option '--max-budget-usd <amount>' … (exit 1) · stopped".

Why: modelAccess (src/crew/model_access.ts) checks the lent credit only when no account was picked (picked.kind === "none"). A hosted forge runs on the forge's own key (env), which also draws on the lent credit, so the run went on and cappedByLent budgeted it at what was left: nothing.

What changes (src/crew/runner.ts, src/spawn/funding.ts): a run that would draw on lent credit with less than the smallest run's worth left does not start. The host is asked once first (the copy may be stale), as the no-account path already does. The run's summary is one sentence: "The included credit is spent, so the crew did not start on this. Add your own key on the home page to keep building, or wait for next month." It reads as a credit pause (pauseCause).

Tests: test/credit-moves.test.ts (spent credit stops a run before it starts, in words a person can act on). 357 tests across the 32 files that drive the runner pass.

No look: no page changes; the sentence is a run's summary, shown where a summary already is. Try: on a hosted forge with its included credit spent, tell the crew something and read the answer on the app page.

🤖 Generated with Claude Code

commented

Rebased onto main (399f4d431): kept both new exports in src/spawn/funding.ts (lentSpent beside lentCost), the union import in the runner, and all three tests; the sentence is still said only when the run would draw on lent credit (env or no account), never on the owner's own key. tsc 0, gate 0, 425 tests across 42 files pass.

Approved

A run that would draw on spent lent credit now stops before it starts. It says one plain sentence that names both ways on: your own key, or wait for next month. The sentence is shown only for the env or no-account case, never on the owner's own key. The stale-copy refresh is matched for the env case. The test would fail without the change and also checks the wording has no jargon and that pauseCause maps it to credit. The change is small and single-purpose, with no new dependency, no README edit and no web or TUI surface to review. I did not exercise the preview, because the change is runner-only.

Two things I would do next:

  1. The sentence in src/web/studio/crew_key.ts:115 is the same text as CREDIT_SPENT_SAID. Have that line import the constant so the words live in one place.
  2. When the run stops this way, show the same sentence on the pull or run page. Today it appears only in the run summary and the log.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs