Skip to content

fix: idempotent provider/sandbox upsert + per-provider credential vault#5

Open
mafueee wants to merge 6 commits intofeat/multi-claw-managementfrom
fix/idempotent-deploy-credential-vault
Open

fix: idempotent provider/sandbox upsert + per-provider credential vault#5
mafueee wants to merge 6 commits intofeat/multi-claw-managementfrom
fix/idempotent-deploy-credential-vault

Conversation

@mafueee
Copy link
Copy Markdown
Owner

@mafueee mafueee commented Mar 26, 2026

Summary

Resolves three critical deployment failures and implements persistent API key management.

Fixed Issues

  1. Provider Type ConflictupdateProvider rejected when provider type was included. ensureProvider() now handles this idempotently: checks existing type, omits type on updates, and does delete+recreate when type changes.

  2. Unsupported Inference ProvidersetClusterInference was passing raw provider names instead of mapped types. Fixed to use mapProviderToGrpcType consistently.

  3. Sandbox UNIQUE ConstraintcreateSandbox failed when sandbox already existed. ensureSandbox() catches the UNIQUE constraint error and does delete+recreate.

  4. API Key Persistence — Added per-provider credential vault at ~/.nemoclaw/credentials.json. Users configure each provider's key once; all future deploys auto-fill from the vault.

Files Changed

File Change
gui/server/lib/grpcClient.js Added ensureProvider() and ensureSandbox() helpers
gui/server/index.js Credential vault (load/save/restore at startup) + updated deployment endpoints
gui/server/routes/claws.js Claw creation uses ensureProvider/ensureSandbox
gui/src/components/inference/InferenceConfig.tsx Sends apiKey on save for vault persistence
gui/src/api/client.ts Added apiKey to InferenceConfigData interface
test/grpc-client.test.js Added ensureProvider/ensureSandbox to exports check
README.md Documented credential vault and idempotent helpers

Testing

  • 22 unit tests pass
  • Frontend builds successfully
  • Server starts and responds to health checks

mafueee added 6 commits March 26, 2026 20:54
…lt\n\n- Add ensureProvider() helper that handles gateway type-change rejection\n by delete+recreate instead of failing on updateProvider\n- Add ensureSandbox() helper that handles UNIQUE constraint by\n delete+recreate\n- Add per-provider credential vault (~/.nemoclaw/credentials.json)\n so API keys persist across provider switches and redeployments\n- Update all 3 deployment code paths (onboard, claws, inference config)\n to use ensureProvider/ensureSandbox and auto-fill from vault\n- InferenceConfig UI now sends apiKey on save\n- Add isValidApiKey() helper (was referenced but never defined)\n- Update grpc-client tests for new exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant