Skip to content

perf: deduplicate _goose/providers/list RPC call at startup#8873

Merged
matt2e merged 4 commits intomainfrom
dedupe-call-at-startup
Apr 29, 2026
Merged

perf: deduplicate _goose/providers/list RPC call at startup#8873
matt2e merged 4 commits intomainfrom
dedupe-call-at-startup

Conversation

@matt2e
Copy link
Copy Markdown
Collaborator

@matt2e matt2e commented Apr 28, 2026

Summary

  • Merged the separate loadProviders and loadProviderInventory startup calls into a single loadProvidersAndInventory function, eliminating a duplicate _goose/providers/list RPC
  • Extracted a shared buildProviderListFromEntries helper in acpApi.ts so both the startup path and listProviders reuse the same logic
  • Added discoverAcpProvidersFromEntries in acp.ts to derive ACP providers from already-fetched inventory entries without an extra network call

Test plan

  • Existing tests pass (pnpm test)
  • Biome check and build pass
  • Verify startup loads providers and inventory correctly with a single RPC call
  • Confirm provider list in UI matches previous behavior

🤖 Generated with Claude Code

matt2e and others added 4 commits April 28, 2026 15:39
loadProviders and loadProviderInventory both called
GooseProvidersList({providerIds: []}), sending two identical RPCs
through the sequential ACP message queue. Merge them into a single
loadProvidersAndInventory function that makes one RPC and derives
both the inventory entries and the ACP provider list from the same
response.

This eliminates one ~4s RPC from the startup critical path, reducing
the time listSessions is blocked behind provider queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nstants

Export DEPRECATED_PROVIDER_IDS and DEFAULT_PROVIDER from acpApi.ts and
import them in acp.ts instead of redeclaring identical values, ensuring
a single source of truth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…static import

Address code review feedback:

1. Extract buildProviderListFromEntries() in acpApi.ts as the single
   code path for DEFAULT_PROVIDER prepend + DEPRECATED_PROVIDER_IDS
   filtering. Both listProviders() and discoverAcpProvidersFromEntries()
   now call this shared helper instead of duplicating the logic.

2. Replace the dynamic import() of discoverAcpProvidersFromEntries in
   useAppStartup.ts with a static import — it's a synchronous pure
   function that doesn't need lazy loading.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Remove the separate named import of buildProviderListFromEntries from
acpApi and access it through the existing directAcp namespace import
instead. This eliminates the redundant double import from the same
module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e matt2e added this pull request to the merge queue Apr 29, 2026
Merged via the queue into main with commit 0bb87da Apr 29, 2026
24 checks passed
@matt2e matt2e deleted the dedupe-call-at-startup branch April 29, 2026 06:03
lifeizhou-ap added a commit that referenced this pull request Apr 30, 2026
* main: (24 commits)
  fix: copy and content improvements in goose2 (#8886)
  feat: make ollama host configurable in goose2 (#8912)
  polish sidebar navigation and project icons (#8896)
  fix: model picker stays usable during provider loading (#8900)
  feat: update provider row after saving credentials (#8914)
  feat: support google model inventory refresh (#8913)
  chore: Added goose 2 UI refactor review skill (#8903)
  blog: goose with peekaboo (#8884)
  blog: Built-in Local Inference blogpost. (#8808)
  perf: parallelize provider resolution and eagerly init SQLite pool (#8899)
  refactor: update goose2 credential management behind provider-scoped ACP/core API (#8887)
  fix: handle acp requests concurrently (#8781)
  build: set LLAMA_STATIC_CRT for Windows CUDA (#8901)
  perf: deduplicate _goose/providers/list RPC call at startup (#8873)
  chore: add a bit more instructions in the release pr (#8890)
  chore: disable spellcheck in model search (#8889)
  add skills to the chat composer (#8881)
  mergeable configs + cleanup (#8378)
  refactor: agent provider to use explicit type states (#8879)
  [goose2] MCP Apps: hydrate and replay app payloads in Goose2 (#8632)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants