Skip to content

fix(capacity): recognise Prospeo's INSUFFICIENT_CREDITS as an empty account - #967

Merged
stonexer merged 1 commit into
mainfrom
fix/prospeo-credit-signature
Oct 13, 2026
Merged

stonexer merged 1 commit into
mainfrom
fix/prospeo-credit-signature

Conversation

@stonexer

@stonexer stonexer commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Add a balance signature for Prospeo: 400 with "error_code": "INSUFFICIENT_CREDITS".
  • Remove Prospeo from the acknowledged-unrecorded exhaustion set.

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:

  • treg kept relaying the 400s to callers;
  • no lock was taken, so nothing stopped the next call;
  • a routed find read the 400 as a caller error and stopped, instead of moving to the next provider.

With the signature, an empty account takes the ordinary path:

  • it is locked;
  • callers get the typed 503;
  • a routed find moves on to the next provider.

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).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:36:13.975206Z afe2133 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the area:docs Documentation & design fragments label Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.
@stonexer
stonexer force-pushed the fix/prospeo-credit-signature branch from afe2133 to f1be169 Compare October 13, 2026 15:37
@stonexer
stonexer merged commit 2cf4dfb into main Oct 13, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation & design fragments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant