dify/api/tests
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
..
fixtures/workflow fix(api): defer streaming response until referenced variables are updated (#30832) 2026-01-12 16:23:18 +08:00
integration_tests feat: allow pass hostname in docker env (#30975) 2026-01-14 19:30:37 +08:00
test_containers_integration_tests refactor(models): Refine MessageAgentThought SQLAlchemy typing (#27749) 2026-01-10 17:17:45 +09:00
unit_tests refactor(sandbox): extract connection helpers and move run_command to helper module 2026-01-15 00:13:52 +08:00
__init__.py Initial commit 2023-05-15 08:51:32 +08:00