dify/api/tests/unit_tests
Jyong 57d03faa98 fix(workflow): let the KnowledgeFS retrieval node run on text or image alone
The KnowledgeFS retrieval node treated the query text as mandatory even though
a query image is a complete input on its own. Text and image are now
alternatives: the node needs at least one of them, never both.

- web: drop the required mark from the query text field; the checklist fails
  only when neither variable is bound (new i18n message in every locale).
- api: make `query_variable_selector` optional with a model-level rule that
  one of the two selectors must be set, and only map the query variable when
  it is bound. At runtime an empty text without images is a configuration
  error; an image-only query retrieves with an empty text, merges spaces on
  their own scores instead of a text reranker, skips automatic metadata
  extraction, and skips the text-based failed-query capture.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-03 01:52:19 -04:00
..
clients test: enforce centralized config overrides (#40869) 2026-08-29 14:05:35 +00:00
commands Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-01 09:45:49 +08:00
configs fix(knowledge-fs): align retrieval test timeout 2026-09-01 13:51:15 -04:00
controllers Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-02 21:56:53 +08:00
core fix(workflow): let the KnowledgeFS retrieval node run on text or image alone 2026-09-03 01:52:19 -04:00
dev feat(knowledge-fs): add migration to merge agent drive and KnowledgeFS heads 2026-08-20 11:04:02 +08:00
enterprise/telemetry fix: add missing metrics back and enhance typing (#40935) 2026-08-21 09:46:45 +00:00
enums test: use typed config overrides in service coverage (#40848) 2026-08-18 11:59:58 +00:00
events Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-02 10:31:10 +08:00
extensions Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-02 10:31:10 +08:00
factories fix(api): align Service API OpenAPI contract (#41248) 2026-08-25 10:54:14 +00:00
fields test: migrate residual model sessions and ORM models to SQLite (#40531) 2026-08-18 12:23:02 +00:00
libs Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-02 21:56:53 +08:00
machinery refactor(api): move account lifecycle into application services (#40438) 2026-08-21 08:05:43 +00:00
migrations test(knowledge-fs): track latest database migration 2026-09-02 22:15:18 +08:00
models Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-02 10:31:10 +08:00
oss test: eliminate remaining whole config mocks (#40855) 2026-08-18 12:01:49 +00:00
providers/trace/unified_trace feat(trace): add provider-neutral unified tracing (#39451) 2026-08-21 11:28:18 +00:00
repositories Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-02 21:56:53 +08:00
services fix(knowledge-fs): allow one unresolved bad case per retrieval trace 2026-09-03 01:40:11 -04:00
tasks fix(knowledge-fs): reconcile main merge regressions 2026-09-01 10:10:52 +08:00
tools fix: fix mcp output_schema is optional (#39453) 2026-07-28 02:31:18 +00:00
utils test: move pure integration cases to unit tests (#40705) 2026-08-25 06:19:48 +00:00
__init__.py
.gitignore
.ruff.toml refactor(api): replace legacy recommended app retrieval stack (#40395) 2026-08-20 13:13:43 +00:00
config_override.py test: enforce centralized config overrides (#40869) 2026-08-29 14:05:35 +00:00
conftest.py test: enforce centralized config overrides (#40869) 2026-08-29 14:05:35 +00:00
pyrefly.toml refactor(api): decouple system features and web adapters (#40772) 2026-09-01 11:50:52 +00:00
test_app_factory.py test: enforce centralized config overrides (#40869) 2026-08-29 14:05:35 +00:00
test_config_overrides.py test: enforce centralized config overrides (#40869) 2026-08-29 14:05:35 +00:00
test_constants.py test: enforce centralized config overrides (#40869) 2026-08-29 14:05:35 +00:00
test_makefile_backend_tests.py
test_pytest_dify.py refactor: thread explicit sessions through app retrieval paths (#38309) 2026-07-02 17:00:47 +00:00
test_sqlite_fixtures.py test: share unbound unit test sessions (#39690) 2026-07-28 14:12:08 +00:00