Bug Description
When an Agent is created with toolsets passed via the constructor (e.g., SubagentToolsetConfig().get_provider()), the capability works. But when the session_pool path recreates the agent from manifest config, the toolsets are not preserved — SubagentTools capability is lost.
Failing Test
tests/tools/test_runcontext.py::test_capability_tools
async with AgentPool(manifest) as pool:
subagent = SubagentToolsetConfig()
providers = [subagent.get_provider()]
agent = Agent(name="test", model=default_model, toolsets=providers, agent_pool=pool)
result = await agent.run("Get available agents using the list_available_nodes tool")
assert agent.name in str(result.content) # ← RuntimeError: No final message received
The test is currently marked @pytest.mark.xfail with reason="Test passes toolsets via Agent() constructor, but session_pool path recreates agent from manifest config (without toolsets). SubagentTools capability is lost. Fix: configure SubagentToolsetConfig in manifest.tools."
Verification
Confirmed still failing on main (commit 67710ea) via --runxfail:
RuntimeError: No final message received from stream
src/agentpool/agents/base_agent.py:1984: RuntimeError
Root Cause (preliminary)
The xfail reason identifies the issue clearly:
- Test creates
Agent with toolsets=[subagent.get_provider()] via constructor
- The
session_pool execution path recreates the agent from manifest config
- The manifest config does not include the
SubagentToolsetConfig in manifest.tools
- The recreated agent has no
SubagentTools capability → the list_available_nodes tool is not registered → the model cannot call it → no final message produced
Suggested Fix
Per the xfail reason: "Fix: configure SubagentToolsetConfig in manifest.tools."
Either:
- Make the session_pool path preserve constructor-passed toolsets, or
- Require toolsets to be declared in manifest config (and update the test to do so)
Related
Bug Description
When an
Agentis created withtoolsetspassed via the constructor (e.g.,SubagentToolsetConfig().get_provider()), the capability works. But when the session_pool path recreates the agent from manifest config, the toolsets are not preserved —SubagentToolscapability is lost.Failing Test
tests/tools/test_runcontext.py::test_capability_toolsThe test is currently marked
@pytest.mark.xfailwithreason="Test passes toolsets via Agent() constructor, but session_pool path recreates agent from manifest config (without toolsets). SubagentTools capability is lost. Fix: configure SubagentToolsetConfig in manifest.tools."Verification
Confirmed still failing on
main(commit 67710ea) via--runxfail:Root Cause (preliminary)
The xfail reason identifies the issue clearly:
Agentwithtoolsets=[subagent.get_provider()]via constructorsession_poolexecution path recreates the agent frommanifestconfigSubagentToolsetConfiginmanifest.toolsSubagentToolscapability → thelist_available_nodestool is not registered → the model cannot call it → no final message producedSuggested Fix
Per the xfail reason: "Fix: configure SubagentToolsetConfig in manifest.tools."
Either:
Related
tests/tools/test_runcontext.py:96