Repository navigation
fix(mcp): send an out-of-range batch control to the validator instead of dropping it #1118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
NandhaKishorM
merged 2 commits into
NandhaKishorM:main
from
ahmedandaloes:fix/mcp-batch-controls-reach-validator
Oct 12, 2026
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
test(mcp): pin the batch tool's controls in the API contract suite; k…
…eep booleans out of "unset" Review follow-up. `or None` also collapsed `False`, because `False == 0`, so a boolean still disappeared instead of reaching `_validate_hooks_timeout`, whose contract is to refuse booleans. Fold only a numeric 0 now, and cover both booleans in the forwarding and rejection checks. `hooks_timeout` is annotated `float | None` because None is the unset marker it folds to. Per AGENTS.md the public API contract suite has to move with a signature change, so tests/test_hooks_api.py pins `laya_predict_batch_tool`'s controls and their defaults (batch_size 0, hooks_timeout 0, min_confidence None, sort_by_length False). The import is guarded: the mcp extra is optional and a core install must still run this suite. Verified: tests/test_mcp.py 971 passed / 0 failed; tests/test_hooks_api.py 551 passed / 0 failed; tests/test_mcp_remote.py 53 passed; ruff and python -m compileall -q laya/ tests/ both clean.
- Loading branch information
commit 32d262bd3dc4c7d01d50bc713b68447328a577c7
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right — AGENTS.md requires tests/test_hooks_api.py to move with a public API change, and I changed the advertised schema without touching it. Fixed in 32d262b.
tests/test_hooks_api.py now pins the tool's controls and their defaults:
The import is guarded (
except ImportError: _mcp_batch_tool = None) so a core install without the mcp extra still runs the suite, matching how tests/test_mcp.py skips.I also ran the second gate named in AGENTS.md, which I had skipped:
python -m compileall -q laya/ tests/is clean, andtests/test_hooks_api.pyreports 551 passed, 0 failed.