Add a shared get_app_parameters() resolver that maps any app type to its
webapp parameters, and route the web, service-API and explore /parameters
endpoints through it. Agent Apps have neither a workflow nor a legacy
app_model_config, so their presentation features (opening statement,
suggestions, file upload, ...) default to disabled with a free-form chat
input until a dedicated config surface lands.
This unblocks the public web app and service API for Agent Apps: /parameters
now returns a valid config instead of 500-ing on the missing app_model_config.
Live-verified end-to-end via the web app entry (passport -> parameters ->
streamed chat) and /v1/parameters. Unit tests cover all four resolver
branches (workflow, easy-UI config, agent defaults, unavailable).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Allow AppMode.AGENT through the console conversation-log, message-log and
average-session-interaction mode gates so an Agent App's conversations and
messages show up in the app logs and statistics, same as chat / agent-chat.
Token/message/conversation daily statistics already accept any mode.
Live-verified: conversation list, message history (multi-turn memory intact)
and conversation detail all return for an Agent App.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Route AppMode.AGENT through AppGenerateService to a new AgentAppGenerator
that resolves the bound roster Agent + published Soul snapshot, synthesizes
an EasyUI-shaped app config from the Soul, and drives one conversation turn
via AgentAppRunner against the dify-agent backend (streamed message +
message_end over the existing chat SSE pipeline).
- AgentAppGenerator + AgentAppGenerateResponseConverter
- AgentAppGenerateEntity (agent_id + agent_config_snapshot_id)
- console chat-messages: accept AppMode.AGENT; make model_config optional
(Agent Apps derive model/prompt from the Soul, not an override config)
- synthesize prompt_type=simple and NULL app_model_config_id so the
conversation persists without a legacy app_model_config row
Live-verified end-to-end against the real agent backend: single-turn,
multi-turn resume (history preserved, session reused), and the runtime
session row persists with owner_type=conversation and an intact snapshot
(no "cleaned trap").
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
First slice of the Agent App type (新 Agent 作为独立 App 类型,替代
chatbot/agent-legacy/completion). Design:
https://km.dify.langgenius.ai/wiki/spaces/DT/pages/460161070/Agent+App+Type
* New ``AppMode.AGENT = "agent"`` (distinct from legacy ``agent-chat`` ReAct
app). Runtime model/prompt/tools live in the bound Agent Soul, so the
default template seeds no model_config.
* Create flow: creating an Agent App also creates a roster Agent bound 1:1 via
``Agent.app_id`` (decision Q1), inside the same transaction so app + backing
agent persist atomically. ``AgentRosterService.create_backing_agent_for_app``
builds the agent + a v1 (empty) Agent Soul snapshot without committing; the
user configures model/prompt/tools afterward in the Composer.
* ``App.bound_agent_id`` resolves the backing roster Agent from the app id (so
the console can open the Composer in roster-detail mode); surfaced on the app
detail response. Returns None for non-agent apps (short-circuits, no DB hit).
* ``CreateAppParams`` / ``AppListParams`` accept "agent"; list filter handles it.
Scope: S1 only (foundation). Runtime/preview, web/service API, access &
sharing, logs and feature flags land in S2–S7 per the design.
Tests: roster backing-agent build/link/get + enum/template/params/bound_agent_id
short-circuit. 46 passing in app + agent service suites; ruff + pyrefly clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>