Commit b03cb32
Python: Add Hyperlight CodeAct package and docs (microsoft#5185)
* initial work on code_mode
* updated samples
* updates to codeact
* udpated codeact
* Draft CodeAct ADR and sample updates
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* initial implementation and adr and feature
* Python: Limit Hyperlight wasm backend to Python <3.14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Fix CI for Hyperlight CodeAct PR
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Run Hyperlight integration when available
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Address Hyperlight review feedback
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Simplify Hyperlight file mount inputs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Accept Path host paths in Hyperlight mounts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Fix Hyperlight mount typing for CI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* temp run integration test
* Python: Strengthen Hyperlight real sandbox tests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* added additional tests
* Python: Simplify Hyperlight CodeAct API
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* set tests as non-integration
* Retry Hyperlight allowed-domain registration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Gate Hyperlight integration tests by runtime support
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Hyperlight skip test on Python 3.14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Delay Hyperlight runtime probe until test execution
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Relax Hyperlight Windows integration stdout assertion
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Scan Hyperlight output directory for artifacts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Retry Hyperlight output artifact collection
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Harden Hyperlight integration output assertions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Retry Hyperlight read-back check in integration test
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify Hyperlight integration write assertion
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Avoid pathlib in Hyperlight integration sandbox
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use socket network check in Hyperlight sandbox
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Replace blocked Azure AI Search blog link
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Clarify Hyperlight guest stdlib limits
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use _socket in Hyperlight integration sandbox
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Handle Hyperlight mounted file paths
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Broaden Hyperlight sandbox path fallbacks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Search Hyperlight guest mounts recursively
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Split Hyperlight mount coverage
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Split Hyperlight live network tests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Hyperlight file-write test on Windows
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>
* Address PR review: ADR intro, manual wiring sample, doc clarifications
- 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>
* Address PR microsoft#5185 review comments and add .NET CodeAct design 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>
* Update hyperlight README with code snippets and remove Public API section
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>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent dbf935b commit b03cb32
25 files changed
Lines changed: 4176 additions & 9 deletions
File tree
- .github/workflows
- docs
- decisions
- features/code_act
- python
- packages
- core/agent_framework
- hyperlight
- agent_framework_hyperlight
- samples
- tests/hyperlight
- samples/02-agents/context_providers/azure_ai_search
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
281 | | - | |
| 282 | + | |
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | | - | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
1036 | | - | |
| 1037 | + | |
1037 | 1038 | | |
1038 | 1039 | | |
1039 | 1040 | | |
| |||
1049 | 1050 | | |
1050 | 1051 | | |
1051 | 1052 | | |
1052 | | - | |
| 1053 | + | |
1053 | 1054 | | |
1054 | 1055 | | |
1055 | 1056 | | |
| |||
1064 | 1065 | | |
1065 | 1066 | | |
1066 | 1067 | | |
1067 | | - | |
| 1068 | + | |
1068 | 1069 | | |
1069 | 1070 | | |
1070 | 1071 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments