stacklok / stacklok/toolhive-studio
[Enhancement] Pass refresh signal from registry refresh button to API (blocked by toolhive#5266)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 167
- Forks
- 24
- Avg merge
- 11h 32m
- Merged PRs (30d)
- 91
Description
Context
PR #2216 added a Refresh button to the Registry page (visible for custom registries) with a tooltip showing Source and Updated (the upstream last_updated timestamp). The button currently calls refetch() on the React Query hooks for GET /api/v1beta/registry/default and GET /api/v1beta/registry/default/servers.
Problem
The button is already in place, but for custom registries of type api / url the backend caches data in memory for 1 hour with no way for HTTP clients to bypass it. Clicking refresh fires the same GET requests again, the backend returns cached data, and last_updated does not change. The button works for local_path (file re-read every GET) but is effectively a no-op for api/url.
Tracked upstream: stacklok/toolhive#5266
What needs to change here
Once stacklok/toolhive#5266 lands, the refresh callback in renderer/src/routes/(registry)/-registry.route.tsx needs to pass the cache-bypass signal to the API. The exact shape depends on which option toolhive ships:
POST /api/v1beta/registry/{name}/refreshendpoint (option 1 in upstream issue) → call the new endpoint before the existingrefetch()s.?refresh=truequery param on the existing GETs → pass it through the generated client options.Cache-Control: no-cacheheader → set on the request headers for the refresh path only.
In all cases the button itself does not change — only what the refresh callback in -registry.route.tsx (lines 82–86) does before/during the refetch.
Tasks
- Wait for stacklok/toolhive#5266 to ship and confirm the chosen API shape.
- Regenerate the OpenAPI client (
pnpm run generate-client). - Update the refresh callback in
renderer/src/routes/(registry)/-registry.route.tsxto pass the new signal. - Surface backend errors (502/504 if upstream unreachable) via toast.
- Update / extend tests in
renderer/src/routes/__tests__/registry.test.tsx.
Acceptance criteria
- Clicking Refresh for a custom registry of type
api/urlreturns fresh data from upstream (verify by changing the upstream registry and confirming the tooltip'sUpdatedmoves forward after a click). - Existing behavior for
local_pathis preserved. - Upstream failure (502/504) is surfaced to the user, not silently swallowed.
Dependencies
- Blocked by stacklok/toolhive#5266
References
- PR that added the button + tooltip: #2216
- Upstream issue: stacklok/toolhive#5266
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Wait for stacklok/toolhive#5266 and confirm the cache-bypass API shape, then run pnpm run generate-client. Update the refresh callback in renderer/src/routes/(registry)/-registry.route.tsx, especially lines 82–86, and extend renderer/src/routes/tests/registry.test.tsx. Done means custom api/url registries refresh, local_path behavior remains unchanged, and upstream 502/504 errors appear in a toast.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- api, frontend, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100