feat: aio runtime sandbox run#416
Conversation
Adds a new `aio runtime sandbox run` command (under a new `runtime sandbox` topic) that creates a compute sandbox via aio-lib-runtime and drops the user into an interactive REPL against it, mirroring the standalone aio-lib-runtime-sandbox tool but wired into the standard runtime auth/config plumbing. Temporarily pins @adobe/aio-lib-runtime to the agent-sandboxes branch so ow.compute.sandbox.create resolves; this needs to move to a published version before merge. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
🤖 PR Reviewer
The implementation is clean, well-tested, and follows existing project patterns. The main concerns are: a non-release dependency reference in package.json (git branch instead of npm version), a potential security issue with unsanitized command input passed directly to sandbox.exec, and a minor infinite loop pattern in the REPL. These should be addressed before merging to main.
📝 6 suggestion(s) - Please review inline comments below.
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The diff introduces two new sandbox commands with tests. The main issues are: the git branch dependency for aio-lib-runtime is still present (previously flagged), the test file references flags (--type, --size) that don't exist in the implementation, and a minor here-string quote stripping fix was previously suggested. The core logic is sound and well-tested overall.
📝 4 suggestion(s) (2 new, 2 re-raised)
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🤖 PR Reviewer
The diff introduces a new sandbox run command with comprehensive tests and helper utilities. The implementation is well-structured with good test coverage. Previous issues around the here-string quote stripping logic and the package.json git reference have been addressed — the quote check now uses paired conditions, and aio-lib-runtime was bumped to a published version. However, aio-lib-sandbox is still pinned to a specific alpha version without a range, which is a fragility concern. The mock for aio-lib-runtime still has a compute.sandbox.create that doesn't match how the implementation actually works (it uses Sandbox.create from aio-lib-sandbox, not rtLib.compute), though this is just dead mock code and doesn't cause test failures.
📝 3 suggestion(s) (2 new, 1 re-raised)
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The code is well-structured with good test coverage. Two previously-raised issues remain: the alpha dependency pin without a semver range, and the while (true) loop without EOF/close handling. The rest of the implementation is clean and the new sandbox helpers are well-factored.
🔄 2 re-raised suggestion(s) from previous review
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The code is well-structured with good test coverage. Two previously raised issues remain unaddressed: the exact-pinned alpha version for @adobe/aio-lib-sandbox and the while (true) loop without EOF protection in _repl. No new significant issues found.
🔄 2 re-raised suggestion(s) from previous review
Findings (line numbers not in diff):
package.json(line 14): [Re-raised]@adobe/aio-lib-sandboxis pinned to an exact alpha version without a semver range. If a patch is released, consumers won't pick it up automatically. Use a caret range at minimum.
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The code is generally well-structured with good test coverage. The previously raised EOF/spin-loop issue in _repl is still present — while (true) with no close event guard means stdin EOF causes indefinite looping. One minor additional issue: @adobe/aio-lib-sandbox is pinned to the alpha dist-tag in package.json, which is unstable and unsuitable for a production dependency.
📝 2 suggestion(s) (1 new, 1 re-raised)
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The code is well-structured with good test coverage and clear separation of concerns. The EOF/infinite-loop issue in _repl from the previous review remains unaddressed, and the alpha dependency pin is still present. No new significant issues introduced in this diff.
🔄 2 re-raised suggestion(s) from previous review
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The code is well-structured with good test coverage and clear separation of concerns. Two previously raised issues remain unaddressed: the while (true) EOF spin risk in _repl and the alpha tag on @adobe/aio-lib-sandbox in package.json.
🔄 2 re-raised suggestion(s) from previous review
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The while (true) EOF guard issue in _repl remains unaddressed — stdin close before exit/quit will cause an infinite loop. The @adobe/aio-lib-sandbox alpha pin is still present in package.json. The rest of the code is well-structured with good test coverage and clear error handling patterns.
🔄 2 re-raised suggestion(s) from previous review
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The diff adds a sandbox REPL command with good test coverage and clear helper functions. The while (true) EOF guard issue from the previous review is still unaddressed, and the alpha dependency pin remains. No other significant issues were found.
🔄 2 re-raised suggestion(s) from previous review
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The code is well-structured with good test coverage and clear separation of concerns. Two previously raised issues remain unresolved: the while (true) loop in _repl has no EOF guard, and @adobe/aio-lib-sandbox is pinned to alpha in production dependencies.
🔄 2 re-raised suggestion(s) from previous review
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
There was a problem hiding this comment.
🤖 PR Reviewer
The code is well-structured with good test coverage. Two previously raised issues remain: the while (true) EOF guard issue in _repl and the alpha tag for @adobe/aio-lib-sandbox in package.json. Both are still present in this diff.
🔄 2 re-raised suggestion(s) from previous review
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
Adds a new
aio runtime sandbox runcommand for running commands in sandboxesTo test
aio plugins install "https://github.com/adobe/aio-cli-plugin-runtime.git#feat/runtime-sandbox-run"Usage