From 1453314684a24fc35419e5da77a0c98302166f28 Mon Sep 17 00:00:00 2001 From: Siddarth Chalasani Date: Fri, 14 Nov 2025 14:19:11 -0800 Subject: [PATCH 1/3] add new exec parameters to exec and await completed --- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 0dba10c9d..f7c5c8e9a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -802,6 +802,8 @@ def execute_and_await_completion( devbox_id: str, *, command: str, + last_n: str | Omit = omit, + optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, polling_config: PollingConfig | None = None, # The following are forwarded to the initial execute request @@ -823,6 +825,8 @@ def execute_and_await_completion( devbox_id, command=command, command_id=command_id, + last_n=last_n, + optimistic_timeout=optimistic_timeout, shell_name=shell_name, extra_headers=extra_headers, extra_query=extra_query, @@ -2284,6 +2288,8 @@ async def execute_and_await_completion( devbox_id: str, *, command: str, + last_n: str | Omit = omit, + optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, polling_config: PollingConfig | None = None, # The following are forwarded to the initial execute request @@ -2306,6 +2312,8 @@ async def execute_and_await_completion( devbox_id, command=command, command_id=command_id, + last_n=last_n, + optimistic_timeout=optimistic_timeout, shell_name=shell_name, extra_headers=extra_headers, extra_query=extra_query, From 686406559512da935baafdf366935df3b826eaac Mon Sep 17 00:00:00 2001 From: Siddarth Chalasani Date: Fri, 14 Nov 2025 14:22:33 -0800 Subject: [PATCH 2/3] expose command_id as a parameter to exec and await completion --- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f7c5c8e9a..121f9908d 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -802,6 +802,7 @@ def execute_and_await_completion( devbox_id: str, *, command: str, + command_id: str = str(uuid7()), last_n: str | Omit = omit, optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, @@ -816,11 +817,10 @@ def execute_and_await_completion( """ Execute a command and wait for it to complete with optimal latency for long running commands. - This method launches an execution with a generated command_id and first attempts to + This method launches an execution and first attempts to return the result within the initial request's timeout. If the execution is not yet complete, it switches to using wait_for_command to minimize latency while waiting. """ - command_id = str(uuid7()) # type: ignore execution = self.execute( devbox_id, command=command, @@ -2288,6 +2288,7 @@ async def execute_and_await_completion( devbox_id: str, *, command: str, + command_id: str = str(uuid7()), last_n: str | Omit = omit, optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, @@ -2302,12 +2303,11 @@ async def execute_and_await_completion( """ Execute a command and wait for it to complete with optimal latency for long running commands. - This method launches an execution with a generated command_id and first attempts to + This method launches an execution and first attempts to return the result within the initial request's timeout. If the execution is not yet complete, it switches to using wait_for_command to minimize latency while waiting. """ - command_id = str(uuid7()) # type: ignore execution = await self.execute( devbox_id, command=command, From afaf0d13d0a1559c333112f6f364f67bc0ea2fda Mon Sep 17 00:00:00 2001 From: Siddarth Chalasani Date: Fri, 14 Nov 2025 14:51:59 -0800 Subject: [PATCH 3/3] added comment explaining command_id use and generation in docstring --- src/runloop_api_client/resources/devboxes/devboxes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 121f9908d..7a3ddf741 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -820,6 +820,9 @@ def execute_and_await_completion( This method launches an execution and first attempts to return the result within the initial request's timeout. If the execution is not yet complete, it switches to using wait_for_command to minimize latency while waiting. + + A command_id (UUIDv7) is automatically generated for idempotency and tracking. + You can provide your own command_id to enable custom retry logic or external tracking. """ execution = self.execute( devbox_id, @@ -2306,6 +2309,9 @@ async def execute_and_await_completion( This method launches an execution and first attempts to return the result within the initial request's timeout. If the execution is not yet complete, it switches to using wait_for_command to minimize latency while waiting. + + A command_id (UUIDv7) is automatically generated for idempotency and tracking. + You can provide your own command_id to enable custom retry logic or external tracking. """ execution = await self.execute(