dify/api/tests/unit_tests/core
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
..
agent feat(dify-agent): sync agent progress (#36633) 2026-05-26 03:14:10 +00:00
app fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms 2026-06-16 16:11:29 -07:00
base chore: add Type to test (#35942) 2026-05-09 03:16:22 +00:00
callback_handler chore: add Type to test (#35942) 2026-05-09 03:16:22 +00:00
datasource fix(api): centralize remote file retrieval (#36399) 2026-06-01 09:25:08 +00:00
entities perf(api): reduce workflow startup latency for chatflow (#36773) 2026-06-11 07:05:35 +00:00
extension chore: add Type to test (#35942) 2026-05-09 03:16:22 +00:00
external_data_tool ci: add flag for linter (#37018) 2026-06-08 04:53:12 +00:00
file fix(api): centralize remote file retrieval (#36399) 2026-06-01 09:25:08 +00:00
helper feat: support custom trace session id for Phoenix tracing (#37056) 2026-06-04 08:42:03 +00:00
llm_generator chore: fix use select style api in orm (#35531) 2026-04-24 08:35:20 +00:00
logging test: added for core logging and core mcp (#32478) 2026-03-12 11:44:56 +08:00
mcp feat(api): add MCP user-identity forwarding (#36839) 2026-06-08 04:32:11 +00:00
memory fix(api): "File validation failed" on Chatflow follow-up with custom file type + memory (#35891) 2026-05-11 01:57:56 +00:00
model_runtime chore(api): upgrade graphon to v0.3.0 (#35469) 2026-05-09 07:30:03 +00:00
moderation chore: add Type to test (#36454) 2026-05-21 19:25:03 +00:00
ops feat: support custom trace session id for Phoenix tracing (#37056) 2026-06-04 08:42:03 +00:00
plugin feat(web): refine onboarding UI (#37433) 2026-06-15 08:47:15 +00:00
prompt chore: add Type to test (#35942) 2026-05-09 03:16:22 +00:00
rag fix(watercrawl): accept content type parameters (#37500) 2026-06-16 08:16:24 +00:00
repositories fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms 2026-06-16 16:11:29 -07:00
schemas ci: add flag for linter (#37018) 2026-06-08 04:53:12 +00:00
telemetry chore: add Type to test (#35942) 2026-05-09 03:16:22 +00:00
tools chore(api): Fix several typing errors (#37248) 2026-06-12 14:02:09 +00:00
trigger chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
variables chore(api): upgrade graphon to v0.3.1 (#35987) 2026-05-11 05:32:17 +00:00
workflow fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms 2026-06-16 16:11:29 -07:00
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
test_file.py chore(api): adapt Graphon 0.2.2 upgrade (#35377) 2026-04-18 11:16:24 +00:00
test_model_manager.py fix: sync 35528 (#35539) 2026-04-24 03:59:33 +00:00
test_provider_configuration.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
test_provider_manager.py chore(api): upgrade graphon to v0.3.0 (#35469) 2026-05-09 07:30:03 +00:00
test_trigger_debug_event_selectors.py refactor(api): move workflow knowledge nodes and trigger nodes (#33445) 2026-03-15 15:24:59 +08:00