Skip to content
This repository was archived by the owner on Aug 12, 2026. It is now read-only.
2 changes: 1 addition & 1 deletion fleet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
from . import global_client as _global_client
from ._async import global_client as _async_global_client

__version__ = "0.2.125"
__version__ = "0.2.126"

__all__ = [
# Core classes
Expand Down
2 changes: 1 addition & 1 deletion fleet/_async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from .. import env
from . import global_client as _async_global_client

__version__ = "0.2.125"
__version__ = "0.2.126"

__all__ = [
# Core classes
Expand Down
2 changes: 1 addition & 1 deletion fleet/_async/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
try:
from .. import __version__
except ImportError:
__version__ = "0.2.125"
__version__ = "0.2.126"

logger = logging.getLogger(__name__)

Expand Down
6 changes: 4 additions & 2 deletions fleet/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,9 @@ async def make(
)

instance = AsyncEnv(client=self.client, **response.json())
await instance.instance.load()
# Resources are loaded lazily on first `db()`/`browser()`/`resources()` access
# via `_load_resources()`, so we don't preload here. Eagerly loading would
# fail-fast with a 502 while the container is still warming up.
Comment thread
cursor[bot] marked this conversation as resolved.
return instance

async def make_for_task(self, task: Task) -> AsyncEnv:
Expand Down Expand Up @@ -653,7 +655,7 @@ async def instance(self, instance_id: Union[str, Dict[str, str]]) -> AsyncEnv:
else:
response = await self.client.request("GET", f"/v1/env/instances/{instance_id}")
instance = AsyncEnv(client=self.client, **response.json())
await instance.instance.load()
# Resources load lazily on first `db()`/`browser()`/`resources()` access.
return instance

def _create_url_instance(self, base_url: str) -> AsyncEnv:
Expand Down
2 changes: 2 additions & 0 deletions fleet/_async/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Instance(BaseModel):
team_id: str = Field(..., title="Team Id")
region: str = Field(..., title="Region")
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
multi_env_list: Optional[List[str]] = Field(None, title="Multi Env List")


class InstanceRequest(BaseModel):
Expand Down Expand Up @@ -357,6 +358,7 @@ class InstanceResponse(BaseModel):
data_version: Optional[str] = Field(None, title="Data Version")
urls: Optional[InstanceURLs] = Field(None, title="Urls")
health: Optional[bool] = Field(None, title="Health")
multi_env_list: Optional[List[str]] = Field(None, title="Multi Env List")


class AccountResponse(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion fleet/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
try:
from . import __version__
except ImportError:
__version__ = "0.2.125"
__version__ = "0.2.126"

logger = logging.getLogger(__name__)

Expand Down
6 changes: 4 additions & 2 deletions fleet/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ def make(
)

instance = SyncEnv(client=self.client, **response.json())
instance.instance.load()
# Resources load lazily on first `db()`/`browser()`/`resources()` access via
# `_load_resources()`. Skipping the eager preload avoids fail-fast 502s while
# the container is still warming up.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removing load() breaks db() and browser() calls

High Severity

The instance.instance.load() call was removed with a comment claiming resources load lazily on first db()/browser()/resources() access via _load_resources(). However, InstanceClient.db() and InstanceClient.browser() (and their async counterparts) do not call _load_resources() — only resources() does. Since _resources_state is initialized with empty dicts, calling db() or browser() after make() or get() will now raise a KeyError, breaking the SDK's primary workflow.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b8e9118. Configure here.

return instance

def make_for_task(self, task: Task) -> SyncEnv:
Expand Down Expand Up @@ -665,7 +667,7 @@ def instance(self, instance_id: Union[str, Dict[str, str]]) -> SyncEnv:
else:
response = self.client.request("GET", f"/v1/env/instances/{instance_id}")
instance = SyncEnv(client=self.client, **response.json())
instance.instance.load()
# Resources load lazily on first `db()`/`browser()`/`resources()` access.
return instance

def _create_url_instance(self, base_url: str) -> SyncEnv:
Expand Down
2 changes: 2 additions & 0 deletions fleet/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Instance(BaseModel):
region: str = Field(..., title="Region")
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
run_id: Optional[str] = Field(None, title="Run Id")
multi_env_list: Optional[List[str]] = Field(None, title="Multi Env List")


class InstanceRequest(BaseModel):
Expand Down Expand Up @@ -369,6 +370,7 @@ class InstanceResponse(BaseModel):
profile_id: Optional[str] = Field(None, title="Profile Id")
heartbeat_interval: Optional[int] = Field(None, title="Heartbeat Interval")
heartbeat_region: Optional[str] = Field(None, title="Heartbeat Region")
multi_env_list: Optional[List[str]] = Field(None, title="Multi Env List")


class Run(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "fleet-python"

version = "0.2.125"
version = "0.2.126"
description = "Python SDK for Fleet environments"
authors = [
{name = "Fleet AI", email = "nic@fleet.so"},
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading