Devbyteai
ecda6fc464
refactor: move imports to top of generated script, remove redundancy
2025-12-26 20:27:32 +02:00
Devbyteai
26444d8b6c
fix(template-transform): use base64 encoding for Jinja2 templates
...
When Jinja2 templates containing special characters (quotes, newlines)
were embedded directly in the generated Python script using triple-quoted
strings, the script would break. This fix encodes the template as base64
before embedding, then decodes it at runtime.
Root cause: Templates were inserted via string replacement into a Python
script like `jinja2.Template('''...''')`. If the template contained `'''`,
the generated script had a syntax error.
Solution: Add serialize_code() method to base64-encode templates, then
override assemble_runner_script() in Jinja2TemplateTransformer to use
the encoded template with runtime decoding.
This specifically affects Jinja2 templates - Python3 and JavaScript
transformers insert user code at the top level (not inside strings),
so they don't have this vulnerability.
Fixes #26818
2025-12-26 20:08:12 +02:00
-LAN-
13bf6547ee
Refactor: centralize node data hydration ( #27771 )
2025-11-27 15:41:56 +08:00
wangjifeng
f65d5a9761
Fix/template transformer line number ( #27867 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
2025-11-05 15:21:47 +08:00
Asuka Minato
ab2eacb6c1
use model_validate ( #26182 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
2025-10-10 17:30:13 +09:00
Blackoutta
e937c8c72e
improve: pooling httpx clients for requests to code sandbox and ssrf ( #26052 )
2025-09-24 22:14:50 +08:00
-LAN-
85cda47c70
feat: knowledge pipeline ( #25360 )
...
Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: twwu <twwu@dify.ai>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Co-authored-by: jyong <718720800@qq.com>
Co-authored-by: Wu Tianwei <30284043+WTW0313@users.noreply.github.com>
Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
Co-authored-by: lyzno1 <yuanyouhuilyz@gmail.com>
Co-authored-by: quicksand <quicksandzn@gmail.com>
Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com>
Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: nite-knite <nkCoding@gmail.com>
Co-authored-by: Hanqing Zhao <sherry9277@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Harry <xh001x@hotmail.com>
2025-09-18 12:49:10 +08:00
-LAN-
bab4975809
chore: add ast-grep rule to convert Optional[T] to T | None ( #25560 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-15 13:06:33 +08:00
Asuka Minato
a78339a040
remove bare list, dict, Sequence, None, Any ( #25058 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
2025-09-06 03:32:23 +08:00
-LAN-
e340fccafb
feat: integrate flask-orjson for improved JSON serialization performance ( #23935 )
2025-08-14 19:50:59 +08:00
quicksand
5247c19498
fix: code result included "error" field ( #22392 )
2025-07-15 13:55:00 +08:00
Novice
1d54ffcf89
fix: error parsing object type parameters for code node ( #22230 )
2025-07-14 10:37:26 +08:00
baonudesifeizhai
b9f56852dc
fix: resolve JSON.parse precision issue causing 'list index out of ra… ( #21253 )
2025-07-07 10:05:54 +08:00
Bowen Liang
888cd86afd
chore: prepare the plugin daemon base url to yarl URL ahead intstead of in every invocation ( #20541 )
2025-06-03 17:01:35 +08:00
QuantumGhost
bd1bbfee4b
Enhance Code Consistency Across Repository with `.editorconfig` ( #19023 )
2025-04-29 18:04:33 +08:00
非法操作
44f911a0a8
chore: docstring not match the function parameter ( #17162 )
2025-03-31 13:19:15 +08:00
yihong
56e15d09a9
feat: mypy for all type check ( #10921 )
2024-12-24 18:38:51 +08:00
-LAN-
a056a9d601
feat(code_node): add more check ( #11949 )
...
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-22 10:40:43 +08:00
-LAN-
5e37ab60d8
fix: validate response type in transform_response method ( #11931 )
...
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-21 21:23:03 +08:00
Bowen Liang
6c8e208ef3
chore: bump minimum supported Python version to 3.11 ( #10386 )
2024-11-24 13:28:46 +08:00
-LAN-
b8b6cd409a
refactor(code_executor): update input type annotations to use Mapping for better type safety ( #10478 )
2024-11-11 13:10:39 +08:00
Bowen Liang
c69f5b07ba
chore: apply ruff E501 line-too-long linter rule ( #8275 )
...
Co-authored-by: -LAN- <laipz8200@outlook.com>
2024-09-12 14:00:36 +08:00
Bowen Liang
292220c596
chore: apply pep8-naming rules for naming convention ( #8261 )
2024-09-11 16:40:52 +08:00
Bowen Liang
2cf1187b32
chore(api/core): apply ruff reformatting ( #7624 )
2024-09-10 17:00:20 +08:00
Bowen Liang
3f467613fc
feat: support configs for code execution request ( #7704 )
2024-08-27 19:38:33 +08:00
Yeuoly
784b11ce19
Chore/remove python dependencies selector ( #7494 )
2024-08-21 16:57:14 +08:00
Yeuoly
a02118d5bc
Fix/incorrect code template ( #7490 )
2024-08-21 15:31:13 +08:00
非法操作
bf3f1027c8
fix: code execution node not display clear reasons when sandbox res error ( #6830 )
2024-08-02 15:36:44 +08:00
-LAN-
5e6fc58db3
Feat/environment variables in workflow ( #6515 )
...
Co-authored-by: JzoNg <jzongcode@gmail.com>
2024-07-22 15:29:39 +08:00
-LAN-
4d105d7bd7
feat(*): Swtich to dify_config. ( #6025 )
2024-07-06 12:05:13 +08:00
Bowen Liang
2a0f03a511
refactor: extract cors configs into dify config and cleanup the config class ( #5507 )
...
Co-authored-by: takatost <takatost@gmail.com>
2024-06-25 15:48:02 +08:00
Bowen Liang
f976740b57
improve: mordernizing validation by migrating pydantic from 1.x to 2.x ( #4592 )
2024-06-14 01:05:37 +08:00
Bowen Liang
140dd873f1
fix: show exception message when sandbox execution fails ( #4663 )
2024-05-27 18:06:15 +08:00
Yeuoly
5893ebec55
fix: code node garbled in Javascript ( #4615 )
2024-05-23 17:18:57 +08:00
Bowen Liang
5f4df34829
improve: generalize transformations and scripts of runner and preloads into TemplateTransformer ( #4487 )
2024-05-20 15:56:26 +08:00
Bowen Liang
083ef2e6fc
improve: exract Code Node provider for each supported scripting language ( #4164 )
2024-05-17 11:58:12 +08:00
Yeuoly
bbef964eb5
improve: code upgrade ( #4231 )
2024-05-13 14:39:14 +08:00
Yeuoly
8578ee0864
feat: support LLM jinja2 template prompt ( #3968 )
...
Co-authored-by: Joel <iamjoel007@gmail.com>
2024-05-10 18:08:32 +08:00
Bowen Liang
049abd698f
improve: test CodeExecutor with code templates and extract CodeLanguage enum ( #4098 )
2024-05-07 12:37:18 +08:00
Bowen Liang
093b5c0e63
fix: typo of jinja2 ( #4019 )
2024-04-30 18:39:02 +08:00
Yeuoly
2a213c6af7
fix: incorrect type parser ( #3682 )
2024-04-22 19:32:41 +08:00
Yeuoly
c2acb2be60
feat: code ( #3557 )
2024-04-18 08:00:02 +08:00
Yeuoly
c7de51ca9a
enhance: preload general packages ( #3567 )
2024-04-17 19:49:53 +08:00
miendinh
b9fbc39754
get config default for sandbox ( #3508 )
...
Co-authored-by: miendinh <miendinh@users.noreply.github.com>
2024-04-16 13:36:28 +08:00
Eric Wang
3c3fb3cd3f
fix(code_executor): surrogates not allowed error in jinja2 template ( #3191 )
2024-04-09 12:21:03 +08:00
takatost
7753ba2d37
FEAT: NEW WORKFLOW ENGINE ( #3160 )
...
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: Yeuoly <admin@srmxy.cn>
Co-authored-by: JzoNg <jzongcode@gmail.com>
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
Co-authored-by: jyong <jyong@dify.ai>
Co-authored-by: nite-knite <nkCoding@gmail.com>
Co-authored-by: jyong <718720800@qq.com>
2024-04-08 18:51:46 +08:00