plato-sdk-v2 2.3.5__py3-none-any.whl → 2.3.6__py3-none-any.whl

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.
plato/worlds/base.py CHANGED
@@ -417,7 +417,7 @@ class BaseWorld(ABC, Generic[ConfigT]):
417
417
  content_type=content_type,
418
418
  )
419
419
 
420
- async def _create_and_upload_checkpoint(self) -> bool:
420
+ async def _create_and_upload_checkpoint(self) -> dict[str, str] | None:
421
421
  """Create a full checkpoint including env snapshots and state bundle.
422
422
 
423
423
  This method:
@@ -426,7 +426,7 @@ class BaseWorld(ABC, Generic[ConfigT]):
426
426
  3. Creates and uploads state bundle to S3
427
427
 
428
428
  Returns:
429
- True if successful, False otherwise
429
+ Dict mapping env alias to artifact_id if successful, None otherwise
430
430
  """
431
431
  # Commit state changes first
432
432
  self._commit_state(f"Checkpoint at step {self._step_count}")
@@ -446,12 +446,11 @@ class BaseWorld(ABC, Generic[ConfigT]):
446
446
  )
447
447
  if success:
448
448
  self.logger.info(f"Uploaded state bundle at step {self._step_count}")
449
- return True
450
449
  else:
451
450
  self.logger.warning(f"Failed to upload state bundle at step {self._step_count}")
452
- return False
451
+ return None
453
452
 
454
- return True
453
+ return env_snapshots
455
454
 
456
455
  def get_env(self, alias: str) -> Environment | None:
457
456
  """Get an environment by alias.
@@ -720,7 +719,20 @@ The following services are available for your use:
720
719
  # Create checkpoint if enabled and interval matches
721
720
  if self.config.checkpoint.enabled and self._step_count % self.config.checkpoint.interval == 0:
722
721
  self.logger.info(f"Creating checkpoint after step {self._step_count}")
723
- await self._create_and_upload_checkpoint()
722
+ env_snapshots = await self._create_and_upload_checkpoint()
723
+
724
+ # Emit checkpoint span for UI visibility
725
+ with tracer.start_as_current_span(f"checkpoint_{self._step_count}") as checkpoint_span:
726
+ checkpoint_span.set_attribute("span.type", "checkpoint")
727
+ checkpoint_span.set_attribute("source", "world")
728
+ checkpoint_span.set_attribute("step_number", self._step_count)
729
+ checkpoint_span.set_attribute("content", f"Checkpoint created at step {self._step_count}")
730
+ if env_snapshots:
731
+ # Serialize env_snapshots for OTel attribute
732
+ import json
733
+
734
+ checkpoint_span.set_attribute("env_snapshots", json.dumps(env_snapshots))
735
+ checkpoint_span.set_attribute("success", env_snapshots is not None)
724
736
 
725
737
  if result.done:
726
738
  break
plato/worlds/runner.py CHANGED
@@ -509,11 +509,16 @@ def dev(
509
509
  world: Annotated[str, typer.Option("--world", "-w", help="World name to run")],
510
510
  config: Annotated[Path, typer.Option("--config", "-c", help="Path to config JSON file")],
511
511
  env_timeout: Annotated[
512
- int, typer.Option("--env-timeout", help="Timeout for environment creation (seconds)")
512
+ int,
513
+ typer.Option("--env-timeout", help="Timeout for environment creation (seconds)"),
513
514
  ] = 7200,
514
515
  agents_dir: Annotated[
515
516
  Path | None,
516
- typer.Option("--agents-dir", "-a", help="Directory containing agent source code (builds local images)"),
517
+ typer.Option(
518
+ "--agents-dir",
519
+ "-a",
520
+ help="Directory containing agent source code (builds local images)",
521
+ ),
517
522
  ] = None,
518
523
  verbose: Annotated[bool, typer.Option("--verbose", "-v", help="Enable verbose logging")] = False,
519
524
  ) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plato-sdk-v2
3
- Version: 2.3.5
3
+ Version: 2.3.6
4
4
  Summary: Python SDK for the Plato API
5
5
  Author-email: Plato <support@plato.so>
6
6
  License-Expression: MIT
@@ -458,11 +458,11 @@ plato/v2/utils/models.py,sha256=PwehSSnIRG-tM3tWL1PzZEH77ZHhIAZ9R0UPs6YknbM,1441
458
458
  plato/v2/utils/proxy_tunnel.py,sha256=8ZTd0jCGSfIHMvSv1fgEyacuISWnGPHLPbDglWroTzY,10463
459
459
  plato/worlds/README.md,sha256=XFOkEA3cNNcrWkk-Cxnsl-zn-y0kvUENKQRSqFKpdqw,5479
460
460
  plato/worlds/__init__.py,sha256=ALoou3l5lXvs_YZc5eH6HdMHpvhnpzKWqz__aSC1jFc,2152
461
- plato/worlds/base.py,sha256=E_E5Y1FgcCghAIFWtTkqFXpf2tAKVKVNRKDtKXoHMac,26777
461
+ plato/worlds/base.py,sha256=pYBuXn7zZ3n-ys4XkEVEUL1poq1lWTNH9qYbMzWRLfE,27694
462
462
  plato/worlds/build_hook.py,sha256=KSoW0kqa5b7NyZ7MYOw2qsZ_2FkWuz0M3Ru7AKOP7Qw,3486
463
463
  plato/worlds/config.py,sha256=a5frj3mt06rSlT25kE-L8Q2b2MTWkR-8cUoBKpC8tG4,11036
464
- plato/worlds/runner.py,sha256=J4u0PiMAs_tG5rBaIQtLmoqGnlxvbTyPIXDBbMMA8DY,18967
465
- plato_sdk_v2-2.3.5.dist-info/METADATA,sha256=YuzNDUss8gxSTa1XH86sb3etwlKd92o3GJXv6j_SWDA,8653
466
- plato_sdk_v2-2.3.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
467
- plato_sdk_v2-2.3.5.dist-info/entry_points.txt,sha256=upGMbJCx6YWUTKrPoYvYUYfFCqYr75nHDwhA-45m6p8,136
468
- plato_sdk_v2-2.3.5.dist-info/RECORD,,
464
+ plato/worlds/runner.py,sha256=vrgKStT8fs3HuOGcPL5obZt-BLdLlQ0CVBUQZWyOOis,19023
465
+ plato_sdk_v2-2.3.6.dist-info/METADATA,sha256=mt3gSWRwTjcgKse_WxVlNF1_bRtZjdjzWiIdJJ2ecFU,8653
466
+ plato_sdk_v2-2.3.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
467
+ plato_sdk_v2-2.3.6.dist-info/entry_points.txt,sha256=upGMbJCx6YWUTKrPoYvYUYfFCqYr75nHDwhA-45m6p8,136
468
+ plato_sdk_v2-2.3.6.dist-info/RECORD,,