Skip to content

Python: Hyperlight and Monty host-tool schema rendering with format selection #8445

Closed

Description

Parent issue

Sub-issue of #8125. This child tracks Python only. Sibling #8446 tracks the other language implementation and is outside this work. The future Python PR should close this child and reference #8125 as partially addressed, not close the parent.

Verified current behavior

At upstream/main 999dda7970fe969c0901d524365ce34ecbda6227, python/packages/hyperlight/agent_framework_hyperlight/_instructions.py::_format_tool_summaries calls FunctionTool.parameters() but renders only property names alongside the tool name and description. Python already surfaces parameter names; requiredness, types, parameter descriptions, enums, and nested schema details are omitted.

User-confirmed scope

  • Add exactly one keyword-only parameter on all four Hyperlight and Monty constructors: tool_description_format: Literal["compact", "json"] | Mapping[str, Literal["compact", "json"]] = "compact". A string applies to every tool; a mapping selects by exact tool name, with compact for missing names. Do not accept None or add a separate overrides parameter.
  • Compact output includes names, types, required/optional markers, parameter descriptions, and enum values. When nested shapes, references, or other constraints cannot be faithfully represented, render the full JSON Schema for that tool with an explicit fallback note.
  • JSON output preserves the complete existing FunctionTool.parameters() schema without introducing a schema abstraction.
  • Wire both HyperlightExecuteCodeTool and HyperlightCodeActProvider, including run-scoped snapshots and model-facing descriptions.
  • Add focused rendering/configuration/snapshot regressions and package README documentation. Preserve execution, approvals, sandbox capabilities, and execute-code input schema.

Status and boundaries

The user approved implementation. Hyperlight and Monty changes and the shared structured core helper are implemented locally; no PR has been created because the minimum-core release remains unresolved. Includes the user-requested Monty CodeAct parity; excludes unrelated package changes. The upstream metadata gap was reproduced against both package summaries and verified fixed through both patched public descriptions. Combined core-tool and non-integration package tests: 344 passed, 6 skipped, 12 deselected; lint, source/test typing, and README code-block checks passed. Specialized full-diff review against upstream a3fc29d found no independent CodeAct issues beyond the known minimum-core-release gate. No live-model test is claimed.

Monty parity (user-requested scope expansion)

Monty currently has the same names-only summary in its local _instructions.py. Apply the same single-parameter compact/json contract, validation, copying, serialization, and rich-schema fallback to MontyExecuteCodeTool and MontyCodeActProvider. Both Monty execute-code descriptions and context instructions contain the registry and must honor the format. Preserve typed async-call guidance, generated type stubs, bridge execution, resource limits, mounts, output handling, and tool counters.

Latest user decision: share one small private helper in core _tools.py that takes the existing parameter schema and a resolved compact/json format and returns structured parameter data, not text. Include the effective format with the mapping so callers can surface explicit JSON fallback. Keep FunctionTool.parameters() unchanged, and keep Hyperlight/Monty prose and final text rendering local. Add core helper tests and both packages wiring/lifecycle regressions; update their documentation. Coordinate both packages minimum core release before publishing so versions without the new helper are excluded.

Activity

  1. changed the title [-]Python: Hyperlight host-tool schema rendering with default and per-tool format selection[/-] [+].NET: Python: Hyperlight host-tool schema rendering with default and per-tool format selection[/+] on Sep 17, 2026
  2. changed the title [-].NET: Python: Hyperlight host-tool schema rendering with default and per-tool format selection[/-] [+]Python: Hyperlight host-tool schema rendering with default and per-tool format selection[/+] on Sep 17, 2026
  3. changed the title [-]Python: Hyperlight host-tool schema rendering with default and per-tool format selection[/-] [+]Python: Hyperlight and Monty host-tool schema rendering with format selection[/+] on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonUsage: [Issues, PRs], Target: Python

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions