Skip to content

fix(openclaw): surface tenant headers in remote setup#1707

Open
Hinotoi-agent wants to merge 1 commit intovolcengine:mainfrom
Hinotoi-agent:fix/openclaw-root-key-tenant-config
Open

fix(openclaw): surface tenant headers in remote setup#1707
Hinotoi-agent wants to merge 1 commit intovolcengine:mainfrom
Hinotoi-agent:fix/openclaw-root-key-tenant-config

Conversation

@Hinotoi-agent
Copy link
Copy Markdown
Contributor

Summary

  • Add accountId and userId prompts to OpenClaw remote-mode setup so root-key users can configure the tenant headers required by tenant-scoped OpenViking APIs.
  • Preserve/write those fields in the setup-helper install and upgrade flows.
  • Document the root-key accountId / userId configuration in both English and Chinese install guides.
  • Add regression coverage for the remote setup wizard saving and defaulting tenant header config.

Fixes #1700.

Why

OpenViking now requires ROOT/root-key requests to tenant-scoped APIs to include X-OpenViking-Account and X-OpenViking-User. The OpenClaw plugin client already supports these headers through accountId and userId, but the supported setup/docs path only exposed baseUrl, apiKey, and agentId. A user following the documented remote-mode setup with root_api_key can therefore hit the reported INVALID_ARGUMENT error after upgrade.

Affected files

  • examples/openclaw-plugin/commands/setup.ts
  • examples/openclaw-plugin/setup-helper/install.js
  • examples/openclaw-plugin/INSTALL.md
  • examples/openclaw-plugin/INSTALL-ZH.md
  • examples/openclaw-plugin/tests/ut/setup-command.test.ts

Test plan

  • node --check examples/openclaw-plugin/setup-helper/install.js
  • npm test -- --run tests/ut/setup-command.test.ts tests/ut/client.test.ts from examples/openclaw-plugin
  • npm test -- --run tests/ut/setup-command.test.ts from examples/openclaw-plugin
  • git diff --check

Note: I also tried tests/ut/config.test.ts, but current main appears to have stale assertions expecting the default mode to be local while config.ts now defaults invalid/missing mode to remote; that failure is unrelated to this patch.

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

1700 - Fully compliant

Compliant requirements:

  • Added accountId and userId prompts to OpenClaw remote-mode setup
  • Preserved/wrote accountId and userId in install and upgrade flows
  • Updated English and Chinese install guides with root-key configuration steps
  • Added regression tests for remote setup wizard saving and defaulting tenant header config
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🏅 Score: 90
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Question]: 从v0.3.8升级到v0.3.10以后出现api认证错误 OpenViking request failed [INVALID_ARGUMENT]

1 participant