fix: resolve remaining CI failures

- app_model_config_service.py: add AppMode.AGENT to exhaustive match
- app_service.py: fix possibly unbound default_model_dict variable

Made-with: Cursor
This commit is contained in:
Yansong Zhang
2026-04-13 13:55:48 +08:00
parent 3e0578a1c6
commit 94b3087b98
2 changed files with 3 additions and 2 deletions

View File

@ -14,5 +14,5 @@ class AppModelConfigService:
return AgentChatAppConfigManager.config_validate(tenant_id, config)
case AppMode.COMPLETION:
return CompletionAppConfigManager.config_validate(tenant_id, config)
case AppMode.WORKFLOW | AppMode.ADVANCED_CHAT | AppMode.CHANNEL | AppMode.RAG_PIPELINE:
case AppMode.WORKFLOW | AppMode.ADVANCED_CHAT | AppMode.AGENT | AppMode.CHANNEL | AppMode.RAG_PIPELINE:
raise ValueError(f"Invalid app mode: {app_mode}")

View File

@ -173,7 +173,8 @@ class AppService:
db.session.commit()
if app_mode == AppMode.AGENT:
self._init_agent_workflow(app, account, default_model_dict if default_model_config else None)
model_dict = default_model_config.get("model") if default_model_config else None
self._init_agent_workflow(app, account, model_dict)
app_was_created.send(app, account=account)