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>
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>
Direction (your call): ride the existing chat (EasyUI) message + SSE pipeline,
synthesizing the app config from the Agent Soul rather than inventing a new
pipeline.
``AgentAppConfigManager`` shapes the Agent Soul (model + system prompt) plus any
app-level feature flags stored on ``app_model_config`` (Q3) into an
app_model_config-style dict, then reuses the same chat sub-managers
(ModelConfigManager / PromptTemplateConfigManager / features) to build an
EasyUI-shaped ``AgentAppConfig``. Model + prompt always come from the Soul
(single source of truth); feature flags from app_model_config when present.
Tests: 3 config-synthesis cases (soul model/prompt, feature-flag passthrough +
soul override, missing-model). ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
``AgentAppRunner`` runs one conversation turn against the dify-agent backend
(instead of the legacy in-process ReAct loop): load the conversation's prior
session_snapshot, build the run request (S2b), create the run, consume the
event stream, and republish the assistant answer as chat queue events
(``QueueLLMChunkEvent`` + ``QueueMessageEndEvent``) so the existing EasyUI chat
task pipeline persists the message and streams SSE. On success the conversation
session_snapshot is saved for multi-turn continuity; failures raise
AgentBackendError; the answer is normalized to text (plain string or structured
JSON).
MVP emits the final answer as one chunk + message-end; token-level streaming is
a follow-up refinement. The generator/entity/converter wiring + live-stack
verification land next.
Tests: 4 runner cases via the deterministic fake backend client + fake queue
(success→chunk+end+session-save, prior-snapshot threading, failure raises,
answer extraction). 15 agent_app unit tests green; ruff + pyrefly clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Q2 decision: unify the workflow-only ``workflow_agent_runtime_sessions`` into
an owner-agnostic ``agent_runtime_sessions`` table serving both owners. Feature
is unreleased, so the old table is dropped (no data migration).
* ``AgentRuntimeSession`` model (table ``agent_runtime_sessions``) with an
``owner_type`` discriminator (workflow_run | conversation): workflow columns
(workflow_id/run_id/node_id/binding_id/agent_config_snapshot_id/
composition_layer_specs) and ``conversation_id`` are mutually-exclusive,
enforced by two partial unique indexes. Back-compat aliases
``WorkflowAgentRuntimeSession`` / ``WorkflowAgentRuntimeSessionStatus`` keep
the shipped lifecycle path (PR #36724) unchanged; the workflow store now sets
``owner_type=workflow_run``.
* New ``AgentAppRuntimeSessionStore`` (conversation-keyed) for the Agent App
side of the same table: one conversation = one Agent session for multi-turn.
* Migration 121e7346074d (drop old + create unified) — applies and
downgrade/upgrade round-trips clean on Postgres.
Tests: 6 new conversation-store ORM round-trip tests; 154 existing workflow
lifecycle + agent_backend tests still green against the unified table.
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>
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>