fix(e2e): unset OPENCLAW_GATEWAY_PORT and TOKEN in devices approve guard#4573
fix(e2e): unset OPENCLAW_GATEWAY_PORT and TOKEN in devices approve guard#4573hunglp6d wants to merge 1 commit into
Conversation
The #4462 sandbox configure guard only unset OPENCLAW_GATEWAY_URL for `openclaw devices approve`, but the OpenClaw CLI can also derive the gateway connection from OPENCLAW_GATEWAY_PORT (as a fallback) and OPENCLAW_GATEWAY_TOKEN (for authentication). When the CLI falls back to the port-based URL, the approval request fails with "GatewayClientRequestError: scope upgrade pending approval" because the gateway rejects the approve command from a connection that itself requires the upgraded scope. Unset all three gateway env vars (URL, PORT, TOKEN) so the CLI connects directly to the local OpenClaw daemon for the scope approval. Signed-off-by: Hung Le <hple@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Review AdvisorFindings: 0 needs attention, 1 worth checking, 1 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
This is an automated advisory review. A human maintainer must make the final merge decision. |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
Summary
The
issue-4462-scope-upgrade-approval-e2e / runjob in nightly run #26698759656 failed because theopenclaw devices approveguard function in the sandbox proxy env only unsetOPENCLAW_GATEWAY_URL, leavingOPENCLAW_GATEWAY_PORTandOPENCLAW_GATEWAY_TOKENin the environment. The OpenClaw CLI falls back to the port-based gateway URL, causing the approval to route through the gateway and fail withGatewayClientRequestError: scope upgrade pending approval.Changes
scripts/nemoclaw-start.sh: Unset all three gateway env vars (OPENCLAW_GATEWAY_URL,OPENCLAW_GATEWAY_PORT,OPENCLAW_GATEWAY_TOKEN) in thedevices approveguard subshell.test/nemoclaw-start.test.ts: Update the fakeopenclawstub to log PORT and TOKEN alongside URL; addOPENCLAW_GATEWAY_PORTandOPENCLAW_GATEWAY_TOKENto the test env; update assertions to verify all three areunsetfordevices approvewhile remaining set for other commands.Root Cause
The #4462 guard (line 1872 of
nemoclaw-start.sh) runsopenclaw devices approvein a subshell that unsets onlyOPENCLAW_GATEWAY_URL. The sandbox proxy env also exportsOPENCLAW_GATEWAY_PORT(line 264) andOPENCLAW_GATEWAY_TOKEN(line 1351). When the OpenClaw CLI resolves the gateway URL, it can fall back toOPENCLAW_GATEWAY_PORT, reconnecting to the gateway and hitting the scope-upgrade Catch-22: the approve command itself requires the upgraded scope.Validation
The
GITHUB_TOKENused by this CI run does not include theworkflowscope, so the-custom-e2evalidation branch could not be pushed. To validate manually:a25b3931Signed-off-by: Hung Le hple@nvidia.com