Skip to content

fix(apps): allow unset model selections in list and detail responses - #46593

Merged
lyzno1 merged 6 commits into
mainfrom
codex/cus-1814-unset-model-response
Nov 17, 2026
Merged

lyzno1 merged 6 commits into
mainfrom
codex/cus-1814-unset-model-response

Conversation

@lyzno1

@lyzno1 lyzno1 commented Nov 17, 2026

Copy link
Copy Markdown
Member

An app whose stored model selection contains provider: null or name: null fails response validation, preventing the entire Studio app list and the affected app's detail response from loading. Allow nullable identifiers in the response-only model selection schema so these apps remain readable and can be configured through the existing editor.

Preserve the stored selection and other configuration fields, and regenerate the OpenAPI documentation and TypeScript/Zod contracts. Write and execution validation are unchanged. Error classification, diagnostic logging, and list error presentation are outside this fix.

Fixes https://linear.app/dify/issue/CUS-1814
Related: https://linear.app/dify/issue/CUS-1810

Validation

  • Reproduced the regression before the schema change: explicit null identifiers fail while omitted identifiers pass.
  • Backend app controller/response and existing model configuration tests: 119 passed. Regression cases cover mixed pagination, detail responses, explicit null identifiers, omitted identifiers, empty/missing models, normal models, and preserved storage; invalid non-string identifiers remain rejected.
  • Schema/OpenAPI tests: 131 passed. Regenerated API contracts and documentation; response contract lint passed.
  • Configuration page suite: 22 passed, including opening an agent with null model identifiers, choosing a model, and submitting it while preserving the prompt. This uses mocked service boundaries, not a deployed end-to-end session.
  • Repository static checks, Web/contracts type checks, targeted Ruff checks, and the response schema's Python type check passed. The backend test file has 84 existing type diagnostics; comparison against the base revision found no added diagnostics.

Draft pending review and real API/UI verification in the affected environment. No customer data was modified and recovery has not been confirmed in production.

@github-actions github-actions Bot added size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-11-17 13:47:11.646017263 +0000
+++ /tmp/pyrefly_pr.txt	2026-11-17 13:46:49.174093737 +0000
@@ -2001,7 +2001,7 @@
 ERROR Object of class `App` has no attribute `permission_keys` [missing-attribute]
     --> tests/unit_tests/controllers/console/app/test_app.py:1076:9
 ERROR `str` is not assignable to dict key `strategy` with type `bool | list[Unknown]` [bad-assignment]
-    --> tests/unit_tests/controllers/console/app/test_app.py:1114:38
+    --> tests/unit_tests/controllers/console/app/test_app.py:1166:38
 ERROR Missing argument `app_model` in function `controllers.console.app.workflow.EvaluationPublishedWorkflowApi.post` [missing-argument]
     --> tests/unit_tests/controllers/console/app/test_workflow.py:1419:30
 ERROR Missing argument `app_model` in function `controllers.console.app.workflow.WorkflowKindConvertApi.post` [missing-argument]

@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 86.70% 86.70% +0.00%
Strict coverage 86.36% 86.36% +0.00%
Typed symbols 94,232 94,237 +5
Untyped symbols 14,508 14,508 0
Modules 4605 4605 0

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.25%. Comparing base (fda2e1f) to head (0fe484a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #46593   +/-   ##
=======================================
  Coverage   90.25%   90.25%           
=======================================
  Files        6438     6438           
  Lines      405444   405444           
  Branches    81522    81522           
=======================================
  Hits       365934   365934           
+ Misses      33108    33106    -2     
- Partials     6402     6404    +2     
Flag Coverage Δ
api 90.03% <100.00%> (-0.01%) ⬇️
cli 94.30% <ø> (ø)
dify-ui 92.65% <ø> (ø)
web 90.36% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 17, 2026
@lyzno1
lyzno1 marked this pull request as ready for review November 17, 2026 11:05
@lyzno1
lyzno1 added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@lyzno1
lyzno1 added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@lyzno1
lyzno1 added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@lyzno1
lyzno1 added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@lyzno1
lyzno1 enabled auto-merge November 17, 2026 12:10
@hyoban hyoban mentioned this pull request Nov 17, 2026
3 of 5 tasks
@lyzno1
lyzno1 added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@lyzno1
lyzno1 enabled auto-merge November 17, 2026 13:48
@lyzno1 lyzno1 added this to the 1.20.0 milestone Nov 17, 2026
@lyzno1
lyzno1 added this pull request to the merge queue Nov 17, 2026
@hyoban hyoban mentioned this pull request Nov 17, 2026
3 of 5 tasks
Merged via the queue into main with commit baabe8e Nov 17, 2026
110 of 112 checks passed
@lyzno1
lyzno1 deleted the codex/cus-1814-unset-model-response branch November 17, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants