Skip to content

feat(runtime): integrate Python control plane adapter to Rust CLI - #24

Open
ProfRandom92 wants to merge 2 commits into
mainfrom
p1/control-plane-runtime-adapter
Open

ProfRandom92 wants to merge 2 commits into
mainfrom
p1/control-plane-runtime-adapter

Conversation

@ProfRandom92

@ProfRandom92 ProfRandom92 commented Jul 21, 2026 •

Copy link
Copy Markdown
Owner

Objective

Integrate Python control plane adapter to Rust CLI (ctxt).

Adapter Implementation & Boundaries

  • Implemented canonical Python adapter (modules/runtime/cli_adapter.py) using subprocess.run(shell=False) with restricted allowlist environment (PATH, SYSTEMROOT, TEMP/TMP, COMPTEXT_*).
  • Configurable environment overrides via COMPTEXT_CONFIG_PATH and COMPTEXT_CLI_TIMEOUT.
  • Error handling parses ErrorEnvelope JSON structures from both stderr and stdout streams.
  • Clean separation between mocked unit tests (tests/runtime/test_cli_adapter.py) and binary integration tests (tests/runtime/test_cli_adapter_integration.py).

Tests

  • 256 passing pytest tests (python -m pytest).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a Python adapter (modules/runtime/cli_adapter.py) to interface with the Rust-based ctxt CLI runtime, along with corresponding integration tests. The adapter provides functions to validate agent specifications, perform dry runs, and replay/verify logged evidence. Feedback on the changes suggests improving robustness by allowing configuration of the config path and execution timeout via environment variables, parsing both stdout and stderr for JSON error envelopes on non-zero exit codes, and skipping integration tests when the compiled Rust binary is not available.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread modules/runtime/cli_adapter.py Outdated
Comment thread modules/runtime/cli_adapter.py Outdated
Comment thread modules/runtime/cli_adapter.py Outdated
Comment thread tests/runtime/test_cli_adapter.py Outdated
@ProfRandom92

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@ProfRandom92
ProfRandom92 marked this pull request as ready for review July 29, 2026 15:44
@gemini-code-assist

This comment has been minimized.

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