Commit Graph

1218 Commits

Author SHA1 Message Date
GareArc
83f287ef48
Merge branch 'feat/openapi-error-contract' into deploy/enterprise 2026-06-11 00:53:34 -07:00
GareArc
9e0e23a339
feat(api): expose OpenApiErrorCode enum as standalone swagger definition 2026-06-10 22:49:50 -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
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
3f53fa605e
feat(openapi): add canonical ErrorBody model and error-code enum 2026-06-10 02:03:59 -07: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
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
非法操作
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
L1nSn0w
a15ecf6bec
feat(cli): adopt generated oRPC contract for unary endpoints (#37090)
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-08 08:09:44 +00:00
Charles Yao
37e1d452b8
feat(api): add MCP user-identity forwarding (#36839)
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-08 04:32:11 +00:00
chariri
157ba6f5a0
chore(api): Fix several typing errors (#37119)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-06 01:44:32 +00:00
chariri
6b12152ce8
refactor(api): migrate tenant/user via DI for several endpoints (#37114)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-05 15:08:11 +00:00
FFXN
00ac937934
feat: snippet (#37046)
Co-authored-by: JzoNg <jzongcode@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-05 09:38:42 +00:00
Xiyuan Chen
a1ad4be61e
fix(api): expose device-flow approve rate limit as env var (#37083) 2026-06-05 02:56:23 +00:00
Crazywoola
0bfbd2061e
feat: enhance go to anything (#32130)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-04 11:06:17 +00:00
Blackoutta
c8abb11bf0
feat: support custom trace session id for Phoenix tracing (#37056)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-04 08:42:03 +00:00
chariri
b67c3a5f76
refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00
QuantumGhost
3c98f96ae8
feat(api): introduce select, file and file list form input types to Human Input node (#36322)
Co-authored-by: JzoNg <jzongcode@gmail.com>
Co-authored-by: GPT 5.4 <codex@openai.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
2026-06-04 01:54:28 +00:00
zyssyz123
44725dde74
feat(agent): Sandbox / CLI Agent (dify.shell) + read-only sandbox file inspector (#36984)
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-03 22:37:31 +00:00
chariri
d3058d63bd
refactor(api): migrate console.datasets.data_source to BaseModel (#36624) 2026-06-03 19:38:39 +00:00
chariri
4fc62d3b38
refactor(api): migrate console.datasets.rag_pipeline partially to BaseModel (#36649) 2026-06-03 17:44:10 +00:00
chariri
57b573d02b
refactor(api): migrate tenant/user via DI for several endpoints (#37004) 2026-06-03 08:59:00 +00:00
Xiyuan Chen
cad0942f4d
fix(api): enforce workspace membership + role checks in auth pipeline (#36931)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-03 07:31:47 +00:00
WUMIKE233
ee6a07d13c
refactor: use explicit session in inner api user auth (#36995) 2026-06-03 07:06:38 +00:00
yyh
2d6c9300e3
fix(api): tighten agent v2 generated contracts (#36989)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-03 06:52:40 +00:00
Asuka Minato
b96ea94505
chore: add :str to <path: parameter (#36913)
Co-authored-by: 99 <wh2099@pm.me>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-03 05:25:11 +00:00
chariri
1b972c4e09
refactor(api): migrate tenant/user via DI for several endpoints (#36971)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-03 04:24:17 +00:00
yyh
dea4e66456
fix(web): use generated account-profile contracts (#36927)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-02 07:28:05 +00:00
Likalikali
7056985f72
refactor: inject current user id in stop message endpoints (#36925)
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-02 06:48:10 +00:00
yyh
079af312c6
fix(contracts): include account avatar url in profile schema (#36924)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-02 04:30:47 +00:00
zyssyz123
e35d23c3cb
feat(api): Agent App type S1 — AppMode.AGENT + create flow + binding (#36829)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-02 03:50:10 +00:00