Repository navigation
Conversation
…260907' into codex/studio-srt-replacement-20260907 # Conflicts: # studio/backend/tests/test_srt_native_tools.py
…260907' into codex/studio-srt-replacement-20260907
|
This makes Required isolation the default for Python and Terminal tool calls, so any host where the pinned SRT runtime is missing or fails its probe now refuses to run tools that work today; could you confirm what a user on such a host sees before I review? It also bundles the network proxy, the Windows installer provisioning and the Detours adapter into one branch, so splitting the platform backends out from the shared launch contract in os_sandbox.py would make this reviewable. |
Yes, tools that worked before will be blocked on those hosts unless the user explicitly chooses Limited mode. I tested this on a Colab T4 at 030c87c:
Sandbox unavailable :
Probe details :
Limited-mode warning
After Cancel
Successful Python execution (colab-10441-030c87cfb/)
Successful Terminal execution
|
The seven failing checks came from three stale assertions, not from the
isolation work:
- pre-commit's prettier wrapped useSandboxImage(pythonToolImagePath(...))
across lines, and two guards matched that call as literal source text.
Both now match it whitespace-tolerantly, the way the authFetch assertion
beside one of them already did, so the formatter cannot break them again.
- playwright_chat_ui.py still expected the old Full-access copy ("the code
sandbox") and the old button label ("I understand"), both reworded here.
That one file failed the Linux, macOS and Windows chat lanes.
Then the case this change is really about. Ubuntu 23.10 and newer default to
kernel.apparmor_restrict_unprivileged_userns=1, so bwrap cannot build a
sandbox even with bubblewrap installed, and Required refuses. On such a host
the capability message read "SRT helper closed its control channel before
launch" with "run install_srt_runtime.py" as the remedy, which the user had
already done successfully: a dead end on what is now a very common desktop.
The Linux path now names the missing binaries when any are missing, and names
the AppArmor restriction when they are all present, without touching host
policy. SRT_TOOL_ISOLATION.md says the same, since it already told users to
act "if the capability message requests them" and the message never did.
linux-native runs on ubuntu-22.04, which predates the restriction, so add a
linux-userns-restricted job on ubuntu-24.04 that reimposes the stock sysctl
and asserts the refusal is clean and the message actionable.
Also restore coverage the branch had moved off the sandbox path. Five
grandchild-teardown tests in test_tool_output_streaming.py ran with
disable_sandbox=True, which is Full access: it swaps _sandbox_preexec for
_bypass_preexec, so they exercised a teardown no user gets and would have
kept passing if the sandboxed one regressed. They run in Required again, kept
portable by the module's own passthrough fixture. The two truncation tests in
test_tool_result_fits_window.py take the strongest mode the host authorizes
rather than Full, so the process cap their comments rest on is real again.
test_bypass_permissions.py gains the invariant its moved seam stopped
checking: a backend that dropped the process guard now fails a test.
Finally, the per-call SRT badge said "OS isolation" while the pill above it
said "Preview OS isolation" for the same run; os_sandbox reports SRT as
preview and unqualified everywhere, so the badge should not read stronger.
Register the allow_network marker it warns about too.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32bc84c188
ℹ️ 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".
| ), | ||
| }; | ||
| } else { | ||
| await useChatRuntimeStore.getState().refreshToolIsolationCapability(); |
There was a problem hiding this comment.
Avoid forcing a full isolation probe on every code-tool send
Whenever Python or Terminal is enabled, this unconditional refresh calls /tool-isolation/capability, whose route invokes _read_tool_isolation_capability(force=True). That bypasses the 60-second probe cache and repeats the native SRT/filesystem probe for every message—including the potentially two-minute scan that startup warmup is intended to pay once—so ordinary code-tool chats can stall before every model request, and concurrent tabs serialize repeated probes behind the probe lock. Routine dispatch should consume the cached capability, reserving a forced probe for the explicit “Check again” action; launch-time admission already revalidates the capability.
Useful? React with 👍 / 👎.
|
Opened #10526 as a smaller alternative for Linux and macOS only, so the two can be compared directly rather than this one carrying every platform at once. It reuses the parts of this PR that are clearly right: the launch contract shape, the backend-owned execution record, the live probe with owned positive and negative controls, and the honest Preview labelling. It drops the Node dependency, the vendored package and integrity manifest, the HTTPS allowlist proxy, and Windows. 2,625 lines of product code against 8,700 here. Two differences worth your view, since they are policy rather than implementation:
None of that makes this PR wrong, and it does not cover Windows, which is genuinely hard and where SRT is the better answer. My suggestion is still the split from my earlier comment: land the isolation contract and one platform backend first, then the proxy, then Windows once Separately, I pushed 7f11049 here to clear the red CI. Three causes, none of them the isolation work:
The same commit adds the AppArmor diagnosis to the capability message, since the previous text told a stuck user to run the installer they had already run successfully, and restores four negative controls the branch had moved off the sandbox path (five grandchild-teardown tests were running with |






Summary
Run Studio's Python and Terminal tools through a pinned SRT helper by default. Required mode refuses execution when the runtime is missing or its probe fails; users can explicitly
consent to Limited mode or separately confirm Full access.
BREAKING CHANGE
Hosts that previously ran tools with software safeguards alone may now refuse Python and Terminal calls.
Rerun Studio setup to install the helper and check Sandbox details for platform prerequisites. When isolation is unavailable, users can accept the Limited-mode warning and retry
Motivation
studio/backend/core/inference/.Dependencies: add
@anthropic-ai/sandbox-runtimepinned to0.0.75; the helper requires Node 20.11 or newer.pyproject.tomlchanges package contents, not Python dependencies.How to test
On a host without working isolation: