Commit Graph

6534 Commits

Author SHA1 Message Date
Charles Yao
90567c537f feat(api): forward user_type for MCP identity forwarding
issue_mcp_token gains a user_type field (account|end_user), derived from
invoke_from ({DEBUGGER,EXPLORE}->account else end_user) so the enterprise side
routes webapp end-users to the published-webapp token store.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 00:41:35 +02:00
GareArc
83f287ef48
Merge branch 'feat/openapi-error-contract' into deploy/enterprise 2026-06-11 00:53:34 -07:00
zyssyz123
fb39df49c8
feat(agent): support cli tool scoped env (#37324)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-11 07:14:39 +00:00
呆萌闷油瓶
c4a8d79be9
perf(api): reduce workflow startup latency for chatflow (#36773)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-11 07:05:35 +00:00
autofix-ci[bot]
4b836b56a9
[autofix.ci] apply automated fixes 2026-06-11 06:06:40 +00:00
GareArc
9e0e23a339
feat(api): expose OpenApiErrorCode enum as standalone swagger definition 2026-06-10 22:49:50 -07:00
盐粒 Yanli
d3977cea77
fix(api): handle agent deferred tool events (#37319) 2026-06-11 05:18:43 +00:00
Yunlu Wen
84490179b0
feat: trace document retrieval (#37283) 2026-06-11 02:39:59 +00:00
GareArc
5b75aae20d
test: dedupe error-path test helpers in cli and api 2026-06-10 19:06:59 -07:00
chariri
2a46a7d91d
refactor(api): migrate remaining console APIs to use injected user/tenant (#37288) 2026-06-11 01:30:31 +00:00
GareArc
67229339cb
refactor(openapi): own FilenameNotExists error instead of touching the shared class
controllers/common/errors.py is consumed by other controllers; keep it
untouched and declare the openapi-surface error as an OpenApiError
subclass. Wire output is identical.
2026-06-10 04:34:46 -07:00
GareArc
57fb121f8a
fix(api): add override decorators and refresh generated contract after main merge 2026-06-10 04:24:38 -07:00
GareArc
0c661ac06b
Merge remote-tracking branch 'origin/main' into feat/openapi-error-contract 2026-06-10 04:17:37 -07:00
GareArc
525d706bad
fix(openapi): harden formatter against malformed details and document bypass paths
Review follow-ups:
- finalize() now falls back to a minimal status-derived body instead of
  letting a ValidationError escape the framework error handler when an
  already-rewritten e.data carries malformed canonical details
- document that a pre-built e.response bypasses the body formatter
- note the promote-to-libs seam for transport-generic codes in the module
  docstring
- CLI: skip the loc prefix when a server error detail has an empty loc
2026-06-10 04:04:17 -07:00
GareArc
50573c78b9
docs(openapi): state the ErrorBody field table in the contract module docstring 2026-06-10 03:42:48 -07:00
zyssyz123
2c5c8e82c3
feat: agent slash menu backend (#37268)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-10 10:40:03 +00:00
非法操作
6658a7c5e7
fix: block frozen deleted accounts during invite activation (#37281) 2026-06-10 10:21:05 +00:00
GareArc
27bbbbcf4b
feat(openapi): document canonical error schema in swagger via contract decorators
@accepts(query/body) now emits a 422 response with ErrorBody; @returns emits a
default error response with ErrorBody. ErrorBody (and auto-promoted ErrorDetail)
are registered in openapi_ns so they appear in definitions and are reachable from
both error response entries.
2026-06-10 03:15:45 -07:00
GareArc
40df3c26c6
test(openapi): pin error-path matrix to canonical wire codes
Adds TestErrorMatrix (23 parametrized rows) covering every exception class
raised or mapped in files.py and app_run.py, asserting the exact wire code
each path emits and that every emitted code is an OpenApiErrorCode member.
Also adds error_code = "filename_not_exists" to FilenameNotExistsError, which
had no explicit code and was falling through to the status-map (bad_request).
2026-06-10 03:04:43 -07:00
GareArc
8cf49238af
refactor(openapi): route member-quota errors through the canonical formatter
Replaces the _quota_error/.response hack in workspaces.py with two
throwable OpenApiError subclasses (MemberLimitExceeded,
MemberLicenseExceeded) so all 403 quota responses flow through
OpenApiErrorFormatter rather than bypassing it via the early-return
in external_api.py. Wire codes rename to member_limit_exceeded and
member_license_exceeded.
2026-06-10 02:54:28 -07:00
Yunlu Wen
0a051b598f
feat: support import / export dsl in CLI (#37232)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
Co-authored-by: cheatofrom <85830867+cheatofrom@users.noreply.github.com>
Co-authored-by: Escape0707 <tothesong@gmail.com>
Co-authored-by: Rohit Gahlawat <personal.rg56@gmail.com>
Co-authored-by: L1nSn0w <l1nsn0w@qq.com>
Co-authored-by: 盐粒 Yanli <yanli@dify.ai>
2026-06-10 09:51:40 +00:00
GareArc
f5c5dbaed5
feat(openapi): emit canonical ErrorBody on every /openapi/v1 error path
Install OpenApiErrorFormatter on the openapi blueprint's ExternalApi so
all non-2xx responses from /openapi/v1 carry the canonical ErrorBody shape
(code, message, status, optional details/hint). RFC 8628 device-flow
endpoints are unaffected — their flat {error: ...} shape is passed through
unchanged.

Also: set catch_all_404s=True when a formatter is present so unknown
routes return canonical JSON 404s (not Flask's default HTML 404).
Override _help_on_404 to suppress route suggestions, which would corrupt
the JSON contract and enumerate routes to unauthenticated callers.

Both behaviours are scoped by formatter presence — other blueprints that
construct ExternalApi without error_body_formatter are byte-identical.

Wire-level tests added to TestWireContract (3 tests, 18 total):
- 422 from @accepts validation carries code/status/details
- unknown-route 404 is canonical JSON without route suggestions
- device token POST returns RFC 8628 flat shape untouched by formatter
2026-06-10 02:48:38 -07:00
GareArc
41f827b609
feat(openapi): add OpenApiErrorFormatter normalizing all error paths to ErrorBody 2026-06-10 02:26:19 -07:00
GareArc
24b6e6f983
chore(openapi): neutral wording for domain-code comments 2026-06-10 02:08:47 -07:00
GareArc
5c657885a9
refactor(api): inject error-body formatter seam into ExternalApi handlers 2026-06-10 02:07:12 -07:00
GareArc
3f53fa605e
feat(openapi): add canonical ErrorBody model and error-code enum 2026-06-10 02:03:59 -07:00
非法操作
e3cfc4d40f
fix(api): require all selected tags in list filters (#37272) 2026-06-10 08:20:13 +00:00
呆萌闷油瓶
9ac71329a4
fix(plugin): align plugin list endpoint counts with live endpoint state (#37179)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-10 08:11:11 +00:00
Novice
4fb3210f9a
fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: 非法操作 <hjlarry@163.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
2026-06-10 07:28:12 +00:00
chariri
d849d60822
refactor(api): migrate tenant/user via DI for several endpoints (#37240) 2026-06-10 04:11:53 +00:00
盐粒 Yanli
ba9975a083
feat(dify-agent): sync shell and back proxy updates (#37159)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-10 03:04:32 +00:00
L1nSn0w
629e046303
refactor(openapi): unify request validation behind @accepts/@returns decorators (#37216)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-10 03:02:24 +00:00
Escape0707
212b819f1c
test: migrate credit pool service tests to Testcontainers (#37252) 2026-06-10 01:55:50 +00:00
cheatofrom
3fb1d3055e
fix: agent mode missing file cards for BINARY_LINK and FILE type tool outputs (#36746)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-10 01:41:37 +00:00
Asuka Minato
28cc3fc10d
chore: [Refactor/Chore] if isinstance to match case #35902 (#37087)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 09:54:04 +00:00
chariri
c88a38b8b5
chore(api): Suppress unknown contract checks by default (#36969)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 08:32:34 +00:00
Xiyuan Chen
1502a57381
feat(api,cli): strict UUID validation for app-id and workspace-id (#37212)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 07:35:18 +00:00
dependabot[bot]
686e643632
chore(deps): bump starlette from 1.0.0 to 1.0.1 in /api (#37076)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-09 14:44:41 +08:00
dependabot[bot]
11db079428
chore(deps): bump the storage group across 1 directory with 5 updates (#37153)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-09 14:43:22 +08:00
Yunlu Wen
eb3b12fa70
fix(dataset): include segment created_at in hit testing response (#37181)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 05:15:36 +00:00
非法操作
5bec8eb33a
chore: filter unavailable apps from the installed apps list API (#37206)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 05:12:29 +00:00
Asuka Minato
d11e4eeaf7
chore: DI current_user && use inspect (#37084)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 05:06:28 +00:00
yyh
bbdf3d7634
fix(agent-v2): complete console API contract schemas (#37210)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 04:40:32 +00:00
zyssyz123
a80bba2c35
feat(agent): Agent Files / agent Cloud storage — api backend (ENG-589) (#37172)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-09 04:01:05 +00:00
Eric Cao
a8977be999
chore(api): convert AppContext from ABC to Protocol (#37203) 2026-06-09 03:16:39 +00:00
Eric Cao
22e67b4673
chore(api): convert PipelineTemplateRetrievalBase from ABC to Protocol (#37201) 2026-06-09 03:14:50 +00:00
Eric Cao
f948e442e0
chore(api): convert BaseQueueDispatcher from ABC to Protocol (#37200) 2026-06-09 02:56:29 +00:00
Eric Cao
8a1c0cf5ab
chore(api): convert BaseTruncator from ABC to Protocol (#37199) 2026-06-09 02:55:36 +00:00
Eric Cao
5d814ca8c1
chore(api): convert RecommendAppRetrievalBase and WorkflowPauseEntity from ABC to Protocol (#37182) 2026-06-08 14:17:07 +00:00
Eric Cao
0239b81cca
chore(api): convert MessagesCleanPolicy from ABC to Protocol (#37171)
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-08 09:55:52 +00:00