You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DGX Spark][Onboard] balanced tier creates global brave provider profile as side effect — second sandbox with Brave Search fails rebuild preflight with false "credential invalid" #7097
Applying the balanced policy tier to any sandbox creates a global brave.yaml provider profile as a side effect, even when Brave Search web tool is not explicitly enabled. When a second sandbox later enables Brave Search, onboard reports custom provider profile 'brave' already exists and nemoclaw rebuild preflight incorrectly fails with "Brave Search credential is invalid" — even though the credential is valid and Brave Search works correctly in practice.
Two defects:
balanced tier applying the brave egress preset creates a global provider profile as a side effect — network policy and provider profile are independent concerns and should not be coupled.
rebuild preflight incorrectly rejects a valid Brave credential, blocking rebuild unless BRAVE_API_KEY is re-supplied as an env var.
Reproduced on both v0.0.83 LKG and v0.0.84. Related to but distinct from #5367 (that bug was a gateway-unusable failure; this is a false preflight rejection with a working credential).
Platform scope: Reproduced on DGX Spark (Ubuntu 24.04 aarch64); likely affects all platforms using balanced tier; other platforms not tested.
Regression: Unknown — earlier versions not tested.
Install NemoClaw with any sandbox using the balanced policy tier (express install or nemoclaw onboard with default Balanced tier). Brave Search web tool does not need to be enabled.
Create a second sandbox and enable Brave Search web tool during onboarding.
Automated triage findings (unassigning after investigation — this needs maintainer decisions I shouldn't make unattended). Both defects were traced to source.
NemoClaw's own provider-profile import is already idempotent at both (and the only two) call sites, so this is not a mechanical NemoClaw fix:
src/lib/onboard/brave-provider-profile.ts:126-127 — if (/already exists/i.test(rawDiagnostic)) continue; (tolerates OpenShell's non-zero re-import), covered by src/lib/onboard/brave-provider-profile.test.ts:99-113.
src/lib/actions/credentials-add.ts:64 — same tolerance.
The braveegress policy preset (nemoclaw-blueprint/policies/presets/brave.yaml) is a pure L7 egress allowlist with no provider-profile reference, and tier resolution (src/lib/policy/tiers.ts) returns preset names only — nothing in NemoClaw TS turns "brave egress preset applied" into "provider profile imported" (the profile import is token-gated: brave-provider-profile.ts:98,106). So the un-tolerated × provider profile import failed is emitted outside NemoClaw's wrapped call sites — i.e. OpenShell materializing/rejecting a provider profile when the egress preset is applied, or a direct import. Needs a design decision + OpenShell-side confirmation, not a repo change here.
src/lib/onboard/web-search-flow.ts:277-286 resolves the key only from process.env (getCredential → src/lib/credentials/store.ts:185-190, env-only) and throws the exact "requires BRAVE_API_KEY or a saved Brave Search credential" message when it is absent.
The durable web-search credential is not on the host env after a fresh rebuild process — it lives in the OpenShell gateway as a sandbox-scoped provider named `${sandboxName}-${provider}-search` (src/lib/onboard/messaging-prep.ts:91). So preflight fails even though the credential is valid and Brave works at runtime.
The inference preflight already solves this exact "gateway holds the secret, host env doesn't" case — src/lib/actions/sandbox/rebuild-credential-preflight.ts:189-194 ("provider registered in gateway — skipping env check"). The web-search preflight has no equivalent gateway-registered fallback.
Suggested fix (for a maintainer): in preflightRebuildWebSearchCredential, when host-env validation throws, check whether the sandbox-scoped web-search provider `${sandboxName}-${provider}-search` is registered in the gateway (mirroring providerExistsInGateway) and, if so, accept — skip the host-env requirement. This threads the sandbox name + a gateway check into the preflight.
Why I'm not landing it unattended: it relaxes a credential preflight (a security-relevant trust boundary), and its correctness depends on the gateway provider-name + gateway recognition, which can't be verified on the CPU/DGX-Spark hosts available to this loop — a mocked unit test would pass regardless of whether the real gateway lookup is right, giving false confidence. It should be implemented and verified against a real gateway.
The two defects are in separate flows (onboard/import vs. rebuild preflight) and can be fixed separately.
Claimed this and opened #7129 for the rebuild preflight failure (defect 2).
Root cause:saveCredential stages web-search keys to the process env only — nothing is persisted to host disk by design (credentials-gateway-only contract); the OpenShell gateway provider (<sandbox>-brave-search) is the durable system of record, which is why Brave Search keeps working in the TUI. A fresh rebuild --yes process therefore has no host BRAVE_API_KEY, and the preflight demanded one even though the OpenClaw recreate path reuses the gateway-registered credential (messaging-preprequiresExactOpenClawProviderBinding). #7129 makes the preflight accept that same gateway credential-only binding (identity metadata only — no credential values read), failing closed for mismatched bindings, staged host keys, and non-OpenClaw agents.
On defect 1 (balanced tier creating a global brave provider profile, and custom provider profile 'brave' already exists on the second onboard): NemoClaw's provider profile import has tolerated already exists since #6165 (in v0.0.53+), so the re-import itself is non-fatal on v0.0.83/84 — the message you saw is OpenShell's stderr, not an aborting error. Whether the brave egress preset should stop registering the provider profile is a design decision: the profile is what drives the L7 proxy's X-Subscription-Token rewrite for that preset, so decoupling them needs maintainer direction rather than a drive-by change. Leaving that part open here.
Activity
jason-ma-nv commentedon Jul 17, 2026
Automated triage findings (unassigning after investigation — this needs maintainer decisions I shouldn't make unattended). Both defects were traced to source.
Defect 1 —
custom provider profile 'brave' already existson second-sandbox onboardNemoClaw's own provider-profile import is already idempotent at both (and the only two) call sites, so this is not a mechanical NemoClaw fix:
src/lib/onboard/brave-provider-profile.ts:126-127—if (/already exists/i.test(rawDiagnostic)) continue;(tolerates OpenShell's non-zero re-import), covered bysrc/lib/onboard/brave-provider-profile.test.ts:99-113.src/lib/actions/credentials-add.ts:64— same tolerance.The
braveegress policy preset (nemoclaw-blueprint/policies/presets/brave.yaml) is a pure L7 egress allowlist with no provider-profile reference, and tier resolution (src/lib/policy/tiers.ts) returns preset names only — nothing in NemoClaw TS turns "brave egress preset applied" into "provider profile imported" (the profile import is token-gated:brave-provider-profile.ts:98,106). So the un-tolerated× provider profile import failedis emitted outside NemoClaw's wrapped call sites — i.e. OpenShell materializing/rejecting a provider profile when the egress preset is applied, or a direct import. Needs a design decision + OpenShell-side confirmation, not a repo change here.Defect 2 —
rebuild --yespreflight false "Brave Search credential is invalid"Root cause is real and localized to the web-search rebuild preflight:
src/lib/actions/sandbox/rebuild-target-runtime.ts:34-60(preflightRebuildWebSearchCredential) →rebuildOnboardDependencies.ensureValidatedWebSearchCredential(config, /*nonInteractive*/ true).src/lib/onboard/web-search-flow.ts:277-286resolves the key only fromprocess.env(getCredential→src/lib/credentials/store.ts:185-190, env-only) and throws the exact "requires BRAVE_API_KEY or a saved Brave Search credential" message when it is absent.rebuildprocess — it lives in the OpenShell gateway as a sandbox-scoped provider named`${sandboxName}-${provider}-search`(src/lib/onboard/messaging-prep.ts:91). So preflight fails even though the credential is valid and Brave works at runtime.The inference preflight already solves this exact "gateway holds the secret, host env doesn't" case —
src/lib/actions/sandbox/rebuild-credential-preflight.ts:189-194("provider registered in gateway — skipping env check"). The web-search preflight has no equivalent gateway-registered fallback.Suggested fix (for a maintainer): in
preflightRebuildWebSearchCredential, when host-env validation throws, check whether the sandbox-scoped web-search provider`${sandboxName}-${provider}-search`is registered in the gateway (mirroringproviderExistsInGateway) and, if so, accept — skip the host-env requirement. This threads the sandbox name + a gateway check into the preflight.Why I'm not landing it unattended: it relaxes a credential preflight (a security-relevant trust boundary), and its correctness depends on the gateway provider-name + gateway recognition, which can't be verified on the CPU/DGX-Spark hosts available to this loop — a mocked unit test would pass regardless of whether the real gateway lookup is right, giving false confidence. It should be implemented and verified against a real gateway.
The two defects are in separate flows (onboard/import vs. rebuild preflight) and can be fixed separately.
nvshaxie commentedon Jul 18, 2026
Claimed this and opened #7129 for the rebuild preflight failure (defect 2).
Root cause:
saveCredentialstages web-search keys to the process env only — nothing is persisted to host disk by design (credentials-gateway-only contract); the OpenShell gateway provider (<sandbox>-brave-search) is the durable system of record, which is why Brave Search keeps working in the TUI. A freshrebuild --yesprocess therefore has no hostBRAVE_API_KEY, and the preflight demanded one even though the OpenClaw recreate path reuses the gateway-registered credential (messaging-preprequiresExactOpenClawProviderBinding). #7129 makes the preflight accept that same gateway credential-only binding (identity metadata only — no credential values read), failing closed for mismatched bindings, staged host keys, and non-OpenClaw agents.On defect 1 (balanced tier creating a global
braveprovider profile, andcustom provider profile 'brave' already existson the second onboard): NemoClaw'sprovider profile importhas toleratedalready existssince #6165 (in v0.0.53+), so the re-import itself is non-fatal on v0.0.83/84 — the message you saw is OpenShell's stderr, not an aborting error. Whether thebraveegress preset should stop registering the provider profile is a design decision: the profile is what drives the L7 proxy'sX-Subscription-Tokenrewrite for that preset, so decoupling them needs maintainer direction rather than a drive-by change. Leaving that part open here.test(rebuild): cover mismatched gateway web-search binding (#7097)
fix(rebuild): reuse gateway web-search credential in preflight (#7129)
fix(onboard): reuse the gateway web-search credential on rebuild recr…