#1691

docs(config): document the sandbox resource and log limits

Openlxcxjxhxwants to merge intofrom

What

docs/advanced/configuration.mdx documents two sandbox variables (STRIX_SANDBOX_EXECUTION_TIMEOUT, STRIX_SANDBOX_CONNECT_TIMEOUT), but strix/runtime/docker_client.py also reads six resource-limit variables that appear nowhere in the docs — _apply_resource_limits() and _apply_log_limits() are the only place they exist:

variabledefaulteffect
STRIX_SANDBOX_MEM_LIMITunsetDocker mem_limit — unset means the container is unbounded
STRIX_SANDBOX_SHM_SIZEunsetDocker shm_size — unset means Docker's own default
STRIX_SANDBOX_CPUSunsetconverted to nano_cpus; fractions accepted
STRIX_SANDBOX_PIDS_LIMITunsetDocker pids_limit
STRIX_SANDBOX_LOG_MAX_SIZE50mjson-file rotation size; 0/off/none/unlimited opts out
STRIX_SANDBOX_LOG_MAX_FILE3rotated files kept; on-disk cap is size × count

Two of these matter beyond discoverability:

  • Log rotation is on by default — _apply_log_limits() runs unless the size is set to 0/off/none/unlimited, so a run caps its container log at 150 MB. A user whose disk fills from something else will not find the switch in the docs today.
  • The cgroup caps are the only way to bound the sandbox — unset means unbounded, and the sandbox executes arbitrary commands, so the defaults are worth stating explicitly next to the timeouts.

Change

Six <ParamField> entries appended to the existing "Sandbox Configuration" section, in the file's existing style, each stating its default and what "unset" means:

 <ParamField path="STRIX_SANDBOX_CONNECT_TIMEOUT" default="10" type="integer">
   Timeout in seconds for connecting to the sandbox container.
 </ParamField>
 
+<ParamField path="STRIX_SANDBOX_MEM_LIMIT" type="string">
+  Memory cap for the sandbox container, passed to Docker's `mem_limit` (for example `4g`). Unset
+  leaves Docker's own default, so the container is unbounded.
+</ParamField>
...

Documentation only. The values and semantics are taken from the code, not inferred:

strix/runtime/docker_client.py:96   _apply_resource_limits  (MEM_LIMIT, SHM_SIZE, CPUS, PIDS_LIMIT)
strix/runtime/docker_client.py:120  _apply_log_limits       (LOG_MAX_SIZE=50m, LOG_MAX_FILE=3)

Test Plan

$ python -c "print(open('docs/advanced/configuration.mdx').read().count('<ParamField'), open('docs/advanced/configuration.mdx').read().count('</ParamField>'))"
44 44          # balanced, no unclosed component

No navigation change: this extends an existing page, and docs.json lists pages rather than headings.

I did not build the Mintlify site locally, so this is checked for component balance and style consistency rather than rendered.

Activity

4
mintlify[bot]16h ago

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 7574805.

Approve preview

greptile-apps[bot]16h ago

Confidence Score: 4/5

[Low impact] The PR changes what operators can learn from one configuration page.

This documentation-only PR appears safe to merge, with a non-blocking correction to the log opt-out description.

Findings

  1.  Logs can still rotate ▶
Fix with agent prompt
### Issue 1
docs/advanced/configuration.mdx:232-233
If the Docker daemon has log rotation configured, setting `STRIX_SANDBOX_LOG_MAX_SIZE` to an opt-out value still lets Docker discard older entries. `_apply_log_limits()` simply leaves `log_config` unset; it does not force unbounded logs. Say this restores the daemon's logging defaults, which are unbounded only with Docker's stock configuration.

```suggestion
  Size at which the container's json-file log rotates. Set it to `0`, `off`, `none` or `unlimited`
  to use the Docker daemon's logging defaults instead. These are unbounded only with Docker's
  stock configuration.
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds six sandbox resource and log settings to docs/advanced/configuration.mdx.

  • Operators can find the sandbox resource and log settings on the configuration page.

Reviews (1) · Last reviewed commit: "docs(config): document the sandbox resou..." · Reviewed by Greptile

greptile-apps[bot]reviewed16h ago