Python: Include constructor tools in agent-hooks startup - #7600
Python: Include constructor tools in agent-hooks startup#7600Ruiming Zhao (uuzzrm) wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Includes constructor-registered Python agent tools in agent-hooks startup projections.
Changes:
- Reads tools from agent default options when absent from run context.
- Adds regression coverage for constructor tools.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
python/packages/core/agent_framework/_agent_hooks.py |
Adds constructor-tool fallback. |
python/packages/core/tests/core/test_agent_hooks.py |
Tests startup tool projection. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Following up on the constructor/runtime tool-combination feedback: the current head |
…nto codex/issue-7560-tools-registered
|
Synced the existing branch with the latest upstream main in merge commit 8914c52. The review fix itself is unchanged. The current head retains the startup projection that combines configured constructor tools with the selected run-level source, including options[tools] fallback and run(tools=...) precedence, with regression coverage for each case. Local verification after the sync is environment-limited: the bundled Python is missing the repository dependency opentelemetry, so collection stops before imports with ModuleNotFoundError. The existing PR CI had validated the focused change; this push has triggered a new CI run for the synced head. The PR remains open and unmerged, awaiting repository checks and maintainer review. |
|
Updated the branch to Local verification: full |
Motivation & Context
The agent-hooks
agent_startupprojection readsagent.toolswhen no run-level tools are supplied.Agentstores tools passed to its constructor indefault_options["tools"], so those tools were omitted fromagent_init.tools_registeredeven though they were available to the run.Description & Review Guide
default_options["tools"]when the agent exposes its configured tools there.Agent(tools=[...])run.Verification
pytest packages/core/tests/core/test_agent_hooks.pyruff check packages/core/agent_framework/_agent_hooks.py packages/core/tests/core/test_agent_hooks.pyruff format --check packages/core/agent_framework/_agent_hooks.py packages/core/tests/core/test_agent_hooks.pyRelated Issue
Fixes #7560
Contribution Checklist