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

On a new forge the first change lands: a green pull is not left waiting behind a paused run, a review loop or credit that reads spent at $0.48 of $2 #11542

Parked opened this in answer to
Closed without merging

This pull fixes the slot and pause causes and adds the Land it as it is button, but it does not finish the issue. The first-change landing rule, the end-to-end acceptance test and the production probe are not done, so do not close #11541 on this pull. A paused run no longer holds the builder's only slot.

Notes

stopped parked by the crew deploy 647f992

opened this

This pull fixes the slot and pause causes and adds the Land it as it is button, but it does not finish the issue. The first-change landing rule, the end-to-end acceptance test and the production probe are not done, so do not close #11541 on this pull.

What changed

  • A paused run no longer holds the builder's only slot. slottedRuns in src/crew/autonomy.ts counted a queued run waiting on a future notBefore as occupying a slot. That is why the pull sat on "waits for a builder slot" behind runs paused until 00:52. A run paused until later is now waiting, not working, so requested changes can reach the builder at once. The dispatcher's own slot count was already right.
  • The pause line says why. run paused in dispatch.ts now carries why= (for example paused: the 5-hour window is full until 07:20 UTC; resumes 07:21 UTC) beside until=.
  • Spent credit is not a pause. isRateLimited treated every api_error as a provider limit, including the model door's 402 billing_error. That made a spent-credit refusal wait the default 15 minutes, which is the 17 minutes in your log. isCreditSpent in limits.ts now ends the run at once, recorded as failed, with CREDIT_SPENT_WORDS.
  • Land it as it is. src/web/studio/cannot_finish.ts adds a card on an open, green pull when the crew's last run on it ended on spent credit, or the lent credit is gone. It says so plainly and offers Land it as it is (posting to the existing /ship route) or Add a key, for admins. It is wired into change.ts.
  • One credit figure, partly. A forge on lent credit now asks its host for the count after every run (refreshFunding in runner.ts), so the home page reads what the run just moved. Before, it kept the figure from the last heartbeat, which is how "Spent $0.00" sat beside a pull that had spent $0.48.

Tests are in test/credit-spent-not-paused.test.ts. tsc, scripts/gate.ts and design-lint are clean, and 81 tests across 8 related files pass (autonomy, crew-limits, crew-pause, crew-key, studio-changes, pull-page-phases, seat-slots, gate-last-slot). I did not run the whole suite; the diff was too broad for fast.ts to name tests.

Not done

  • The credit figure on the app page and the pull page. I could not find where the app page's "$0.75" comes from, so I have not checked that it now matches the other pages. The $0.48 → "spent" jump on the forge's home is also unexplained; the model door only refuses once spend reaches the cap.
  • The first-change landing rule. I made no change so that a green pull the reviewer did not reject for a defect lands on a forge's first asks. Landing stays with a person, via the button.
  • No test where the credit runs out mid-way. The Land it button is unit-wired but never pressed in a test.
  • No stranger-journey test. The real-cell run with a stub model and $2 credit does not exist yet.
  • No production probe. I have not run it, so there are no log lines to paste.

Try: open a green pull on a forge whose included credit is spent. The pull page shows "The crew's credit is spent…" with Land it as it is.

🤖 Generated with Claude Code

Closes #11541

3 earlier comments
commented

This pull fixes the slot and pause causes and adds the Land it as it is button, but it does not finish the issue. The first-change landing rule, the end-to-end acceptance test and the production probe are not done, so do not close #11541 on this pull.

What changed

  • A paused run no longer holds the builder's only slot. slottedRuns in src/crew/autonomy.ts counted a queued run waiting on a future notBefore as occupying a slot. That is why the pull sat on "waits for a builder slot" behind runs paused until 00:52. A run paused until later is now waiting, not working, so requested changes can reach the builder at once. The dispatcher's own slot count was already right.
  • The pause line says why. run paused in dispatch.ts now carries why= (for example paused: the 5-hour window is full until 07:20 UTC; resumes 07:21 UTC) beside until=.
  • Spent credit is not a pause. isRateLimited treated every api_error as a provider limit, including the model door's 402 billing_error. That made a spent-credit refusal wait the default 15 minutes, which is the 17 minutes in your log. isCreditSpent in limits.ts now ends the run at once, recorded as failed, with CREDIT_SPENT_WORDS.
  • Land it as it is. src/web/studio/cannot_finish.ts adds a card on an open, green pull when the crew's last run on it ended on spent credit, or the lent credit is gone. It says so plainly and offers Land it as it is (posting to the existing /ship route) or Add a key, for admins. It is wired into change.ts.
  • One credit figure, partly. A forge on lent credit now asks its host for the count after every run (refreshFunding in runner.ts), so the home page reads what the run just moved. Before, it kept the figure from the last heartbeat, which is how "Spent $0.00" sat beside a pull that had spent $0.48.

