dify/api/models
Harry a0c388f283 refactor(sandbox): extract connection helpers and move run_command to helper module
- Add helpers.py with connection management utilities:
    - with_connection: context manager for connection lifecycle
    - submit_command: execute command and return CommandFuture
    - execute: run command with auto connection, raise on failure
    - try_execute: run command with auto connection, return result

  - Add CommandExecutionError to exec.py for typed error handling
    with access to exit_code, stderr, and full result

  - Remove run_command method from VirtualEnvironment base class
    (now available as submit_command helper)

  - Update all call sites to use new helper functions:
    - sandbox/session.py
    - sandbox/storage/archive_storage.py
    - sandbox/bash/bash_tool.py
    - workflow/nodes/command/node.py

  - Add comprehensive unit tests for helpers with connection reuse
2026-01-15 00:13:52 +08:00
..
__init__.py feat(skill): implement app asset management features including folder and file operations, error handling, and database migration for app asset drafts 2026-01-14 20:25:17 +08:00
_workflow_exc.py feat: Persist Variables for Enhanced Debugging Workflow (#20699) 2025-06-24 09:05:29 +08:00
account.py refactor: migrate some ns.model to BaseModel (#30388) 2026-01-01 00:38:12 +08:00
api_based_extension.py fix: use default_factory for callable defaults in ORM dataclasses (#28730) 2025-11-27 09:39:49 +09:00
app_asset.py refactor(sandbox): extract connection helpers and move run_command to helper module 2026-01-15 00:13:52 +08:00
base.py more typed orm (#28507) 2025-11-21 21:45:51 +08:00
dataset.py feat: Add "type" field to PipelineRecommendedPlugin model; Add query param "type" to recommended-plugins api. (#29736) 2025-12-17 11:26:08 +08:00
engine.py feat(api): Add image multimodal support for LLMNode (#17372) 2025-04-30 17:28:02 +08:00
enums.py feat: trigger billing (#28335) 2025-11-20 10:15:23 +08:00
model.py Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-01-13 10:15:59 +08:00
oauth.py fix: use default_factory for callable defaults in ORM dataclasses (#28730) 2025-11-27 09:39:49 +09:00
provider_ids.py feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00
provider.py chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
sandbox.py refactor(encryption): update encryption utility references and clean up sandbox provider service logic 2026-01-09 18:12:35 +08:00
source.py fix: use default_factory for callable defaults in ORM dataclasses (#28730) 2025-11-27 09:39:49 +09:00
task.py fix: use default_factory for callable defaults in ORM dataclasses (#28730) 2025-11-27 09:39:49 +09:00
tools.py chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
trigger.py fix: flask db check fails due to nullable mismatch between migrations and models (#30474) 2026-01-06 20:23:59 +08:00
types.py [Bugfix] Fixed an issue with UUID type queries in MySQL databases (#28941) 2025-12-02 14:37:23 +08:00
web.py fix: use default_factory for callable defaults in ORM dataclasses (#28730) 2025-11-27 09:39:49 +09:00
workflow_features.py refactor: rename new runtime as sandbox feature 2026-01-12 01:53:39 +08:00
workflow.py Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-01-14 09:54:07 +08:00