Wait for loaded agent defaults before welcome kickoff

Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
kenny lopez
2026-07-27 13:31:02 +01:00
parent 2a8a7bc773
commit 7b46102d04
3 changed files with 20 additions and 3 deletions
@@ -33,7 +33,7 @@ export function useGlobalAgentConfig(): {
globalConfig: GlobalAgentConfig;
isLoading: boolean;
} {
const { data, isPending } = useQuery({
const { data, isPending, isPlaceholderData } = useQuery({
queryKey: globalAgentConfigQueryKey,
queryFn: getGlobalAgentConfig,
// Config is only mutated via setGlobalAgentConfig — treat as stable until
@@ -45,7 +45,7 @@ export function useGlobalAgentConfig(): {
return {
globalConfig: data ?? EMPTY_CONFIG,
isLoading: isPending,
isLoading: isPending || isPlaceholderData,
};
}
+9
View File
@@ -383,6 +383,8 @@ type E2eConfig = {
model: string | null;
preferred_runtime?: string | null;
};
/** Delay (ms) applied to `get_global_agent_config`. */
globalAgentConfigDelayMs?: number;
/** File-layer config returned by runtime id. */
runtimeFileConfigs?: Record<string, RuntimeFileConfigSubset | null>;
/** Baked build env returned by the display and key-name Tauri commands. */
@@ -10524,6 +10526,13 @@ export function maybeInstallE2eTauriMocks() {
return config.mock?.runtimeFileConfigs?.[runtimeId] ?? null;
}
case "get_global_agent_config": {
const globalAgentConfigDelayMs =
config?.mock?.globalAgentConfigDelayMs ?? 0;
if (globalAgentConfigDelayMs > 0) {
await new Promise((resolve) =>
window.setTimeout(resolve, globalAgentConfigDelayMs),
);
}
// Return the mutable persisted mock value, seeded from the test config.
return (
mockGlobalAgentConfig ?? {
+9 -1
View File
@@ -2710,7 +2710,15 @@ test("first-run onboarding lands before Welcome team bootstrap completes", async
await seedActiveIdentity(page, BLANK_TYLER_IDENTITY);
await installMockBridge(
page,
{ createManagedAgentDelayMs: 1_000 },
{
createManagedAgentDelayMs: 1_000,
globalAgentConfigDelayMs: 250,
globalAgentConfig: {
env_vars: { OPENAI_COMPAT_API_KEY: "e2e-placeholder" },
provider: "openai",
model: "gpt-5.5",
},
},
{ skipOnboardingSeed: true },
);
await page.goto("/");