Skip to content

Add execute_commands() for command-only execution without agent invocation#19

Merged
vijit-lark merged 2 commits intomainfrom
vd-20260411-1734
Apr 12, 2026
Merged

Add execute_commands() for command-only execution without agent invocation#19
vijit-lark merged 2 commits intomainfrom
vd-20260411-1734

Conversation

@vijit-lark
Copy link
Copy Markdown
Contributor

@vijit-lark vijit-lark commented Apr 12, 2026

Summary

  • Adds a new execute_commands() client method and corresponding wire protocol (command_execution_message / command_execution_result_message) that runs commands in the runtime environment and returns per-command exit codes without invoking the agent handler.
  • Supports real-time log streaming via on_assistant_message, error propagation via AgentRuntimeError, and the full artifact upload handshake.
  • Bumps both runtimeuse (TS server) and runtimeuse-client-python from 0.7.00.8.0.

Changes

Server (TypeScript)

  • types.ts: New CommandExecutionMessage, CommandExecutionResultItem, CommandExecutionResultMessage interfaces; updated IncomingMessage / OutgoingMessage unions.
  • invocation-runner.ts: New runCommandsOnly() method; refactored downloadRuntimeEnvironment to accept downloadables directly.
  • session.ts: Routes command_execution_message to new executeCommandsOnly() handler with ArtifactManager support.
  • index.ts: Exports new types.
  • invocation-runner.test.ts / session.test.ts: Unit tests for the new flow.

Client (Python)

  • types.py: New CommandExecutionMessage, CommandResultItem, CommandExecutionResult, CommandExecutionResultMessageInterface, ExecuteCommandsOptions types.
  • client.py: New execute_commands() method with the same streaming/error/artifact semantics as query().
  • __init__.py: Exports new types.
  • test_client.py: 10 unit tests with FakeTransport.
  • test/e2e/test_e2e.py: 9 E2E tests covering success, failure, streaming, cancellation, timeout, secrets, and cwd.
  • test/sandbox/test_e2b.py: E2B sandbox integration test for execute_commands.

Test plan

  • TypeScript unit tests pass (invocation-runner.test.ts, session.test.ts)
  • Python unit tests pass (test_client.py)
  • Python E2E tests pass (test_e2e.py)
  • E2B sandbox test (test_e2b.py)

Made with Cursor

…ation

Introduces a new `execute_commands()` method on the RuntimeUse client
that runs commands in the runtime environment and returns per-command
exit codes without invoking the agent handler. Logs stream in real time
via `on_assistant_message`, errors raise `AgentRuntimeError`, and the
artifact upload handshake is supported.

Wire protocol: new `command_execution_message` (incoming) and
`command_execution_result_message` (outgoing) message types.

Bumps both packages from 0.7.0 to 0.8.0.

Made-with: Cursor
@vijit-lark vijit-lark merged commit 1f0e720 into main Apr 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant