Skip to content

fix: normalize query array params for oRPC#38322

Merged
hyoban merged 4 commits into
mainfrom
codex/fix-orpc-query-array-params
Jul 2, 2026
Merged

fix: normalize query array params for oRPC#38322
hyoban merged 4 commits into
mainfrom
codex/fix-orpc-query-array-params

Conversation

@hyoban

@hyoban hyoban commented Jul 2, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

  • Normalize backend console query array parsing to repeated query parameters for generated oRPC clients.
  • Remove backend support for indexed bracket and comma-split array query forms while preserving existing parameter names and scalar aliases.
  • Add a temporary frontend OpenAPI URL normalizer so current oRPC indexed query arrays are sent as repeated query params.

Fixes #38318

Screenshots

Before After
N/A N/A

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Validation performed:

  • uv run --project api pytest api/tests/unit_tests/controllers/console/app/test_app_response_models.py api/tests/unit_tests/controllers/console/snippets/test_snippet_list_query.py api/tests/unit_tests/controllers/console/workspace/test_snippets.py api/tests/unit_tests/controllers/console/agent/test_agent_controllers.py api/tests/unit_tests/controllers/console/workspace/test_tool_providers.py
  • uv run --project api ruff check api/controllers/console/app/app.py api/controllers/console/agent/roster.py api/controllers/console/snippets/payloads.py api/controllers/console/workspace/snippets.py api/controllers/console/workspace/tool_providers.py api/tests/unit_tests/controllers/console/app/test_app_response_models.py api/tests/unit_tests/controllers/console/snippets/test_snippet_list_query.py api/tests/unit_tests/controllers/console/workspace/test_snippets.py api/tests/unit_tests/controllers/console/agent/test_agent_controllers.py api/tests/unit_tests/controllers/console/workspace/test_tool_providers.py
  • pnpm test service/client.spec.ts
  • pnpm exec eslint service/client.ts service/client.spec.ts service/console-openapi-url.ts
  • pnpm type-check

From Codex

@github-actions github-actions Bot added the web This relates to changes on the web. label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 51.95% 51.95% +0.00%
Strict coverage 51.46% 51.46% +0.00%
Typed symbols 31,643 31,647 +4
Untyped symbols 29,548 29,550 +2
Modules 2954 2954 0

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-07-02 10:32:18.042736263 +0000
+++ /tmp/pyrefly_pr.txt	2026-07-02 10:32:09.399819511 +0000
@@ -1,3 +1,5 @@
+ERROR `dict[str, str]` is not assignable to `dict[str, list[str] | str]` [bad-assignment]
+   --> controllers/console/workspace/snippets.py:145:46
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]
   --> providers/vdb/vdb-alibabacloud-mysql/tests/unit_tests/test_alibabacloud_mysql_factory.py:42:38
 ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_alibabacloud_mysql.alibabacloud_mysql_vector.AlibabaCloudMySQLVectorFactory.init_vector` [bad-argument-type]

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.29%. Comparing base (88864ae) to head (29f8827).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
api/controllers/console/agent/roster.py 84.61% 1 Missing and 1 partial ⚠️
api/controllers/console/snippets/payloads.py 77.77% 1 Missing and 1 partial ⚠️
api/controllers/console/app/app.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #38322   +/-   ##
=======================================
  Coverage   85.29%   85.29%           
=======================================
  Files        4980     4981    +1     
  Lines      263365   263321   -44     
  Branches    50039    50026   -13     
=======================================
- Hits       224625   224588   -37     
+ Misses      34348    34345    -3     
+ Partials     4392     4388    -4     
Flag Coverage Δ
api 85.52% <86.48%> (-0.01%) ⬇️
dify-ui 94.93% <ø> (ø)
web 84.86% <100.00%> (+<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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyoban hyoban marked this pull request as ready for review July 2, 2026 10:51
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 2, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 2, 2026
@hyoban hyoban enabled auto-merge July 2, 2026 10:51
@hyoban hyoban added this pull request to the merge queue Jul 2, 2026
Merged via the queue into main with commit 3f92e38 Jul 2, 2026
42 checks passed
@hyoban hyoban deleted the codex/fix-orpc-query-array-params branch July 2, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer 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.

[Refactor/Chore] Normalize query array parsing for generated oRPC clients

2 participants