Repository navigation
fix(openshell): reject duplicate sandbox network policy names - #2215
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Maintainer comment pass (author self-review):
|
|
Codex review: needs maintainer review before merge. What this changesThis PR rejects duplicate and reserved OpenShell network policy names during startup and reports how to recover. Example: An Installation contains two network policies named model-egress.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a source-confirmed policy-loss bug that remains on current main; the recovery documentation and diagnostic are present, and no actionable patch defect remains. Priority: P2 Before mergeNone. FindingsNone. Provenance
Agent review detailsHow this fits togetherInstallation loading validates the selected OpenShell Sandbox Driver before construction; accepted policies later become the name-keyed SandboxSpec sent through the OpenShell gateway. flowchart TB
A[Installation configuration] --> B[Driver validation]
B -->|Rejected name| C[Startup recovery diagnostic]
B -->|Valid names| D[OpenShell Sandbox Driver]
D --> E[Name keyed SandboxSpec]
E --> F[OpenShell gateway]
Technical reviewBest possible solution: Land the focused validation and recovery diagnostic while preserving every valid policy’s binaries and endpoints. Do we have a high-confidence way to reproduce the issue? Current-main source shows duplicate names collapsing in Object.fromEntries and the reserved name being replaced by the enrollment rule; no target code was executed during this read-only review. Is this the best way to solve the issue? Validation belongs in the existing Sandbox Driver admission owner, where it prevents ambiguous policies before construction without adding another configuration surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fc05015c8e58. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (9 earlier review cycles; latest 8 shown)
Reviewed October 13, 2026, 4:12 AM ET / 08:12 UTC (Revision 10). |
|
Free's clanker here (an AI agent working on Free's behalf). The check is correct, and the code looks good to me. The pinned OpenShell (v0.1.3-pre.2) keys I'm not landing it yet, for one reason: it refuses Installations that start today. A config with duplicate policy names, or with a policy named Two small asks:
With those in place and CI green, this can land. |
Keep the network-policy breaking-change notice ahead of the notices that landed on main.
Startup was logging only STARTUP_FAILED, so operators could not tell a duplicate or reserved policy name from the process log. The event now carries a fixed code and rename-or-merge reason, without the policy name.
Keep the OpenShell network-policy breaking-change notice ahead of the demo port notice from openclaw#2248.
|
Free's clanker here (an AI agent working on Free's behalf). This PR is reviewed and ready to land, but after today's landings it now conflicts with main in Heads-up on |
|
Free's clanker here (an AI agent working on Free's behalf): #2217 just landed and moved the notice list in |
|
Free's clanker here (an AI agent working on Free's behalf). #2230 just landed, so this conflicts with main again in |
|
Free's clanker here (an AI agent working on Free's behalf). #2249 just landed, so this conflicts with main again in |
|
Free's clanker here (an AI agent working on Free's behalf). #2213 just landed (d3ae099), so this conflicts with main again, in |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(openshell): reject duplicate sandbox network policy names This is item 1/1 in the current shard. Shard 0/1. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Problem
Closes #2214
Duplicate policy names silently collapsed via
Object.fromEntries, dropping egress rules. A policy namedworkspace-node-enrollmentis reserved and is refused as well. That name starts today, and a user rule with it is replaced when a workspace-node binding exists.Change
Startup refuses duplicate
policy.networkPoliciesnames and the reserved nameworkspace-node-enrollment, withOPENSHELL_NETWORK_POLICY_NAME_REJECTEDand reasonrename-or-merge. Recovery is to rename or merge the duplicate names, and to rename a policy calledworkspace-node-enrollment.docs/guides/deploy/breaking-changes.mdrecords both refusals on 2026-10-13, ahead of the #2248 demo port notice.See commits on
ericcaiwx-star:codex/batch-d-4-oct11.Verification
Exact head
8eeb4973873186dc247a1937d27f20fb8687a362. That commit mergesupstream/main(07590c64e27ac61c9ad60d9ab61424b70281011a). The rejection check, startup diagnostic, and regression test matche55a3abae41a17fc931f37e0c044222c1fbb27bc. Behavioral proof below is from that commit unless a parent is named. Node v26.7.0, macOS.Corrected startup used an installation file with two policies,
model-egressandmodel-egress-backup, sharing the fixture endpoint hostapi.openai.comport 443 and binary/app/bin/model-client. Kubernetes authentication was kubeconfig against a local single-node k3s API published only on loopback. The development auth secret is the repository placeholder and is not printed.A fresh disposable PostgreSQL database was migrated with proof head
e55a3abae41a17fc931f37e0c044222c1fbb27bc. Output:{"event":"migration.completed","history":"empty"}. Development bootstrap wrote installationins_1491ce6c-c193-49fe-a675-1ce592fbff53.NODE_ENV=development node apps/controller/src/server.mjson that proof head logged:The process was stopped with SIGTERM and logged
shutdown.completed. stderr was empty. The shipped loader still reported both policy names,model-egressandmodel-egress-backup.Upgrade.
gh release listpreviously returned no releases, and this checkout has nov*tags. The installed revision is merge-based2fe579cd51f53bb979f0cb0f9ad8785b5f4585a. That proof head changes no migration, lockfile, package manifest, or platform-state files relative to that revision. The same database and the same installation file, started with that revision'sserver.mjs, logged:That process also logged
shutdown.completedafter SIGTERM. After both processes exited, the stored installation id was stillins_1491ce6c-c193-49fe-a675-1ce592fbff53, with 2 identities and 2 bindings.Invalid names on that proof head:
node --test --test-name-pattern='shipped startup names a rejected OpenShell policy' tests/integration/sandbox-driver-startup.test.mjspassed 1, failed 0, exit 0. A duplicate planted policy name and the reserved nameworkspace-node-enrollmenteach make shippedserver.mjsexit 1 withstartup-errorcodeOPENSHELL_NETWORK_POLICY_NAME_REJECTEDand reasonrename-or-merge. Neither name appeared in stdout or stderr.Loader and earlier server results below are from parent
763fd98e30001e78a50104d38c5274e21eda9b2b. macOS, Node v26.7.0.Shipped entry:
NODE_ENV=development OCC_PORT=18081 node apps/controller/src/server.mjs, withOCC_CONFIG_PATHpointing at an Installation file.OCC_HOSTis loopback. The development auth secret is the repository's 52-character development placeholder and is not printed. Each file setsgateway.readiness.timeoutMs=120000andgatewayTrustedProxyCidrsto one documentation TEST-NET address. The first policy ismodel-egresswith endpoint hostapi.openai.comport 443 and binary/app/bin/model-client.Duplicate and reserved names fail inside Installation loading. The parent run stopped the corrected name at an unset database URL. The proof-head run above continues that corrected file through
listening.Risks
None identified beyond the stricter validation described above.