fix(revert): fix(blueprint): default OpenClaw fetch guard to sandbox proxy - #6051
Conversation
📝 WalkthroughWalkthroughRemoves the build-time fetch-guard runtime verifier script and all associated Dockerfile build steps, staging, and test references. Rewrites Dockerfile Patch 4 to route unconfigured STRICT fetches through the sandbox egress proxy via a managed-proxy activation condition. Adds Patch 6 to rewrite cron model-provider preflight callsites to use ChangesFetch-guard verifier removal and patch rewrites
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
PR Review Advisor — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
Review findings by urgency: 0 required fixes, 3 items to resolve/justify, 0 in-scope improvements
|
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Target RecommendationRequired E2E targets: Dispatch required E2E targets:
Full E2E target advisor summaryE2E Target AdvisorBase: Required E2E targets
Optional E2E targets
Relevant changed files
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Dockerfile`:
- Around line 430-437: Patch 6 currently rewrites the audited options by only
checking for the inserted literal, which can silently allow duplicate mode keys
if the upstream object already has one. Update the Patch 6 logic in the
Dockerfile to fail closed when the reviewed call shape already contains a mode
entry, or restrict the sed rewrite to an exact object shape so it cannot produce
conflicting keys. Add a negative-path check around the
cron-model-provider-preflight flow to prove pre-existing mode values are
rejected before applying the rewrite.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: b637bf0e-8b0b-4d62-8962-5a0b65818ee6
📒 Files selected for processing (5)
Dockerfilescripts/verify-openclaw-fetch-guard-runtime.tssrc/lib/sandbox/build-context.tstest/fetch-guard-patch-regression.test.tstest/sandbox-build-context.test.ts
💤 Files with no reviewable changes (3)
- scripts/verify-openclaw-fetch-guard-runtime.ts
- test/sandbox-build-context.test.ts
- src/lib/sandbox/build-context.ts
| patched_count="$(grep -Fc 'mode: "trusted_env_proxy", auditContext: "cron-model-provider-preflight"' "$f" || true)"; \ | ||
| if [ "${patched_count:-0}" -eq 1 ]; then \ | ||
| echo "INFO: Patch 6 already present in $f"; \ | ||
| elif [ "${patched_count:-0}" -eq 0 ]; then \ | ||
| sed -i -E 's|auditContext: "cron-model-provider-preflight"|mode: "trusted_env_proxy", auditContext: "cron-model-provider-preflight"|g' "$f"; \ | ||
| new_patched_count="$(grep -Fc 'mode: "trusted_env_proxy", auditContext: "cron-model-provider-preflight"' "$f" || true)"; \ | ||
| [ "${new_patched_count:-0}" -eq 1 ] \ | ||
| || patch_fail "Patch 6 verification: expected exactly one patched literal in $f, found ${new_patched_count}"; \ |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Reject pre-existing mode values before Patch 6 rewrites.
Patch 6 verifies only that the inserted literal appears once. If upstream adds a later mode key in the same audited options object, this sed rewrite can create duplicate keys and the later value will win, so the build passes while cron preflight still uses the wrong dispatcher. Add a fail-closed gate/test for an existing mode in the reviewed call shape, or rewrite only an exact reviewed object shape. As per path instructions, Dockerfile* changes must “Preserve deny-by-default behavior” and “Require negative-path tests that prove the boundary rejects bypasses.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Dockerfile` around lines 430 - 437, Patch 6 currently rewrites the audited
options by only checking for the inserted literal, which can silently allow
duplicate mode keys if the upstream object already has one. Update the Patch 6
logic in the Dockerfile to fail closed when the reviewed call shape already
contains a mode entry, or restrict the sed rewrite to an exact object shape so
it cannot produce conflicting keys. Add a negative-path check around the
cron-model-provider-preflight flow to prove pre-existing mode values are
rejected before applying the rewrite.
Source: Path instructions
PR Review Advisor (Nemotron Ultra) — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
🚨 Required before mergeAddress these before merging unless a maintainer explicitly overrides the advisor with rationale.
|
…proxy (NVIDIA#6051) Reverts NVIDIA#5713, merged by accident <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved sandbox proxy handling so unconfigured strict network requests are routed correctly in OpenShell environments. * Added safer cron preflight behavior to avoid breaking DNS-pinned strict-mode runs in proxy-only sandboxes. * **Chores** * Removed an unused runtime verification step and simplified the build process. * Updated related automation and test coverage to match the new proxy and patching behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Carlos Villela <cv@lixo.org>
Reverts #5713, merged by accident
Summary by CodeRabbit
Bug Fixes
Chores
Signed-off-by: Carlos Villela cv@lixo.org