Skip to content

Commit bfc8356

Browse files
MackinnonBuckCopilot
authored andcommitted
Fix Python E2E agent list test for built-in agents
The CLI now returns built-in/default agents even when no custom agents are configured. Update the assertion to verify no custom test agent names appear in the list, rather than asserting the list is empty. Matches the pattern used in the Go E2E test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2a92862 commit bfc8356

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/e2e/test_agent_and_compact_rpc.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async def test_should_deselect_current_agent(self):
147147

148148
@pytest.mark.asyncio
149149
async def test_should_return_empty_list_when_no_custom_agents_configured(self):
150-
"""Test listing agents returns empty when none configured."""
150+
"""Test listing agents returns no custom agents when none configured."""
151151
client = CopilotClient(SubprocessConfig(cli_path=CLI_PATH, use_stdio=True))
152152

153153
try:
@@ -157,7 +157,13 @@ async def test_should_return_empty_list_when_no_custom_agents_configured(self):
157157
)
158158

159159
result = await session.rpc.agent.list()
160-
assert result.agents == []
160+
# The CLI may return built-in/default agents even when no custom agents
161+
# are configured. Verify no custom test agents appear in the list.
162+
custom_names = {"test-agent", "another-agent"}
163+
for agent in result.agents:
164+
assert agent.name not in custom_names, (
165+
f"Expected no custom agents, but found {agent.name!r}"
166+
)
161167

162168
await session.disconnect()
163169
await client.stop()

0 commit comments

Comments
 (0)