fix(daytona): migrate legacy-sandbox lookup to cursor-based list() (#24587)
Daytona ships breaking SDK changes on June 10, 2026 — `list()` returns an iterator and the `page=` offset parameter is removed. We pin daytona==0.155.0 so we're past the May 24 hard-cutoff, but the legacy-sandbox resume path in DaytonaEnvironment still passes `page=1` and reads `.items` off the result. Switch to `next(iter(results), None)` against a single-result `list(labels=..., limit=1)` call. Update tests to use `iter([...])` and drop the `page=1` kwarg from list() assertions.
This commit is contained in:
@@ -101,9 +101,13 @@ class DaytonaEnvironment(BaseEnvironment):
|
||||
|
||||
if self._sandbox is None:
|
||||
try:
|
||||
page = self._daytona.list(labels=labels, page=1, limit=1)
|
||||
if page.items:
|
||||
self._sandbox = page.items[0]
|
||||
# Daytona SDK >=0.108.0 uses cursor-based pagination and
|
||||
# list() returns an iterator. Offset-based pagination
|
||||
# (page=1) is removed on June 10, 2026.
|
||||
results = self._daytona.list(labels=labels, limit=1)
|
||||
legacy = next(iter(results), None)
|
||||
if legacy is not None:
|
||||
self._sandbox = legacy
|
||||
self._sandbox.start()
|
||||
logger.info("Daytona: resumed legacy sandbox %s for task %s",
|
||||
self._sandbox.id, task_id)
|
||||
|
||||
Reference in New Issue
Block a user