Fix use_partial_bind=True default causing unexpected MissingParameterError in agent.py#82
Open
Fix use_partial_bind=True default causing unexpected MissingParameterError in agent.py#82
use_partial_bind=True default causing unexpected MissingParameterError in agent.py#82Conversation
…Error in agent.py Co-authored-by: pmalarme <686568+pmalarme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix use_partial_bind default causing MissingParameterError in agent.py
Fix Feb 19, 2026
use_partial_bind=True default causing unexpected MissingParameterError in agent.py
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores the expected public call contract for ExampleAgent.run() by ensuring missing required arguments surface as Python’s native TypeError rather than the decorator’s MissingParameterError.
Changes:
- Set
use_partial_bind=Falseon@require_non_blank_stringsforExampleAgent.run()to avoid decorator-owned missing-argument errors. - Added a regression test asserting
agent.run()(withoutname) raisesTypeError.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| agents/agent1/src/python_agent_template/agents/agent1/agent.py | Updates the validator decorator invocation to use full binding so omitted required args raise TypeError. |
| agents/agent1/tests/test_agent.py | Adds a test to pin the intended TypeError behavior when name is omitted. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@require_non_blank_strings("name")onExampleAgent.run()used the defaultuse_partial_bind=True, causing omitted calls likeagent.run()to raiseMissingParameterError(decorator-owned) instead of Python's nativeTypeError. This silently changes the public call contract of the method.Fix: explicitly pass
use_partial_bind=Falseso the decorator delegates missing-argument detection to Python's own signature binding:Test: added
test_run_raises_type_error_when_name_omittedto assertagent.run()raisesTypeError, pinning the correct call contract.Testing
uv run poe checkpython3 -m pytest agents/agent1/tests/ -v— 12/12 passedChecklist
Additional context
Original prompt
use_partial_bind=Truedefault causing unexpectedMissingParameterErrorinagent.py#77✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.