dify/api/core/app/entities
GareArc f533e992d4
fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms
Pause-time token emission now draws only from the recipient set each API
surface is allowed to act on (emit ⊆ validate), so the CLI/OpenAPI caller is
never handed a token the resume endpoint would reject as 404 (WTA-867).

A form's recipients are partitioned once, per surface, into a single
FormDisposition: the surface-actionable recipient yields `form_token`, while
the rest are reported as `approval_channels` (e.g. ["email", "console"]) so the
caller is told where approval actually happens. Token and channels are two
projections of one decision (disposition_for_surface) loaded by one recipient
query (load_form_dispositions_by_form_id); the live pause path and the
reconnect snapshot path consume the same FormDisposition so they cannot drift.

RecipientType carries its user-facing approval-channel label as an enum tuple
value, set in __new__, so a new recipient type cannot be declared without one.

Tests: consolidate recipient/disposition/enrich tests into parametrized
matrices, add CONSOLE-surface and empty-token coverage, extract a shared fake
session for the pause-event tests.
2026-06-16 16:11:29 -07:00
..
__init__.py refactor(workflow): move agent node back to core workflow (#33431) 2026-03-14 22:33:13 +08:00
agent_strategy.py refactor(workflow): move agent node back to core workflow (#33431) 2026-03-14 22:33:13 +08:00
app_invoke_entities.py feat(api): forward user_type for MCP identity forwarding (webapp end-users) (#37347) 2026-06-12 07:30:15 +00:00
queue_entities.py feat(api): introduce select, file and file list form input types to Human Input node (#36322) 2026-06-04 01:54:28 +00:00
rag_pipeline_invoke_entities.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
task_entities.py fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms 2026-06-16 16:11:29 -07:00