Python: Add Hyperlight CodeAct package and docs#5185
Merged
moonbox3 merged 42 commits intomicrosoft:mainfrom Apr 17, 2026
Merged
Python: Add Hyperlight CodeAct package and docs#5185moonbox3 merged 42 commits intomicrosoft:mainfrom
moonbox3 merged 42 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional Python Hyperlight-backed CodeAct implementation plus cross-SDK design documentation, and wires the new package into the Python workspace and CI.
Changes:
- Introduces the new
agent-framework-hyperlightalpha package (provider +execute_codetool), including samples and tests. - Updates
agent-framework-coreto let context providers inspect/override per-run runtime tools viaSessionContext.options["tools"]. - Adds ADR/design docs for CodeAct and updates Python CI workflows to include Hyperlight integration coverage.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| python/uv.lock | Adds Hyperlight package + Hyperlight sandbox deps; updates a few dependency markers. |
| python/pyproject.toml | Registers agent-framework-hyperlight in the Python workspace. |
| python/packages/hyperlight/tests/hyperlight/test_hyperlight_codeact.py | Adds unit coverage + guarded real-sandbox integration test. |
| python/packages/hyperlight/samples/README.md | Documents how to run the new Hyperlight samples. |
| python/packages/hyperlight/samples/codeact_tool.py | Standalone HyperlightExecuteCodeTool sample. |
| python/packages/hyperlight/samples/codeact_context_provider.py | Provider-owned CodeAct sample using HyperlightCodeActProvider. |
| python/packages/hyperlight/README.md | Package-level README for installation and public API. |
| python/packages/hyperlight/pyproject.toml | New package metadata, deps, and tooling config. |
| python/packages/hyperlight/LICENSE | Adds MIT license for the new package. |
| python/packages/hyperlight/agent_framework_hyperlight/_types.py | Adds public types (FileMount, FilesystemMode, NetworkMode). |
| python/packages/hyperlight/agent_framework_hyperlight/_provider.py | Implements HyperlightCodeActProvider context provider. |
| python/packages/hyperlight/agent_framework_hyperlight/_instructions.py | Builds dynamic CodeAct instructions and tool descriptions. |
| python/packages/hyperlight/agent_framework_hyperlight/_execute_code_tool.py | Implements sandbox execution, caching, CRUD registries for tools/files/network. |
| python/packages/hyperlight/agent_framework_hyperlight/init.py | Exposes public API + version metadata. |
| python/packages/core/tests/core/test_agents.py | Adds tests validating providers can inspect/remove runtime tools. |
| python/packages/core/agent_framework/_tools.py | Introduces ApprovalMode type alias and updates signatures. |
| python/packages/core/agent_framework/_sessions.py | Updates docs to reflect provider mutability of options["tools"]. |
| python/packages/core/agent_framework/_agents.py | Passes runtime tools via SessionContext.options and resolves tools from provider-mutated options. |
| python/PACKAGE_STATUS.md | Adds agent-framework-hyperlight as alpha. |
| python/.cspell.json | Adds codeact and hyperlight to dictionary. |
| docs/features/code_act/python-implementation.md | Adds Python-specific CodeAct design notes and API contract. |
| docs/features/code_act/dotnet-implementation.md | Adds placeholder for .NET CodeAct implementation notes. |
| docs/decisions/0024-codeact-integration.md | Adds ADR covering cross-SDK CodeAct integration approach and approval model. |
| .github/workflows/python-merge-tests.yml | Includes Hyperlight tests in “misc integration” selection. |
| .github/workflows/python-integration-tests.yml | Includes Hyperlight tests in “misc integration” job. |
Contributor
a2f85f8 to
4c6f7da
Compare
moonbox3
reviewed
Apr 10, 2026
Contributor
moonbox3
left a comment
There was a problem hiding this comment.
This is a nice and complete ADR - well done. A lot here to unpack so doing a first pass with some questions.
b309856 to
fe24c4f
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dd05f42 to
54f1b3a
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable the sandbox filesystem by providing a workspace_root so /output is mounted. Remove os.path.exists assertion (unsupported in WASM guest) and fix Content data assertion to use .uri. Skip the network integration test on Windows where the WASM sandbox lacks the encodings.idna codec. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TaoChenOSU
reviewed
Apr 14, 2026
- Add CodeAct introduction section to ADR for unfamiliar readers - Clarify 'less runtime efficient' con with specific overhead description - Add note in Python impl doc clarifying ADR vs impl doc split - Explain why before_run hooks must be per-run (CRUD, concurrency, approval) - Rename code_interpreter variable to codeact in E2E sample - Add manual static wiring sample (codeact_manual_wiring.py) - Add 'when to use which pattern' guidance to samples README Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
moonbox3
reviewed
Apr 16, 2026
… doc - Fix async callback: _make_sandbox_callback returns sync wrapper with thread + asyncio.run() bridge (was broken with real Wasm FFI) - Fix stale output: clear output_dir before each sandbox.run() call - Fix blocking event loop: _run_code now async with asyncio.to_thread() - Revert _agents.py options['tools'] injection (unnecessary; provider uses context.extend_tools()) - Revert SessionContext.options docstring back to read-only - Add real-sandbox test fixtures (shared/restored/fresh) - Add 8 new real-sandbox tests for callback round-trip, stale output, event loop non-blocking, basic execution, stdout/stderr, errors, snapshot/restore, and tool registration - Add comprehensive .NET HyperlightCodeActProvider design document Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tion Replace bare export list with Quick Start code examples covering the context provider, standalone tool, manual static wiring, and file mounts / network access patterns. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
moonbox3
approved these changes
Apr 16, 2026
lokitoth
approved these changes
Apr 16, 2026
TaoChenOSU
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Add a concrete, optional CodeAct implementation for Python and capture the cross-SDK design for CodeAct with Hyperlight. This provides a reusable path for long-running agents to execute sandboxed code with provider-owned tools, file mounts, and network allow-lists without baking CodeAct into core.
Description
agent-framework-hyperlightpackage withHyperlightCodeActProviderandHyperlightExecuteCodeToolCloses: #5187
Contribution Checklist