fix(v4): lowercase proxyCountryCode in Browsers.create() and Runs.create() browserSettings

Aperta
#371 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #372 di @codeXsidd — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Read src/v4/resources/browsers.ts and src/v4/resources/runs.ts, then compare the lowercase handling in src/v2/resources/browsers.ts and src/v3/resources/sessions.ts. Check the relevant tests for both Browsers.create() and Runs.create(); done means uppercase proxyCountryCode values are sent lowercase in both requests. A pull request is already open for this issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The v2 and v3 SDK layers consistently normalise proxyCountryCode to lowercase before sending it to the API (both Sessions.create() and Browsers.create() in v2, Sessions.create() in v3). The v4 layer skips this normalisation entirely.

Current Behavior

  • v4 Browsers.create({ proxyCountryCode: "US" }) sends "US" to the API as-is.
  • v4 Runs.create({ task: "...", browserSettings: { proxyCountryCode: "US" } }) sends "US" inside browserSettings as-is.

Both can result in a validation error from the Cloud API, which only accepts lowercase ISO 3166-1 alpha-2 codes.

Expected Behavior

Both calls should silently normalise the value to lowercase, matching the behaviour of every other SDK version.

Reproduction

Pass an uppercase country code to v4 Browsers.create() or v4 Runs.create() — the API rejects it.

Technical Context

  • src/v2/resources/browsers.ts line 34 - lowercases proxyCountryCode
  • src/v2/resources/sessions.ts line 23 - lowercases proxyCountryCode
  • src/v3/resources/sessions.ts line 42 - lowercases proxyCountryCode (added by #191)
  • src/v4/resources/browsers.ts - no normalisation
  • src/v4/resources/runs.ts - no normalisation for browserSettings.proxyCountryCode

The fix mirrors the existing pattern from #191 (v3 Sessions) applied to the two missing v4 entry points.

Lingua principale
Python
Stelle
31
Fork
21
Merge medio
1g 19h
PR unite (30g)
66

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di browser-use/sdk

Tutte le issue di browser-use/sdk

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.