• Python: Hyperlight: thread-confine sandbox, skip parsing on host callbacks, schema/tool cleanup (#5424)

    frostbyte_neo released this 2026-04-23 08:14:51 +00:00 | 913 commits to main since this release

    • improved parsing of tool call results and tweaks

    • Address PR review: skip_parsing flag, broader registry close, comment fix

    • FunctionTool.invoke now takes a boolean skip_parsing flag instead of the
      SKIP_PARSING sentinel; the sentinel is still accepted as result_parser at
      construction time to opt out of parsing for every call. The two paths are
      equivalent.
    • _SandboxRegistry.close now invokes any sandbox close/shutdown hook on the
      entry's own worker thread (PyO3 unsendable), then shuts the worker down,
      then cleans up the per-entry temporary directories.
    • Clarified the _SandboxWorker.shutdown comment to describe the actual
      ThreadPoolExecutor.shutdown(wait=False, cancel_futures=False) semantics.
    • Hyperlight host callback uses skip_parsing=True (the new flag).

    Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

    • Drop redundant 'is not SKIP_PARSING' guard that mypy 1.x flags

    After callable(configured_parser) the sentinel is already excluded; the extra
    identity check tripped mypy's non-overlapping identity warning.

    Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

    • fixed sandbox working on copy of tool

    Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

    Downloads