solari-runloop-compat 0.2.8__tar.gz → 0.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/COMPAT.md +1 -0
  2. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/PKG-INFO +1 -1
  3. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/pyproject.toml +1 -1
  4. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/__init__.py +1 -1
  5. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_gateway.py +23 -7
  6. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_mapping.py +10 -0
  7. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/.gitignore +0 -0
  8. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/LICENSE +0 -0
  9. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/NOTICE +0 -0
  10. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/README.md +0 -0
  11. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_branding.py +0 -0
  12. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_client.py +0 -0
  13. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_config.py +0 -0
  14. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_context.py +0 -0
  15. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_dockerfile.py +0 -0
  16. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_exceptions.py +0 -0
  17. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_loop.py +0 -0
  18. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_models.py +0 -0
  19. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_options.py +0 -0
  20. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_redact.py +0 -0
  21. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_resources.py +0 -0
  22. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_sync.py +0 -0
  23. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_types.py +0 -0
  24. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/_vendor_user.py +0 -0
  25. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/lib/__init__.py +0 -0
  26. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/lib/polling.py +0 -0
  27. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/pagination.py +0 -0
  28. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/sdk.py +0 -0
  29. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/__init__.py +0 -0
  30. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/blueprint_build_log.py +0 -0
  31. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/blueprint_build_logs_list_view.py +0 -0
  32. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/blueprint_build_parameters.py +0 -0
  33. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/blueprint_list_view.py +0 -0
  34. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/blueprint_view.py +0 -0
  35. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devbox_async_execution_detail_view.py +0 -0
  36. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devbox_execution_detail_view.py +0 -0
  37. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devbox_snapshot_list_view.py +0 -0
  38. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devbox_snapshot_view.py +0 -0
  39. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devbox_view.py +0 -0
  40. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devboxes/__init__.py +0 -0
  41. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devboxes/devbox_logs_list_view.py +0 -0
  42. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devboxes/devbox_snapshot_async_status_view.py +0 -0
  43. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/devboxes/execution_update_chunk.py +0 -0
  44. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/object_download_url_view.py +0 -0
  45. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/object_view.py +0 -0
  46. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/secret_list_view.py +0 -0
  47. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/secret_view.py +0 -0
  48. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/shared/__init__.py +0 -0
  49. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/shared/after_idle.py +0 -0
  50. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/shared/code_mount_parameters.py +0 -0
  51. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/shared/launch_parameters.py +0 -0
  52. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/shared/lifecycle_configuration.py +0 -0
  53. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/shared/lifecycle_hooks.py +0 -0
  54. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/shared/resume_triggers.py +0 -0
  55. {solari_runloop_compat-0.2.8 → solari_runloop_compat-0.2.9}/solari_runloop/types/tunnel_view.py +0 -0
