Skip to content

fix: point sandbox environment to the single API host#12

Merged
DealerMax merged 1 commit into
mainfrom
claude/sdk-audit-partners-a3IRi
May 26, 2026
Merged

fix: point sandbox environment to the single API host#12
DealerMax merged 1 commit into
mainfrom
claude/sdk-audit-partners-a3IRi

Conversation

@DealerMax

Copy link
Copy Markdown
Contributor

Audit severo dell'SDK — esito

Audit completo dell'SDK Python partnermax v0.10.0 in vista della proposta a nuovi Partner. Sintesi: l'SDK è solido e allineato allo spec, con un bug critico di onboarding corretto in questa PR.

Verifiche superate

Check Esito
import partnermax OK (v0.10.0)
ruff (lint) All checks passed
pyright (strict) 0 errori
mypy (strict) 0 errori su 74 file
pytest (unit) 474 passati
pytest endpoint vs mock server Prism 455/455 passati — metodi, parametri e modelli di risposta allineati allo spec OpenAPI
uv build (wheel + sdist) OK, artefatti versionati corretti
Superficie export pubblica 17/17 simboli presenti
Coerenza versioni (_version.py / pyproject / manifest / CHANGELOG) tutte 0.10.0
Raggiungibilità produzione end-to-end host live, errori HTTP mappati correttamente (403 → PermissionDeniedError)

I 21 endpoint dell'SDK coincidono 1:1 con i 21 path dello spec; gli schemi di sicurezza (X-Api-Key + Bearer) corrispondono.

Bug critico corretto

Lo spec OpenAPI dichiara esplicitamente un host unico con routing deciso dal prefisso della key:

"Single host for both production and sandbox. Routing is decided by the API key prefix: pmk_live_* targets production, pmk_sand_* targets sandbox."

L'SDK invece puntava l'environment sandbox a https://sandbox.developers.dealermax.app, che non risolve (NXDOMAIN). Qualunque Partner usasse environment="sandbox" — incluso il primo esempio del README — otteneva un APIConnectionError irreversibile (Name or service not known). Riprodotto e verificato.

Fix: sandbox ora punta allo stesso host https://developers.dealermax.app, lasciando che sia il prefisso della key a instradare, come previsto dal contratto. Verificato: dopo la fix environment="sandbox" raggiunge l'host reale e riceve risposte HTTP strutturate.

Incluso anche l'allineamento della self-version stale in uv.lock (0.0.10.10.0).

⚠️ Importante (file generato): _client.py è generato da Stainless e l'elenco ENVIRONMENTS proviene dalla config Stainless, non dallo spec. Per evitare che una rigenerazione reintroduca l'host sandbox errato, la stessa correzione va applicata nella config Stainless (impostare l'environment sandbox sullo stesso host, o rimuovere il concetto di environment dato che il routing è per prefisso key).

Osservazioni minori (non bloccanti)

  • examples/ contiene solo .keep — il README ha però esempi inline completi (sync, async, aiohttp, upload file, gestione errori, retry, timeout).
  • CHANGELOG: le release 0.8.0/0.9.0/0.10.0 riportano la stessa feature line (artefatto di release-please), puramente cosmetico.

Test plan

  • ruff / pyright / mypy puliti
  • 474 unit test + 455 endpoint test (vs Prism) verdi
  • environment="sandbox" raggiunge l'host dopo la fix
  • build wheel/sdist OK

https://claude.ai/code/session_016dVWauAWAvgrctxxjCQLVV


Generated by Claude Code

The OpenAPI spec defines a single host (https://developers.dealermax.app)
for both production and sandbox, with traffic routed by the API key prefix
(pmk_live_* vs pmk_sand_*). The SDK's `sandbox` environment instead targeted
https://sandbox.developers.dealermax.app, which does not resolve (NXDOMAIN),
so any partner using `environment="sandbox"` — including the first example in
the README — hit an unrecoverable APIConnectionError.

Point sandbox at the same host so the key prefix performs the routing, as the
contract intends. Also refresh the stale self-version in uv.lock (0.0.1 -> 0.10.0).

https://claude.ai/code/session_016dVWauAWAvgrctxxjCQLVV
@DealerMax
DealerMax merged commit bc92bbc into main May 26, 2026
7 checks passed
@stainless-app stainless-app Bot mentioned this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants