Skip to content

Commit 1307f8e

Browse files
committed
Fix --reload_agents for web
Change-Id: If31a5e5a30ab8c3ee5480494e6d42e7c21240429
1 parent 1ba5863 commit 1307f8e

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

src/google/adk/cli/fast_api.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from ..auth.credential_service.in_memory_credential_service import InMemoryCredentialService
4141
from ..runners import Runner
4242
from .api_server import ApiServer
43+
from .dev_server import DevServer
4344
from .service_registry import load_services_module
4445
from .utils import envs
4546
from .utils.agent_change_handler import AgentChangeEventHandler
@@ -513,26 +514,10 @@ def get_fast_api_app(
513514
# Build the Credential service
514515
credential_service = InMemoryCredentialService()
515516

516-
# Conditionally import and instantiate the appropriate server class
517+
# Instantiate the appropriate server class based on web option
517518
# If web=True, use DevServer (includes all endpoints: production + dev)
518519
# If web=False, use ApiServer (production-safe endpoints only)
519-
if web:
520-
try:
521-
from .dev_server import DevServer
522-
523-
ServerClass = DevServer
524-
except ImportError:
525-
logger.warning(
526-
"DevServer not found, falling back to ApiServer. "
527-
"Dev-only endpoints will not be available."
528-
)
529-
from .api_server import ApiServer
530-
531-
ServerClass = ApiServer
532-
else:
533-
from .api_server import ApiServer
534-
535-
ServerClass = ApiServer
520+
ServerClass = DevServer if web else ApiServer
536521

537522
adk_web_server = ServerClass(
538523
agent_loader=agent_loader,

0 commit comments

Comments
 (0)