bug(boundary): CA bundle JSON serialization inflates control frame past 1MB limit on macOS
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
从 openshell-sandbox-backend/src/boundary_protocol.rs 开始,检查第 35 行的 MAX_CONTROL_FRAME_BYTES、第 534 行附近的 Request::StartAgent,以及第 1092–1096 行附近的 encode_frame。使用 macOS CA bundle 重现超大 frame,然后验证 ca_bundle 和 ca_cert 使用更紧凑的编码,旧的序列化能够得到妥善处理,并且 1MB 限制保持不变。
由索引模型根据 Issue 内容生成。
描述
User Story
As a developer running the VM compute driver on macOS,
I want sandbox creation to succeed without hitting boundary protocol frame size limits,
so that I can use VM-backed sandboxes on machines with standard macOS system CA bundles.
Problem Statement
The StartAgent boundary control request fails with control frame is too large when the host system CA bundle exceeds ~300KB. The ca_bundle field in Request::StartAgent is typed as Option<Vec<u8>> and serialized via serde's default JSON encoding, which represents each byte as a decimal number in a JSON array ([45, 45, 45, 10, ...]). This inflates the payload ~3.3× compared to the raw bytes. A typical macOS system CA bundle is
~334KB, which serializes to ~1.1MB of JSON — exceeding the MAX_CONTROL_FRAME_BYTES limit of 1MB (1,048,576 bytes).
The supervisor attaches and confirms the isolation boundary successfully, but crashes when encoding the StartAgent request that carries the CA bundle to the guest.
Impact / Why This Matters
When this happens, every openshell sandbox create on the affected machine fails after completing image pull and boundary attachment. The supervisor exits with status 1 and the sandbox enters an error phase. Users see:
Error: process error: encode control request: control frame is too large: 1099704 bytes
There is no workaround short of patching the frame size limit or trimming the system CA store. This blocks all VM-backed sandbox usage on macOS systems with default certificate stores. The issue is latent on Linux as well / any system with a CA bundle above ~300KB will hit it.
Acceptance Criteria
-
openshell sandbox createsucceeds on macOS with the default system CA bundle (300–400KB on my computer) - The
ca_bundleandca_certfields inRequest::StartAgentuse a space-efficient serialization (e.g., base64) instead of JSON byte arrays - Existing supervisor and sandbox binaries using the old serialization format are handled gracefully (protocol versioning or backwards-compatible encoding)
- The
MAX_CONTROL_FRAME_BYTESlimit remains a meaningful safety bound (not raised to paper over the encoding inefficiency)
Reproduction Steps
- Run the gateway with VM compute driver on macOS:
openshell-gateway --config gateway.toml --compute-driver vm - Create a sandbox:
openshell sandbox create - Observe the supervisor error in the sandbox error output:
Error: process error: encode control request: control frame is too large: 1099704 bytes - Verify the system CA bundle size:
ls -la ~/.local/state/openshell/vm-driver/sandboxes/<id>/proxy-tls/ca-bundle.pem~334KB on my macOS
Environment
- OpenShell: (development build from main)
- OS: macOS 26, Apple Silicon (arm64)
- Runtime: VM compute driver (libkrun, Apple Hypervisor.framework)
- CA bundle size: 334,127 bytes (default macOS system trust store)
Logs
2026-09-17T17:01:55.036Z INFO openshell_supervisor: Starting sandbox supervision
2026-09-17T17:01:55.107Z INFO openshell_supervisor: Isolation boundary attached
2026-09-17T17:01:55.108Z INFO openshell_supervisor: Isolation boundary enforcement confirmed
2026-09-17T17:01:55.121Z OCSF CONFIG:ENABLED [INFO] TLS termination enabled: ephemeral CA generated
2026-09-17T17:01:55.122Z OCSF CONFIG:READY [INFO] Policy DNS connected to isolation boundary
2026-09-17T17:01:55.122Z OCSF NET:LISTEN [INFO] 127.0.0.1:3128
2026-09-17T17:01:55.130Z OCSF CONFIG:LOADED [INFO] Acknowledged initial policy revision as loaded
Error: × process error: encode control request: control frame is too large: 1099704 bytes
Relevant code path: `openshell-sandbox-backend/src/boundary_protocol.rs:35` defines `MAX_CONTROL_FRAME_BYTES = 1024 * 1024`. The `encode_frame` function at line 1092–1096 rejects any serialized payload exceeding this limit. The `ca_bundle: Option<Vec<u8>>` field at `boundary_protocol.rs:534` uses serde's default `Vec<u8>` → JSON array encoding.
Relevant code path: `openshell-sandbox-backend/src/boundary_protocol.rs:35` defines `MAX_CONTROL_FRAME_BYTES = 1024 * 1024`. The `encode_frame` function at line 1092–1096 rejects any serialized payload exceeding this limit. The `ca_bundle: Option<Vec<u8>>` field at `boundary_protocol.rs:534` uses serde's default `Vec<u8>` → JSON array encoding.
- 主要语言
- Rust
- 星标
- 8.7k
- 派生
- 1.3k
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 297
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
area:docs
难度 1/5 1 小时以内 新手友好度 88/100
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 82/100
-
area:cli state:validated
难度 2/5 1-3 小时 新手友好度 72/100
-
state:triage-needed
难度 1/5 1 小时以内 新手友好度 90/100
-
area:build spike state:review-ready state:stale
难度 2/5 半天 新手友好度 68/100
相似的 Issue
-
bug github_actions
难度 2/5 1-3 小时 新手友好度 75/100
registrystack/registry-stack#1393 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
难度 2/5 1-3 小时 新手友好度 65/100
rocky-data/rocky#2181 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
oasisprotocol/oasis-sdk#2523 ·
-
bot:ai-assisted component:indexer QA-roadmap status:untriaged
难度 2/5 1-3 小时 新手友好度 75/100
midnightntwrk/midnight-indexer#1557 ·