feat: log "Check Price" as a job so the /price endpoints are testable - #22
Open
dawidope wants to merge 1 commit into
Open
feat: log "Check Price" as a job so the /price endpoints are testable#22dawidope wants to merge 1 commit into
dawidope wants to merge 1 commit into
Conversation
A price check was a throwaway pre-calculation: the proxy called the endpoint's /price path and deliberately skipped every history write, so there was no way to inspect the request/response it produced. Price checks are now persisted like any other request, flagged with `isPriceCheck`: - the job stores the /price path, the raw request/response and the response headers, so the Raw panel exercises the endpoint; - a 422 lands as a failed job with the API's validation message; - the quote is recorded as the job's price and rendered blue with a "nothing was charged" tooltip, so it never reads as a real charge; - with the inline boost on, the separately quoted boost fee shows as the usual +$ badge; - uploads are persisted for price checks too, and getEndpointByApiPath maps a /price path back to the endpoint it priced, so Duplicate reloads the same form with its files. The jobs list also refreshes after a failed check, not just a successful one. Co-Authored-By: Claude Opus 5 (1M context) <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
A price check was a throwaway pre-calculation. The proxy called the endpoint's
/pricepath and deliberately skipped every history write, so there was no way to see the request it built, the response the API returned, or a validation error it hit — the/priceendpoints were the one part of the API the tester could not actually test.What changed
Price checks are now persisted like any other request, flagged with
isPriceCheck./pricepath (e.g.images/generations/price) plus the raw request, raw response and response headers — so the row's Raw panel exercises the endpoint the same way a generation row does.failedjob carrying the API's validation message (The model field is required. (and 3 more errors)), instead of vanishing.+$…badge (the/priceendpoints don't include it, so it is still quoted on the side).getEndpointByApiPathnow maps a/pricepath back to the endpoint it priced, and uploads are persisted for price checks too, so the form reloads with its files. (The four transcription variants share one price path, so those resolve to the first of them.)A price check never enters the polling path — it has no
request_id, and the async branch is now explicitly skipped for it.Verified against the live API (dev profile)
txt2img)completed,finalPrice 0.00128984model→ 422failed,"The model field is required. (and 3 more errors)"enhance_promptcompleted, breakdown{base: 0.00128984, boost: 0.010284}/prompts/enhancements/price, top-level{price})completed,finalPrice 0.010284npm run lint,npx tsc --noEmitandnpm run buildare clean. Test history was cleared afterwards.Not covered
🤖 Generated with Claude Code