Skip to content

fix(daytona): bulk upload, config bridge, silent disk cap (#7362)#7538

Merged
teknium1 merged 5 commits into
mainfrom
hermes/hermes-7f8c199a
Apr 11, 2026
Merged

fix(daytona): bulk upload, config bridge, silent disk cap (#7362)#7538
teknium1 merged 5 commits into
mainfrom
hermes/hermes-7f8c199a

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of #7447 by @alt-glitch onto current main. Fixes #7362.

Changes

  1. Bulk file upload (perf)FileSyncManager now accepts an optional bulk_upload_fn callback. When provided, all changed files upload in one call instead of per-file HTTP POSTs. Daytona wires this to sandbox.fs.upload_files() (single multipart POST). ~580 files: ~5 min → <2s on init. Backwards compatible — SSH/Modal/Docker continue using per-file uploads.

  2. Config-to-env bridge — Add container_cpu, container_memory, container_disk, container_persistent to _config_to_env_sync dict so hermes config set terminal.container_memory 8192 correctly writes to .env.

  3. Disk cap visibility — Replace warnings.warn() with logger.warning() for disk cap message. warnings.warn() is suppressed in agent/gateway mode.

Tests

  • 3 new unit tests for bulk upload: invocation, fallback, rollback
  • All 15 file_sync tests pass
  • All 40 config tests pass

Contributor commits cherry-picked with authorship preserved.

FileSyncManager now accepts an optional bulk_upload_fn callback.
When provided, all changed files are uploaded in one call instead
of iterating one-by-one with individual HTTP POSTs.

DaytonaEnvironment wires this to sandbox.fs.upload_files() which
batches everything into a single multipart POST — ~580 files goes
from ~5 min to <2s on init.

Parent directories are pre-created in one mkdir -p call.

Fixes #7362 (item 1).
Add terminal.container_cpu, container_memory, container_disk, and
container_persistent to the _config_to_env_sync dict so that
`hermes config set terminal.container_memory 8192` correctly
writes TERMINAL_CONTAINER_MEMORY=8192 to ~/.hermes/.env.

Previously these YAML keys had no effect because terminal_tool.py
reads only env vars and the bridge was missing these mappings.

Fixes #7362 (item 2).
warnings.warn() is suppressed/invisible when running as a gateway
or agent. Switch to logger.warning() so the disk cap message
actually appears in logs.

Fixes #7362 (item 3).
Cover the three key behaviors:
- bulk_upload_fn is called instead of per-file upload_fn
- Fallback to upload_fn when bulk_upload_fn is None
- Rollback on bulk upload failure retries all files
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: exec() or eval() usage

Dynamic code execution can hide malicious behavior, especially when combined with base64 or network fetches.

Matches (first 20):

132:+            self._sandbox.process.exec(mkdir_cmd)

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daytona backend: bulk upload, config bridge, silent disk cap

2 participants