feat(beginner): protect default AI model and prevent repeated onboarding (#1444)

Co-authored-by: Dean <afei.wuhao@gmail.com>
This commit is contained in:
deanokk
2026-03-30 21:04:43 +08:00
committed by shinchan-zhai
parent 796606a8a8
commit d7461c739a
5 changed files with 61 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ import {
AI_PROVIDER_CONFIG,
getShortName,
} from './model-constants'
import { getBeginnerWalletAddress } from '../../lib/onboarding'
import { getBeginnerWalletAddress, getUserMode } from '../../lib/onboarding'
interface ModelConfigModalProps {
allModels: AIModel[]
@@ -84,6 +84,7 @@ export function ModelConfigModal({
const availableModels = allModels || []
const configuredIds = new Set(configuredModels?.map(m => m.id) || [])
const isClaw402Selected = selectedModel?.provider === 'claw402' || selectedModel?.id === 'claw402'
const isBeginnerDefaultModel = isClaw402Selected && getUserMode() === 'beginner'
const stepLabels = [
t('modelConfig.selectModel', language),
t(
@@ -117,7 +118,7 @@ export function ModelConfigModal({
</h3>
</div>
<div className="flex items-center gap-2">
{editingModelId && (
{editingModelId && !isBeginnerDefaultModel && (
<button
type="button"
onClick={() => onDelete(editingModelId)}