Add Modal remote backend support#41
Conversation
There was a problem hiding this comment.
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
modalas a first-classBackendType/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.
| assert_eq!( | ||
| std::path::PathBuf::from(normalized), | ||
| current.join("examples/remote-modal") | ||
| ); |
There was a problem hiding this comment.
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.
| 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); |
6196df3 to
e631d36
Compare
Summary
Verification