Repository navigation
Python: Reuse registered tools in Monty callbacks - #8395
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation is consistent with FunctionTool lifecycle semantics and has comprehensive regression coverage.
Pull request overview
Reuses registered Monty host tools so invocation and exception accounting persists consistently.
Changes:
- Bind callbacks directly to registered
FunctionTool.invoke. - Document host-tool counter lifetime.
- Add regression and concurrency coverage.
File summaries
| File | Description |
|---|---|
python/packages/monty/agent_framework_monty/_execute_code_tool.py |
Reuses registered tool instances. |
python/packages/monty/README.md |
Documents counter lifetime. |
python/packages/monty/tests/monty/test_monty_codeact.py |
Adds focused callback and provider tests. |
python/packages/monty/tests/monty/test_monty_codeact_integration.py |
Tests execution and concurrency behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): da284fb8a4dd
Model: gpt-5.6-sol-fast
Overview
The change makes Monty callbacks invoke the exact registered FunctionTool, bringing host-tool counters in line with the core instance-lifetime contract while continuing to return raw Python values. The strongest guardrails are focused coverage for invocation and exception limits, bound methods, concurrent async calls, repeated executions, and provider snapshots, plus explicit lifetime documentation. No publishable defect remains after reconciling the shared-quota concern against the existing opt-in contract.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Motivation & Context
Keep Monty host-tool invocation accounting consistent with direct invocation of registered
FunctionToolinstances.Description & Review Guide
invokemethod, remove the unused copy import, document host-tool lifetime, and add focused regression coverage.Related Issue
No linked issue.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.