Conversation
…s revoked A job that fails because the wallet paying for it has no credits comes back every hour and fails again, and nothing told the person: one prod project has 29 failed competitor scans reading 'insufficient balance'. The same is true of a revoked connection, which only a reconnect fixes. When a job ends on either, the project's owner gets one email saying what stopped and where to fix it. A conditional update takes the stamp before the send, so jobs failing together send one email; it repeats after three days if still so, and a reconnect clears it. A house-funded failure emails nobody. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Wallet-funded jobs that hit
insufficient balance(HTTP 402) fail, requeue, and fail again every hour with nobody told: boat has 29 failed competitor scans, idealista 15, Anantya 14. A revoked wallet connection (see #92) is the same shape and needs a reconnect only the user can do.What
src/lib/alerts/walletNotice.ts: reads the failure's cause chain for the SDK'sInsufficientBalanceErroror a 400/401TokenRequestError, and emails the project's owner what stopped and where to fix it.wallet_connections.balance_notice_at/reconnect_notice_at) is claimed by a conditional update before sending, handed back if the send fails, repeats after 3 days if still failing, and is cleared on reconnect.Testing
tests/walletNotice.test.tsagainst Postgres: two jobs failing together send one email; silent within the gap; sends again after it and after a reconnect; nothing for a house-funded user; a failed send can be retried. Typecheck and lint clean; only the existingtests/jobs.test.tstimeout fails.🤖 Generated with Claude Code