Skip to content

Add Modal remote backend support#41

Merged
thrashr888 merged 2 commits intomainfrom
codex/modal-remote-backend
Apr 4, 2026
Merged

Add Modal remote backend support#41
thrashr888 merged 2 commits intomainfrom
codex/modal-remote-backend

Conversation

@thrashr888
Copy link
Copy Markdown
Owner

Summary

  • add a live Modal remote backend adapter to the shared remote bridge
  • wire Modal through backend/config plumbing and fix remote path persistence for workspace sync
  • add Modal docs, templates, and runnable examples while fixing remote example bridge paths

Verification

  • cargo test --quiet
  • node --check scripts/remote-bridge.mjs
  • live Modal smoke through agentkernel: create/start, managed /workspace sync, exec, snapshot, restore, restored exec

Copilot AI review requested due to automatic review settings March 29, 2026 23:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new hosted remote backend provider (“modal”) to agentkernel’s shared remote bridge system, wiring it through Rust backend/config plumbing and supplying templates/docs/examples for end-to-end usage.

Changes:

  • Introduce modal as a first-class BackendType / RemoteProvider, including config schema and CLI help updates.
  • Implement a live Modal adapter in scripts/remote-bridge.mjs (lifecycle, exec/attach, file APIs, workspace sync, snapshot/restore, endpoints).
  • Add Modal template + example, and fix example bridge paths to be relative to their config locations.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
templates/modal-remote.toml Adds a built-in template for Modal remote sandboxes.
src/vmm.rs Normalizes persisted work_dir/config_path for remote workspace sync and adds tests.
src/main.rs Updates CLI help text to include modal as a backend option.
src/config.rs Extends remote provider config to support Modal token fields and validates inline secrets.
src/backend/remote.rs Adds RemoteProvider::Modal and maps Modal config into MODAL_* env vars for the bridge.
src/backend/mod.rs Adds BackendType::Modal and wires it into remote sandbox creation/availability checks.
scripts/remote-bridge.mjs Implements the Modal provider adapter and adds env aliasing + secret scrubbing for Modal tokens.
scripts/package.json Adds the modal SDK dependency for the remote bridge.
scripts/package-lock.json Locks Modal dependency tree (and records Node engine metadata).
examples/remote-runloop/agentkernel.toml Fixes remote bridge path to be relative to the example config file.
examples/remote-e2b/agentkernel.toml Fixes remote bridge path to be relative to the example config file.
examples/remote-daytona/agentkernel.toml Fixes remote bridge path to be relative to the example config file.
examples/remote-modal/agentkernel.toml Adds a runnable Modal example config.
examples/remote-modal/README.md Adds runnable commands for the Modal example.
examples/README.md Documents the Modal example alongside other remote examples.
docs/operations/remote.md Documents Modal as a shipped live remote adapter with a config example.
docs/index.md Adds Modal to the backend matrix and quickstart examples.
docs/config/toml.md Documents [remote.modal] fields and token env configuration.
docs/config/backends.md Adds modal to the remote backends list and notes SDK wiring.
docs/commands/templates.md Adds modal-remote to the built-in templates list and usage examples.
Files not reviewed (1)
  • scripts/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/vmm.rs Outdated
Comment on lines +3198 to +3201
assert_eq!(
std::path::PathBuf::from(normalized),
current.join("examples/remote-modal")
);
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_normalize_persisted_path_makes_relative_absolute compares the normalized path to current_dir().join(...), but normalize_persisted_path() may canonicalize and resolve symlinks (or return a different but equivalent absolute path). This can make the test flaky across platforms/setups. Consider canonicalizing the expected path too, or comparing via canonicalize()/ends_with rather than strict PathBuf equality.

Suggested change
assert_eq!(
std::path::PathBuf::from(normalized),
current.join("examples/remote-modal")
);
let expected = std::fs::canonicalize(current.join("examples/remote-modal"))
.unwrap_or_else(|_| current.join("examples/remote-modal"));
assert_eq!(std::path::PathBuf::from(&normalized), expected);

Copilot uses AI. Check for mistakes.
@thrashr888 thrashr888 force-pushed the codex/modal-remote-backend branch from 6196df3 to e631d36 Compare April 4, 2026 05:37
@thrashr888 thrashr888 merged commit 30335bb into main Apr 4, 2026
10 checks passed
@thrashr888 thrashr888 deleted the codex/modal-remote-backend branch April 4, 2026 06:08
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.

2 participants