aminghadersohi opened a new pull request, #42144:
URL: https://github.com/apache/superset/pull/42144

   ## Summary
   
   - Route onboarding and User Settings credential saves through one canonical 
`agentic_tools[tool][field]` patch helper.
   - Teach `check-auth` that Claude `setup-token` values are 
`CLAUDE_CODE_OAUTH_TOKEN` OAuth credentials, not Anthropic Console API keys.
   - Validate credentials stored in User Settings → Env Vars by reusing the 
same user/tool env resolver used for executor session environments.
   - Validate Claude subscription tokens through the Claude SDK with an 
explicit per-probe env, avoiding daemon-global `process.env` mutation.
   - Include `CLAUDE_CODE_OAUTH_TOKEN` env-var setups in onboarding/banner key 
detection.
   - Clarify the short `claude setup-token` instructions with terminal/Claude 
Code install context and a Claude Code install-docs link.
   - Add regression tests for shared storage shape, Claude subscription-token 
auth checks, user env-var auth checks, and banner detection.
   
   ## Root cause
   
   The onboarding wizard already saved Claude subscription tokens to the same 
canonical per-user storage path as User Settings: 
`agentic_tools['claude-code'].CLAUDE_CODE_OAUTH_TOKEN`. The broken part was 
auth verification: `check-auth` only resolved/validated `ANTHROPIC_API_KEY` for 
Claude Code, so a `claude setup-token` value could be tested as the wrong 
credential type or ignored when stored.
   
   There was also a gap for non-recommended-but-working setups where users put 
`ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN` in User Settings → Env Vars. 
Executors can receive those env vars, but auth verification and banners were 
not fully aligned with that effective runtime env.
   
   ## Canonical path after this change
   
   Onboarding and User Settings now save Claude subscription tokens through the 
same helper and storage shape: 
`agentic_tools['claude-code'].CLAUDE_CODE_OAUTH_TOKEN`. `check-auth` resolves 
credentials in the same order sessions effectively use them: canonical per-tool 
credentials first, then user env vars for the tool, then native Claude auth 
fallback.
   
   ## Verification
   
   - `pnpm i`
   - `pnpm --filter @agor/daemon test -- src/services/check-auth.test.ts`
   - `pnpm --filter agor-ui test -- 
src/components/OnboardingBanners/OnboardingBanners.test.tsx 
src/utils/agenticToolCredentials.test.ts 
src/components/OnboardingWizard/OnboardingWizard.test.tsx 
src/components/SettingsModal/UserSettingsModal.test.tsx`
   - `pnpm --filter agor-ui typecheck`
   - `pnpm check` — typecheck/lint/shortid phases passed; stopped at existing 
`check:multitenancy-boundaries` baseline violations unrelated to this PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to