Repository navigation
fix(capacity): recognise Prospeo's INSUFFICIENT_CREDITS as an empty account - #967
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afe2133dee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ("lusha", 400, r"reached your credit limit", "balance"), | ||
| # Prospeo answers every error 400 with an `error_code`; an empty account is INSUFFICIENT_CREDITS, | ||
| # documented on enrich and search and observed on treg's key when the plan ran dry. | ||
| ("prospeo", 400, r'"error_code"\s*:\s*"insufficient_credits"', "balance"), |
There was a problem hiding this comment.
Keep Prospeo's free endpoint outside the balance lock
When two paid Prospeo calls return this signature, classifying it as balance creates a provider-wide lock (marks.lock_key), and resolution applies that lock to every platform offer. This also refuses prospeo.search.suggestions for up to an hour even though that tool is explicitly free (src/treg/catalog/prospeo.yaml:247-292) and its documented errors do not include INSUFFICIENT_CREDITS. Scope the exhaustion handling to credit-consuming Prospeo endpoints, or exempt free platform tools from this provider-wide lock.
Useful? React with 👍 / 👎.
…ccount
Prospeo answers an empty account with 400 {"error_code": "INSUFFICIENT_CREDITS"} on every
endpoint. Without a signature the platform key kept relaying those 400s, and a routed find
stopped on them as a caller error instead of moving to the next provider. The row matches
the error code only: misses share the 400 status.
afe2133 to
f1be169
Compare
What
balancesignature for Prospeo:400with"error_code": "INSUFFICIENT_CREDITS".Why
Prospeo documents this response on its enrich and search endpoints (https://prospeo.io/api-docs/enrich-person, https://prospeo.io/api-docs/search-person). treg's platform key received it in production on three separate days when the plan ran dry; the counts are in the private runbook. Without the signature:
With the signature, an empty account takes the ordinary path:
This also lets a second treg account behind Prospeo be locked on its own.
The row matches the error code, never the 400 status alone: misses (
NO_MATCH,NO_RESULTS) share that status.Fragment:
ops/capacity.md(Prospeo).