Skip to content

[codex] Default null summary index setting to disabled#36820

Draft
QuantumGhost wants to merge 5 commits into
langgenius:mainfrom
QuantumGhost:fix/invalid-enable-value
Draft

[codex] Default null summary index setting to disabled#36820
QuantumGhost wants to merge 5 commits into
langgenius:mainfrom
QuantumGhost:fix/invalid-enable-value

Conversation

@QuantumGhost
Copy link
Copy Markdown
Contributor

@QuantumGhost QuantumGhost commented May 29, 2026

AI disclosure: This PR was AI-assisted with Codex using GPT-5.5. I have reviewed the final diff, and I am responsible for the content.

Summary

This PR fixes the Console dataset detail response for legacy datasets whose summary_index_setting is stored as NULL.

A NULL summary index setting means summary index generation is not configured and should behave as disabled. The response currently exposes that storage detail as enable: null, which gives Console clients an ambiguous boolean value and can be propagated into follow-up requests such as /datasets/indexing-estimate.

Fix

  • Default DatasetSummaryIndexSettingResponse.enable to false.
  • Keep nullable storage semantics inside the backend persistence layer.
  • Remove the estimate-request input workaround for { "enable": null }, so the API output contract is responsible for producing a valid disabled setting.
  • Update field serialization coverage for summary_index_setting = NULL.
  • Add a controller round-trip regression test: read dataset detail, reuse the returned summary_index_setting in an indexing estimate request, and verify the estimate path accepts the normalized disabled setting.

Validation

DEBUG=false uv run --project api pytest api/tests/unit_tests/fields/test_dataset_fields.py api/tests/unit_tests/services/test_dataset_service_document.py::TestDocumentServiceEstimateValidation api/tests/unit_tests/controllers/console/datasets/test_datasets.py::TestDatasetIndexingEstimateApi -q
DEBUG=false uv run --project api ruff check api/fields/dataset_fields.py api/services/dataset_service.py api/tests/unit_tests/fields/test_dataset_fields.py api/tests/unit_tests/controllers/console/datasets/test_datasets.py api/tests/unit_tests/services/test_dataset_service_document.py

Closes #36813

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-05-29 08:50:34.443805167 +0000
+++ /tmp/pyrefly_pr.txt	2026-05-29 08:50:25.516733814 +0000
@@ -565,11 +565,11 @@
 ERROR Argument `str | None` is not assignable to parameter `value` with type `SQLCoreOperations[str] | str` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
    --> services/conversation_service.py:131:33
 ERROR `dict[str, dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
-    --> services/dataset_service.py:2232:56
+    --> services/dataset_service.py:2202:56
 ERROR `dict[str, dict[str, Any] | str | None]` is not assignable to variable `data_source_info` with type `dict[str, bool | str]` [bad-assignment]
-    --> services/dataset_service.py:2745:44
+    --> services/dataset_service.py:2715:44
 ERROR `None` is not assignable to attribute `rules` with type `Never` [bad-assignment]
-    --> services/dataset_service.py:2920:51
+    --> services/dataset_service.py:2890:51
 ERROR Class member `DocumentIndexingTaskProxy.NORMAL_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
   --> services/document_indexing_proxy/document_indexing_task_proxy.py:11:5
 ERROR Class member `DocumentIndexingTaskProxy.PRIORITY_TASK_FUNC` overrides parent class `BatchDocumentIndexingProxy` in an inconsistent manner [bad-override]
@@ -2066,6 +2066,8 @@
    --> tests/unit_tests/controllers/console/app/test_wraps.py:148:26
 ERROR Cannot set item in `OrderedDict[str, bool | list[str] | str]` [unsupported-operation]
    --> tests/unit_tests/controllers/console/app/workflow_draft_variables_test.py:137:47
+ERROR Unpacked `dict[str, str | dict[str, list[dict[str, bool | str]] | dict[str, int | str]]]` is not assignable to `dict[str, int]` [bad-unpacking]
+    --> tests/unit_tests/controllers/console/datasets/test_datasets.py:1312:35
 ERROR Object of class `BytesIO` has no attribute `filename` [missing-attribute]
    --> tests/unit_tests/controllers/console/explore/test_trial.py:651:9
 ERROR Object of class `BytesIO` has no attribute `filename` [missing-attribute]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 45.75% 45.75% +0.00%
Strict coverage 45.28% 45.28% +0.00%
Typed symbols 24,633 24,634 +1
Untyped symbols 29,512 29,513 +1
Modules 2760 2760 0

@github-actions github-actions Bot added the web This relates to changes on the web. label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset detail response exposes null summary_index_setting enable

1 participant