dify/api/models
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
..
utils chore(api): Upgrade graphon to v0.5.1 (#37168) 2026-06-11 07:37:27 +00:00
__init__.py feat(web): refine onboarding UI (#37433) 2026-06-15 08:47:15 +00:00
_workflow_exc.py feat: Persist Variables for Enhanced Debugging Workflow (#20699) 2025-06-24 09:05:29 +08:00
account.py feat(web): refine onboarding UI (#37433) 2026-06-15 08:47:15 +00:00
agent_config_entities.py feat(agent): Skills & Files effective chain — drive runtime exposure, inspector, lifecycle, infer-tools (#37370) 2026-06-13 02:30:55 +00:00
agent.py feat(api): Agent ask_human HITL (phase-1) — workflow node + Agent v2 chat — ENG-635 (#37437) 2026-06-16 03:43:40 +00:00
api_based_extension.py fix: use default_factory for callable defaults in ORM dataclasses (#28730) 2025-11-27 09:39:49 +09:00
base.py ci: add flag for linter (#37018) 2026-06-08 04:53:12 +00:00
comment.py chore: port WorkflowComment (#36039) 2026-05-11 09:17:12 +00:00
credential_permission.py feat: per-credential visibility control for plugin credentials (#35468) 2026-06-01 05:56:18 +00:00
dataset.py ci: add flag for linter (#37018) 2026-06-08 04:53:12 +00:00
engine.py feat(api): Add image multimodal support for LLMNode (#17372) 2025-04-30 17:28:02 +08:00
enums.py ci: add flag for linter (#37018) 2026-06-08 04:53:12 +00:00
execution_extra_content.py refactor: migrate execution extra content repository tests from mocks to testcontainers (#33852) 2026-03-23 17:32:11 +09:00
human_input.py fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms 2026-06-16 16:11:29 -07:00
model.py feat(web): refine onboarding UI (#37433) 2026-06-15 08:47:15 +00:00
oauth.py feat: per-credential visibility control for plugin credentials (#35468) 2026-06-01 05:56:18 +00:00
provider_ids.py ci: add flag for linter (#37018) 2026-06-08 04:53:12 +00:00
provider.py ci: add flag for linter (#37018) 2026-06-08 04:53:12 +00:00
snippet.py feat: snippet (#37046) 2026-06-05 09:38:42 +00:00
source.py refactor: replace bare dict with dict[str, Any] in models, providers, extensions, libs, and test utilities (#35186) 2026-04-14 17:51:25 +00:00
task.py fix: use default_factory for callable defaults in ORM dataclasses (#28730) 2025-11-27 09:39:49 +09:00
tools.py feat(api): add MCP user-identity forwarding (#36839) 2026-06-08 04:32:11 +00:00
trigger.py feat: per-credential visibility control for plugin credentials (#35468) 2026-06-01 05:56:18 +00:00
types.py refactor: add missing @override decorators to TypeDecorator subclasses in models/types.py (#36565) 2026-05-24 08:00:40 +00:00
web.py refactor(api): Query API to select function_1 (#33565) 2026-03-17 23:29:16 +09:00
workflow.py fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +00:00