diff --git a/frontend/src/lib/components/common/table/AgentRow.svelte b/frontend/src/lib/components/common/table/AgentRow.svelte index d9a5d26f31..bcd7f92d75 100644 --- a/frontend/src/lib/components/common/table/AgentRow.svelte +++ b/frontend/src/lib/components/common/table/AgentRow.svelte @@ -29,7 +29,7 @@ deploymentDrawer: DeployWorkspaceDrawer deleteConfirmedCallback?: (() => void) | undefined depth?: number - menuOpen?: boolean + menuOpen: boolean keyboardSelected?: boolean } @@ -41,7 +41,7 @@ deploymentDrawer, deleteConfirmedCallback = $bindable(), depth = 0, - menuOpen = $bindable(false), + menuOpen = $bindable(), keyboardSelected = false }: Props = $props() diff --git a/frontend/src/lib/components/flows/agentDraft.svelte.ts b/frontend/src/lib/components/flows/agentDraft.svelte.ts index fd87b950de..d395f2f95d 100644 --- a/frontend/src/lib/components/flows/agentDraft.svelte.ts +++ b/frontend/src/lib/components/flows/agentDraft.svelte.ts @@ -333,7 +333,7 @@ export function useAgentDraft(opts: AgentDraftOptions): AgentDraftHandle { loading = false await sync.maybeRestore() }, - (err) => { + async (err) => { if (loadedFor !== key) return // Nothing is written until the first edit: the sync saves only on user input, and // the first deploy creates the resource at whatever path the form then holds. @@ -349,6 +349,9 @@ export function useAgentDraft(opts: AgentDraftOptions): AgentDraftHandle { wsSpecific: false } loading = false + // Seeds the draft cell with the empty agent, or its first-write guard swallows the + // first edit. + await sync.maybeRestore() return } // A failed load knows neither the resource's type nor its value, so it refuses: diff --git a/frontend/src/lib/components/home/ItemsList.svelte b/frontend/src/lib/components/home/ItemsList.svelte index b27b32097f..f9210d2361 100644 --- a/frontend/src/lib/components/home/ItemsList.svelte +++ b/frontend/src/lib/components/home/ItemsList.svelte @@ -379,13 +379,22 @@ agentOwnerCounts = {} return } - let rows: ListableResource[] + const rows: ListableResource[] = [] try { - rows = await ResourceService.listResource({ - workspace: ws, - resourceType: 'ai_agent', - includeDraftOnly: true - }) + // Paged even though search and scoping run over the whole set here: the listing caps a + // page, and only the first carries the draft-only rows, so a short page ends it. + const perPage = 1000 + for (let page = 1; ; page++) { + const batch = await ResourceService.listResource({ + workspace: ws, + resourceType: 'ai_agent', + includeDraftOnly: true, + page, + perPage + }) + rows.push(...batch) + if (batch.length < perPage || gen !== agentsGen) break + } } catch (e: any) { if (gen !== agentsGen) return sendUserToast(`Failed to load agents: ${e?.body ?? e?.message ?? e}`, true)