fix(api): add AGENT mode to app list filtering

Add AppMode.AGENT branch in get_paginate_apps() so that
filtering apps by mode=agent works correctly.
Discovered during comprehensive E2E testing.

14/14 E2E tests pass covering:
- A: New Agent app full lifecycle (create, draft, configs, publish, run)
- B: Old app creation compat (chat, completion, agent-chat, advanced-chat, workflow)
- C: App listing and filtering (all modes, agent filter)
- D: Workflow editor compat (block configs)
- E: DSL export

Made-with: Cursor
This commit is contained in:
Yansong Zhang
2026-04-09 10:54:05 +08:00
parent 66212e3575
commit edfcab6455

View File

@ -53,6 +53,8 @@ class AppService:
filters.append(App.mode == AppMode.ADVANCED_CHAT)
elif args["mode"] == "agent-chat":
filters.append(App.mode == AppMode.AGENT_CHAT)
elif args["mode"] == "agent":
filters.append(App.mode == AppMode.AGENT)
if args.get("is_created_by_me", False):
filters.append(App.created_by == user_id)