Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): show Retry, not a false "unclaimed" prompt, when the capability probe fails

Andy Paviaf005f6487780
diff --git a/control-ui/components/MarketplaceOrgArea/index.tsx b/control-ui/components/MarketplaceOrgArea/index.tsx
index 71f2d8ff7..64cf584e2 100644
--- a/control-ui/components/MarketplaceOrgArea/index.tsx
+++ b/control-ui/components/MarketplaceOrgArea/index.tsx
@@ -8,6 +8,7 @@ import { MarketplaceOrgImages } from '../MarketplaceOrgImages'
import { MarketplaceTabs } from '../MarketplaceTabs'
import { DockerCredentialsPanel } from '../PublisherView/DockerCredentials'
import { OwnedEntries } from '../PublisherView/OwnedEntries'
+import { RetryBanner } from '../PublisherView/RetryBanner'
import RegistryApiKeysPanel from '../RegistryApiKeysPanel'
import RegistryConnectPanel from '../RegistryConnectPanel'
import { TabBar } from '../TabBar'
@@ -45,7 +46,7 @@ function NotClaimed({ action }: { action: string }) {
* connection status, so those sub-tabs are always reachable.
*/
export function MarketplaceOrgArea({ activeTab }: { activeTab: OrgAreaTab }) {
- const { capability, loading } = useRegistryCapability()
+ const { capability, loading, error, reload } = useRegistryCapability()
const inbound = useInboundGrants()
const orgName = capability?.orgName ?? null
@@ -90,6 +91,10 @@ export function MarketplaceOrgArea({ activeTab }: { activeTab: OrgAreaTab }) {
{activeTab === 'entries' ? (
loading ? (
<p>Loading…</p>
+ ) : error ? (
+ // A transient capability-probe failure must NOT be read as an
+ // unclaimed org — that would falsely prompt a re-claim. Offer Retry.
+ <RetryBanner message="Couldn’t load your organization." onRetry={reload} />
) : canManageOrg && orgScope ? (
<OwnedEntries
orgScope={orgScope}
@@ -104,6 +109,8 @@ export function MarketplaceOrgArea({ activeTab }: { activeTab: OrgAreaTab }) {
{activeTab === 'images' ? (
loading ? (
<p>Loading…</p>
+ ) : error ? (
+ <RetryBanner message="Couldn’t load your organization." onRetry={reload} />
) : canManageOrg && orgScope ? (
<MarketplaceOrgImages orgScope={orgScope} />
) : (
diff --git a/control-ui/components/__tests__/MarketplaceOrgArea.test.tsx b/control-ui/components/__tests__/MarketplaceOrgArea.test.tsx
index b4586c31e..1b3bfb604 100644
--- a/control-ui/components/__tests__/MarketplaceOrgArea.test.tsx
+++ b/control-ui/components/__tests__/MarketplaceOrgArea.test.tsx
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import { cleanup, render, screen } from '@testing-library/react'
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
import * as grantsHook from '../../lib/hooks/useInboundGrants'
import * as capHook from '../../lib/hooks/useRegistryCapability'
import type {
@@ -91,6 +91,37 @@ describe('MarketplaceOrgArea', () => {
expect(screen.getByText('org-images')).toBeInTheDocument()
})
+ it('entries: shows Retry, not the claim prompt, on a transient capability-probe error', () => {
+ // A failed getPublishScope() probe must not be read as an unclaimed org —
+ // that falsely prompts a re-claim (the "unclaimed latch" bug).
+ const reload = vi.fn()
+ vi.mocked(capHook.useRegistryCapability).mockReturnValue({
+ capability: null,
+ loading: false,
+ error: true,
+ reload,
+ })
+ render(<MarketplaceOrgArea activeTab="entries" />)
+ expect(screen.getByRole('button', { name: 'Retry' })).toBeInTheDocument()
+ expect(screen.queryByText(/Name your organization/i)).toBeNull()
+ expect(screen.queryByText('owned-entries')).toBeNull()
+ fireEvent.click(screen.getByRole('button', { name: 'Retry' }))
+ expect(reload).toHaveBeenCalledTimes(1)
+ })
+
+ it('images: shows Retry, not the claim prompt, on a transient capability-probe error', () => {
+ vi.mocked(capHook.useRegistryCapability).mockReturnValue({
+ capability: null,
+ loading: false,
+ error: true,
+ reload: vi.fn(),
+ })
+ render(<MarketplaceOrgArea activeTab="images" />)
+ expect(screen.getByRole('button', { name: 'Retry' })).toBeInTheDocument()
+ expect(screen.queryByText(/Name your organization/i)).toBeNull()
+ expect(screen.queryByText('org-images')).toBeNull()
+ })
+
it('credentials: renders the API keys panel even when publishing is off (§6 decision)', () => {
// canManageOrg false (e.g. publishing UI disabled), but API keys must stay.
vi.mocked(capHook.useRegistryCapability).mockReturnValue(cap({ canManageOrg: false }))
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 79aa58f2e..1c9c3f72d 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.372",
+ "version": "0.1.373",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.372",
+ "version": "0.1.373",
"dependencies": {
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
diff --git a/control-ui/package.json b/control-ui/package.json
index 456c3fe7d..8c909bb70 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.372",
+ "version": "0.1.373",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",