dify/api/tests/unit_tests
Jyong afa771dcac feat(knowledge-fs): keep query images with retrieval test history
Query images attached to a retrieval test vanished as soon as the run's
history record was selected, and were never shown again after a reload,
because nothing persisted them: the gateway dropped `queryImages` when writing
`answer_traces`, the console trace/research responses had no image field, and
the composer cleared its images on every record selection.

- knowledge-fs: add a nullable JSON `query_images` column to `answer_traces`
  (migration 0049 for postgres and tidb), persist and read it in the answer
  trace repository, and expose `queryImages` on quality trace list items.
- api: enrich trace and research task responses with
  `KnowledgeFSQueryImageResponse`, resolving file names and short-lived signed
  preview URLs only for files the acting account still owns; regenerate the
  console and service contracts.
- web: keep composer images scoped to the selected record like the query
  text, remember images per run in this session, fall back to persisted
  previews (with a labelled placeholder when the file is gone), show them in
  the result panel and as a count on history records, and carry them into
  retests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-02 09:17:36 -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 feat(knowledge-fs): add profile-driven multimodal retrieval 2026-09-02 01:01:57 -04:00
core feat(knowledge-fs): add automatic metadata filtering to retrieval node 2026-09-02 02:55:12 -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 10:31:10 +08:00
machinery refactor(api): move account lifecycle into application services (#40438) 2026-08-21 08:05:43 +00:00
migrations test(knowledge-fs): align sync policy expectations 2026-08-28 15:09:44 +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 10:31:10 +08:00
services feat(knowledge-fs): keep query images with retrieval test history 2026-09-02 09:17:36 -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