Repository navigation
feat(catalog): add free LeadOcean tools and routing - #1410
Merged
Merged
Conversation
shehjad-dev
force-pushed
the
codex/leadocean-integration
branch
from
November 3, 2026 15:25
0744b0b to
a08de25
Compare
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.
What changed
verifiedfalls through the waterfall. Personal email has a fixture-verified direct adapter but stays out of routing because the v2 response does not provide a comparable deliverability status. Reverse lookup, counts, and company roster remain direct tools because their result or filter contract does not fit an existingtreg.*route./call/surface continues to relay LeadOcean's body and status unchanged.Pricing calculation
LeadOcean's public pricing describes account-based access; the API reports record use rather than a per-request USD amount. The treg customer price for each of the 11 tools is $0.00:
0 USD/call × calls = 0 USD, including records returned by search and successful enrichments. BYOK uses the team's own key and remains unmetered by treg. Upstream record use is monitored separately through the free usage route. This pricing deliberately needs no credit-to-USD conversion.Live upstream evidence
The probes used the configured key without recording it or response PII.
GET /v1/accountaccepted the real key and rejected a bogus key with HTTP 401. Search and enrichment calls returned in roughly 0.25-1.4 seconds in these probes. Immediate usage reads sometimes lagged, so v2 charge observations rely on later isolated account-counter changes; v2 itself does not return a per-call credit field.people.enrichmeta.credits=1on hit; no counter increase on misscompanies.enrichmeta.credits=1on hit; no counter increase on misspeople.searchmeta.credits=1/0companies.searchmeta.credits=1/0people.search.countmeta.credits=0on bothcompanies.countmeta.credits=0on bothpeople.email.find.workdata:null; nonexistent profile miss showed no usepeople.email.find.personaldata:[]; nonexistent profile miss showed no usepeople.phone.findpeople.reversemeta.credits=1on matches; email miss used no record. Phone miss was not separately probedcompanies.peopleNo false reports or purchases were submitted.
Routed-call evidence
Live calls went through the local treg server with the shared key,
X-Treg-Route-Prefer: leadocean, andX-Treg-Route-Waterfall: 0. Every row below reportedcharged_micro=0by treg.treg.people.email.findleadocean.people.email.find.worktreg.people.phone.findleadocean.people.phone.findtreg.people.enrichleadocean.people.enrichmeta.credits=1treg.companies.enrichleadocean.companies.enrichmeta.credits=1treg.people.searchleadocean.people.searchmeta.credits=1treg.companies.searchleadocean.companies.searchmeta.credits=1Checks and review notes
origin/mainafter sampling change: 7,412 passed, 164 skipped. Catalog, routing, marketplace, collector, and plugin checks: 1,048 passed, one skipped. Frontend: 135 unit tests and 53 end-to-end tests passed.Ocean; LeadOcean made that select a different provider. They now select the exactOcean.iocompany-enrichment row, preserving the BYOK action and Connections navigation checks. All 53 end-to-end tests and 135 frontend unit tests pass locally. The capacity signature guard explicitly records that an exhaustion error shape has not been observed; we did not force an exhausted account. A separate unrelated lease-timing test failed once under heavy parallel load, passed in isolation, and the four-worker full suite passed.Public code must land before the separate operational configuration PR. Neither PR deploys or merges anything.
Sampled provider routing
TREG_ROUTE_PROVIDER_SAMPLE_PCTis an optional JSON map of provider slug to integer percentage (0-100). If absent, empty, or{}, existing routing is unchanged. The setting gates only shared-key candidates in routed plans; direct calls, a team's own key, and unlisted vendors are unchanged. Each provider receives an independent, stable selection per org, capability, and canonical question, so retries do not redraw. This is an eligibility percentage, not a guarantee of served-call share or a hard direct-call quota. Invalid config fails settings validation.The companion private PR configures the hosted rollout. Remove that setting to restore the original public-PR routing behavior. The fixture-backed HTTP route test confirms 0% prevents routed selection, direct
/call/leadocean.*still works, and 100% serves the LeadOcean child at zero treg charge. The new unit tests cover empty config, stable and independent vendor decisions, own-key priority, and invalid percentages. After the change: 7,412 passed, 164 skipped in the full suite; Ruff, import contracts, catalog validator (0 errors), adapter fixtures, and wheel build passed. Existing live upstream and routed-call evidence above remains the evidence for endpoint behavior; the traffic gate was tested locally and has not been deployed.