Tests are in test/credit-spent-not-paused.test.ts. tsc, scripts/gate.ts and design-lint are clean, and 81 tests across 8 related files pass (autonomy, crew-limits, crew-pause, crew-key, studio-changes, pull-page-phases, seat-slots, gate-last-slot). I did not run the whole suite; the diff was too broad for fast.ts to name tests.

Not done

  • The credit figure on the app page and the pull page. I could not find where the app page's "$0.75" comes from, so I have not checked that it now matches the other pages. The $0.48 → "spent" jump on the forge's home is also unexplained; the model door only refuses once spend reaches the cap.
  • The first-change landing rule. I made no change so that a green pull the reviewer did not reject for a defect lands on a forge's first asks. Landing stays with a person, via the button.
  • No test where the credit runs out mid-way. The Land it button is unit-wired but never pressed in a test.
  • No stranger-journey test. The real-cell run with a stub model and $2 credit does not exist yet.
  • No production probe. I have not run it, so there are no log lines to paste.

Try: open a green pull on a forge whose included credit is spent. The pull page shows "The crew's credit is spent…" with Land it as it is.

🤖 Generated with Claude Code

commented

This pull now stops the crew plainly when its credit is spent, and it offers "Land it as it is" on the pull instead of pausing the run.

  • Run behaviour: a spent-credit failure (the model door's 402, "credit balance is too low", "from its parent is spent") is no longer counted as a rate limit. The run ends with a plain line saying the crew's credit is spent, so it holds no builder slot and nothing pauses to wait.
  • Pull page: on an open pull whose check is green, a card says the crew's credit is spent and offers "Land it as it is". An admin also gets an "Add a key" link; anyone else is told the admin can add one. The card is src/web/studio/cannot_finish.ts, shown from src/web/studio/change.ts.
  • Check fix in this push: every GET page is within its counted work failed because the pull page went from 110 to 111 SQL statements. The new card reads the pull's latest run. I raised that page's budget by one in test/pages-budget.test.ts, with a comment saying why. I did not remove the read, because it is how the card knows the last run failed for credit.
  • Scaffold test: a scaffolded app signs a person in through the forge passed when I ran test/scaffold.test.ts alone. The check log said it failed only beside other tests, and I made no change to it, so I treated it as a flake. If it fails again, it needs its own look.

The final bun test on test/pages-budget.test.ts and test/credit-spent-not-paused.test.ts, tsc --noEmit and scripts/gate.ts were clean before the push.

To try it: open a green pull whose crew run failed with the spent-credit words and look for "Land it as it is" below the check line.

commented

I changed no code this time. The check was stopped for using too much CPU (17.7 cores against a limit of 16), and none of the tests in the log failed. The log shows a browser inside the check trying to reach Google and DuckDuckGo hosts that forge.json doesn't allow. I found nothing in my change that would cause that load.

I pushed an empty commit (647f99286) so the forge runs the check again. If it stops for CPU again, the cause is how the check machine is loaded or how the shards are split, not this pull.

The pull is otherwise unchanged:

  • Credit spent: a run that meets spent credit now ends plainly with "the crew's credit is spent; land the pull as it is, or add a model key to go on", and no longer counts as a rate-limit pause.
  • Pull page: an open, green pull gets a "Land it as it is" card. An admin also gets an "Add a key" link.
  • Statement budget: the pull page's budget in test/pages-budget.test.ts is raised from 110 to 111, because the card reads the last run.

To try it, open a green pull whose crew run failed with the spent-credit words and look for the card under the check line.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs