feat(sandbox): Add opt-in SafeMini adapter - #53
Conversation
Route explicit consumers through SafeMini's fresh worktree runner while preserving JustAi Bubblewrap and command guards. Keep the existing local executor unchanged until an operator opts in. Co-Authored-By: Codex <noreply@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds an opt-in integration layer that lets JustAI run tasks via the external SafeMini runner contract while preserving the existing Bubblewrap boundary and command-guard behavior, and pins SafeMini to a specific merged commit for Phase A consumption.
Changes:
- Introduces
justai.safe_mini_adapterwith a SafeMini runner + Bubblewrap-backed executor and a JustAI-to-SafeMini action-model translation. - Adds a new test suite validating the adapter’s opt-in behavior, guardrails, and environment shaping.
- Pins
safe-minias a VCS dependency at a specific commit SHA.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
justai/safe_mini_adapter.py |
New opt-in adapter module providing SafeMini runner wiring, action translation, and Bubblewrap-backed execution boundary. |
tests/test_safe_mini_adapter.py |
New tests covering adapter execution behavior, catastrophic command blocking, action translation, and PYTHONPATH isolation. |
pyproject.toml |
Adds safe-mini as a pinned git dependency to make the adapter/test suite available. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| dependencies = [ | ||
| "langfuse>=2.0", | ||
| # Future Phase A dependency once the substrate repo exists: | ||
| # "safe-mini @ git+https://github.com/JustinJLeopard/safe-mini.git@<sha>", | ||
| # Phase B should replace that git URL with a normal version pin. | ||
| "safe-mini @ git+https://github.com/JustinJLeopard/safe-mini.git@17c8514c1bf42d3064748400745099ca1723e782", | ||
| ] |
| def next(self, transcript: list[dict]) -> str: | ||
| prompt = str(transcript[-1].get("content", "")) | ||
| try: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc965d5198
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| base_url=_execution_endpoint(), | ||
| ) | ||
| except Exception as exc: | ||
| return json.dumps({"action": "unavailable", "detail": str(exc)[:160]}) |
There was a problem hiding this comment.
Preserve backend failures outside the action parser
When _llm_call raises because the execution endpoint is unavailable or times out, this fabricates an unsupported action and feeds it to SafeMini's bash-only action parser. The one-move run then records an action-protocol violation even though the model never returned a malformed action, corrupting failure classifications and experiment metrics; surface this as a backend/embodiment failure instead.
Useful? React with 👍 / 👎.
Summary
Verification
The local verification imports the exact merged SafeMini source from its isolated worktree. No package installation, runtime routing, service restart, or productive run is included.