FLEXIBLE_AGENT_TESTS_PLAN

FLEXIBLE_AGENT_TESTS_PLAN.md

Goal

Migrate agent tests from integration (test/integration/test_agents_static.py) to API (lib/galaxy_test/api/test_agents.py). Tests should:

Steps

1. Move static YAML to shared test data location

2. Inject static agent config in driver_util.py

In setup_galaxy_config(), add inference_services to the returned config dict:

static_agents_path = os.path.join(os.path.dirname(__file__), "..", "base", "data", "static_agents.yml")
config["inference_services"] = {"static_responses": os.path.realpath(static_agents_path)}

This gives all API and Selenium tests a working agent backend by default. No env vars needed.

3. Create lib/galaxy_test/api/test_agents.py

New API test class TestAgentsApi(ApiTestCase):

Tests to migrate:

Integration testAPI testStatic assertionDefault (LLM) assertion
test_config_reports_llm_configuredtest_configuration_reports_agentsllm_registry_type == "static"llm_api_configured is True only
test_list_agentstest_list_agentsrouter and error_analysis in typesagent list non-empty
test_chat_greetingtest_chat_greeting"Hello" in contentresponse has non-empty content
test_chat_rnaseqtest_chat_domain_query"HISAT2" in contentresponse has non-empty content
test_chat_fallbacktest_chat_fallback"Galaxy" in content or non-emptyresponse has non-empty content
test_static_backend_metadatatest_response_metadatametadata.static_backend is Truemetadata dict exists
test_custom_tool_agenttest_custom_tool_agentexact tool_id, tool_yaml, suggestion checksresponse has metadata with tool_id
test_list_agents_includes_custom_tooltest_list_agents_includes_custom_tool"custom_tool" in types"custom_tool" in types (both backends should have it)
test_error_analysis_agenttest_error_analysis_agent"error" or "configuration" in contentnon-empty content

4. Delete integration test

5. Run tests

File changes summary

FileAction
lib/galaxy_test/base/data/static_agents.ymlNEW — copy from test/integration/
lib/galaxy_test/driver/driver_util.pyEDIT — inject inference_services in setup_galaxy_config()
lib/galaxy_test/api/test_agents.pyNEW — flexible API tests
test/integration/test_agents_static.pyDELETE
test/integration/static_agents.ymlDELETE

Notes

Unresolved questions