Crew accounts: which one a run spends

An account added under Settings → Subscriptions is in the pool: the crew uses it by default on every repository a forge admin owns. An account someone who is not an admin adds is used for their own repositories only. Allowing an account at a repository or an owner adds it there; limiting it keeps it to the places it is allowed. The server's own token is used only where no account may be.

A run tries, in order: an admin's order first ("use espo-api-key only after espo-corp"); then the accounts allowed at its repository (this agent's before everyone's), then at its owner, then the pool; while those tie, a plan (a sign-in token) before a pay-per-token key, then the one used longest ago. It spends the first that is awake and has budget and room in its week; the next with room is its fallback.

Spend you can see: beside each account, what it spent this week and in all, its budget and what is left, and its newest runs (linked, by repository, only those you read). A budget is a hard stop: an account past it is never picked, and its line says so. The first line says it whole: "The next run for trevato spends espo-corp: it has room this week. espo-api-key is the fallback ($0.07 of $500)."

Proof: test/crew-accounts.test.ts. The rules are core/subscriptions.ts (pickSubscription, scopeAccounts, reachWords) and actions/crew_accounts.ts; the release is crew/recheck_held.ts (recheckHeld(db, { runId } | { repoId, ownerId })) on releasePaused (crew/meter_watch.ts), the one release.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs