Description

Make /profiles and /tools like server side /logs

Problem

The /profiles and /tools pages had a suboptimal loading experience:

  • /profiles showed a spinner at the top on hard refresh
  • /tools showed a spinner in the middle on hard refresh
  • /logs/llm-proxy already had SSR and loaded without spinners

Solution

Applied the same SSR pattern used in /logs/llm-proxy to both pages:

  1. Server components now fetch initial data using getServerApiHeaders() and archestraApiSdk
  2. Initial data is passed to client components via props
  3. Query hooks use initialData to avoid client-side fetching on first render

Changes

/profiles page:

/tools page:

/fixes #1427 /claim #1427


[!NOTE] Server-render /profiles and /tools and pass initial data to client/hooks to eliminate first-load spinners, with policy transform utilities and default page sizes extracted.

  • Frontend
    • Profiles (/profiles):
      • Server fetch for agents and teams in app/profiles/page.tsx; pass initialData to client.
      • page.client.tsx: consume initialData; use DEFAULT_AGENTS_PAGE_SIZE; types tightened.
      • useProfilesPaginated now supports initialData (first page, default sort/filter) to avoid client refetch.
    • Tools (/tools):
      • Server fetch for agentTools, agents, mcpServers, internalMcpCatalog, and policies in app/tools/page.tsx; pass initialData.
      • page.client.tsx and assigned-tools-table.tsx: accept/propagate initialData to hooks; conditionally seed queries only for first-page default state; use DEFAULT_TOOLS_PAGE_SIZE.
  • Lib
    • lib/agent.query.ts: useProfilesPaginated adds initialData gating.
    • lib/policy.query.ts: hooks accept initialData and use shared transforms.
    • lib/policy.utils.ts: new transformToolInvocationPolicies and transformToolResultPolicies helpers.
    • lib/utils.ts: add DEFAULT_AGENTS_PAGE_SIZE and DEFAULT_TOOLS_PAGE_SIZE.
  • UX
    • First-render spinners removed for /profiles and /tools via SSR initial data.

Written by Cursor Bugbot for commit 0dfe34d2acbf197c04083ed1552244c47da29374. This will update automatically on new commits. Configure here.

Claim

Total prize pool $50
Total paid $0
Status Pending
Submitted December 06, 2025
Last updated December 06, 2025

Contributors

EX

Excellencedev

@Excellencedev

100%

Sponsors

AR

Archestra

@archestra-ai

$50