Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: hetero agent cloud credential alert flash and width misalignment (#15056)

LiJian9a4c8d5590b3
diff --git a/src/business/client/hooks/useHeteroAgentCloudConfig.ts b/src/business/client/hooks/useHeteroAgentCloudConfig.ts
index 364fc5fde5d..27f754144e5 100644
--- a/src/business/client/hooks/useHeteroAgentCloudConfig.ts
+++ b/src/business/client/hooks/useHeteroAgentCloudConfig.ts
@@ -28,9 +28,10 @@ export const useHeteroAgentCloudConfig = (): HeteroAgentCloudConfig => {
const needsCredCheck = !isDesktop && isClaudeCode;
// Only fetch credentials when actually needed
- const { data: credsData } = lambdaQuery.market.creds.list.useQuery(undefined, {
- enabled: needsCredCheck,
- });
+ const { data: credsData, isLoading: isCredsLoading } = lambdaQuery.market.creds.list.useQuery(
+ undefined,
+ { enabled: needsCredCheck },
+ );
// isConfigured is true when:
// 1. Running on desktop (local execution, no cloud creds needed), or
@@ -39,9 +40,14 @@ export const useHeteroAgentCloudConfig = (): HeteroAgentCloudConfig => {
// 4. The agent env has a CLAUDE_CODE_CRED_KEY reference set, or
// 5. The CLAUDE_CODE_OAUTH_TOKEN credential actually exists in the vault
// (handles the case where the credential was saved but the env ref wasn't written)
+ // 6. Credentials are still loading — treat as configured to avoid a flash of the
+ // "not configured" alert that immediately disappears once the query resolves
const hasCredInVault = (credsData?.data ?? []).some((c) => c.key === CLAUDE_TOKEN_CRED_KEY);
const isConfigured =
- !needsCredCheck || !!heterogeneousProvider?.env?.CLAUDE_CODE_CRED_KEY || hasCredInVault;
+ !needsCredCheck ||
+ !!heterogeneousProvider?.env?.CLAUDE_CODE_CRED_KEY ||
+ hasCredInVault ||
+ isCredsLoading;
const goToConfig = () => {
const agentId = params.aid;
diff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
index 9d3bd198a61..a8c9fd2954c 100644
--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
@@ -7,6 +7,7 @@ import { useTranslation } from 'react-i18next';
import { useHeteroAgentCloudConfig } from '@/business/client/hooks/useHeteroAgentCloudConfig';
import { type ActionKeys } from '@/features/ChatInput';
import { ChatInput } from '@/features/Conversation';
+import WideScreenContainer from '@/features/WideScreenContainer';
import { useChatStore } from '@/store/chat';
import WorkingDirectoryBar from './WorkingDirectoryBar';
@@ -34,20 +35,22 @@ const HeterogeneousChatInput = memo(() => {
return (
<Flexbox>
{!isConfigured && (
- <Flexbox paddingBlock={'0 6px'} paddingInline={12}>
- <Alert
- type={'warning'}
- title={t('heteroAgent.cloudNotConfigured.title')}
- description={
- <Flexbox horizontal align={'center'} justify={'space-between'} gap={8}>
- <span>{t('heteroAgent.cloudNotConfigured.desc')}</span>
- <Button size={'small'} type={'primary'} onClick={goToConfig}>
- {t('heteroAgent.cloudNotConfigured.action')}
- </Button>
- </Flexbox>
- }
- />
- </Flexbox>
+ <WideScreenContainer>
+ <Flexbox paddingBlock={'0 6px'} paddingInline={12}>
+ <Alert
+ type={'warning'}
+ title={t('heteroAgent.cloudNotConfigured.title')}
+ description={
+ <Flexbox horizontal align={'center'} justify={'space-between'} gap={8}>
+ <span>{t('heteroAgent.cloudNotConfigured.desc')}</span>
+ <Button size={'small'} type={'primary'} onClick={goToConfig}>
+ {t('heteroAgent.cloudNotConfigured.action')}
+ </Button>
+ </Flexbox>
+ }
+ />
+ </Flexbox>
+ </WideScreenContainer>
)}
<ChatInput
skipScrollMarginWithList