@@ -160,6 +160,7 @@ Last run 2026-10-21 against the F15 integration build `desktop-gateway:staging-1
160
160
  Here, Runloop sandboxes run as `user` in `/home/user`; commands, code and files all start there, and relative paths resolve against it. This package
161
161
  asks the gateway for exactly that at create time (`user: "user"`, `cwd: "/home/user"`; the gateway creates the user at first boot with passwordless
162
162
  sudo). Restores from a snapshot keep the snapshot's own user.
163
+ - **File calls act as that user.** `files.*` / `fs.*` run with the sandbox user's permissions (not root): `/etc/shadow` is refused with `permission denied`, a write under `/etc` fails, and a file you create is owned by the user. Guest images built before this fix still ran them as root.
163
164
  - **Gateway that predates `user` / `cwd`** (it answers 400 naming them, or ignores them): the plain create is used and the sandbox runs as **root in
164
165
  `/home/root`**, which is what this package did before. Check `whoami` if code depends on it.
165
166
  - **Template or snapshot made before user support** (the server answers 400 naming `user`): the plain create is used, the sandbox runs as **root**, and one warning says so. Rebuild templates and snapshots to get the vendor user.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: solari-runloop-compat
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: Runloop-compatible Python interface over Solari Sandboxes. Not affiliated with Runloop.
5
5
  Project-URL: Homepage, https://getsolari.com
6
6
  Author: Solari
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "solari-runloop-compat"
7
- version = "0.2.8"
7
+ version = "0.2.9"
8
8
  description = "Runloop-compatible Python interface over Solari Sandboxes. Not affiliated with Runloop."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -33,7 +33,7 @@ from ._types import NOT_GIVEN, NoneType, NotGiven, Omit, Timeout, not_given, omi
33
33
  from .lib.polling import PollingConfig, PollingTimeout
34
34
  from .sdk import AsyncRunloopSDK, RunloopSDK
35
35
 
36
- __version__ = "0.2.8"
36
+ __version__ = "0.2.9"
37
37
  Client = Runloop
38
38
  AsyncClient = AsyncRunloop
39
39
 
@@ -542,14 +542,30 @@ class Gateway:
542
542
  log.exception("streaming output of %s failed", eid)
543
543
  rec.flush()
544
544
 
545
+ #: How long a durable execution's watcher keeps asking while the devbox cannot answer (suspended, restarting, a pod
546
+ #: change) before it gives up; the process may well still be running, so this is NOT a verdict about it.
547
+ REMOTE_WATCH_PATIENCE_S = 600.0
548
+
545
549
  async def _remote_watch(self, rec: _Exec) -> None:
546
- try:
547
- final = await self.remote_wait(rec.devbox_id, rec.execution_id)
548
- rec.exit_code = final.exit_status
549
- rec.stdout, rec.stderr = [final.stdout or ""], [final.stderr or ""]
550
- rec.truncated = (bool(final.stdout_truncated), bool(final.stderr_truncated))
551
- except Exception as e: # noqa: BLE001
552
- rec.error = e if isinstance(e, ex.APIError) else ex.APIError(str(e), None, body=None)
550
+ deadline = time.monotonic() + self.REMOTE_WATCH_PATIENCE_S
551
+ delay = 0.5
552
+ while True:
553
+ try:
554
+ final = await self.remote_wait(rec.devbox_id, rec.execution_id)
555
+ rec.exit_code = final.exit_status
556
+ rec.stdout, rec.stderr = [final.stdout or ""], [final.stderr or ""]
557
+ rec.truncated = (bool(final.stdout_truncated), bool(final.stderr_truncated))
558
+ break
559
+ except Exception as e: # noqa: BLE001
560
+ # A wait that cannot be answered right now (the devbox is suspended: 409; connection or 5xx while it resumes) says
561
+ # nothing about the command: reading "completed" here told callers a process that was still alive had finished.
562
+ transient = isinstance(e, (ex.ConflictError, ex.APIConnectionError, ex.InternalServerError, ex.RateLimitError))
563
+ if transient and time.monotonic() < deadline:
564
+ await asyncio.sleep(delay)
565
+ delay = min(delay * 2, 10.0)
566
+ continue
567
+ rec.error = e if isinstance(e, ex.APIError) else ex.APIError(str(e), None, body=None)
568
+ break
553
569
  rec.status = "completed"
554
570
  rec.done.set() # type: ignore[union-attr]
555
571
 
@@ -54,6 +54,10 @@ def resolve_size(lp: Optional[Dict[str, Any]]) -> Tuple[Optional[int], Optional[
54
54
  elif size == "CUSTOM_SIZE" or lp.get("custom_cpu_cores") or lp.get("custom_gb_memory"):
55
55
  cpu_f = lp.get("custom_cpu_cores")
56
56
  mem_gib = lp.get("custom_gb_memory")
57
+ if size and size != "CUSTOM_SIZE" and (lp.get("custom_cpu_cores") or lp.get("custom_gb_memory")):
58
+ # Same refusal as the TypeScript package: a named size and an explicit core / memory count disagree, and silently
59
+ # taking the named size dropped what the caller asked for.
60
+ raise ex.BadRequestError(f"custom_cpu_cores / custom_gb_memory need resource_size_request CUSTOM_SIZE (or none), not {size!r}", status_code=400)
57
61
  cpu = max(1, math.ceil(cpu_f)) if cpu_f else None
58
62
  mem_mb = int(mem_gib * 1024) if mem_gib else None
59
63
  if cpu is not None and cpu > SOLARI_MAX_VCPU:
@@ -438,6 +442,12 @@ def map_error(exc: BaseException) -> BaseException:
438
442
  out3 = ex.APIConnectionError(exc.message)
439
443
  out3.__cause__ = exc
440
444
  return out3
445
+ # A file or directory that does not exist is Runloop's 404, not a bare APIError: the guest answers the RPC with "open <path>: no such file
446
+ # or directory" and no code (fs.download / fs.list / fs.stat ...).
447
+ if isinstance(exc, core_errors.ActionError) and str(getattr(exc, "method", "")).startswith("fs.") and "no such file or directory" in exc.message.lower():
448
+ nf = ex.NotFoundError(exc.message, body={"message": exc.message})
449
+ nf.__cause__ = exc
450
+ return nf
441
451
  if isinstance(exc, core_errors.SolariError):
442
452
  out4 = ex.APIError(exc.message, None, body=None)
443
453
  out4.__cause__ = exc