mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Wait for loaded agent defaults before welcome kickoff
Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ?? {
|
||||
|
||||
@@ -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("/");
|
||||
|
||||
Reference in New Issue
Block a user