Skip to content

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

TypeScript

fix(control-ui): recover sync reauth and strengthen dropdown focus

M98d4029092fe
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 9f71e64d6..88dbd5c2c 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -6788,13 +6788,13 @@ td.cu-registry-description {
}
.cu-agent-select__option:focus-visible {
- box-shadow: inset 0 0 0 2px var(--cu-focus);
+ box-shadow: inset 0 0 0 2px var(--cu-text);
}
.cu-agent-select__option[data-active='true']:focus-visible {
box-shadow:
inset 0 0 0 1px var(--cu-accent),
- inset 0 0 0 3px var(--cu-focus);
+ inset 0 0 0 3px var(--cu-text);
}
.cu-agent-select__empty {
@@ -7037,13 +7037,13 @@ td.cu-registry-description {
}
.cu-selection-dropdown__option:focus-visible {
- box-shadow: inset 0 0 0 2px var(--cu-focus);
+ box-shadow: inset 0 0 0 2px var(--cu-text);
}
.cu-selection-dropdown__option[data-selected='true']:focus-visible {
box-shadow:
inset 0 0 0 1px var(--cu-accent),
- inset 0 0 0 3px var(--cu-focus);
+ inset 0 0 0 3px var(--cu-text);
}
.cu-selection-dropdown__option-leading {
diff --git a/control-ui/components/CodexSubscriptionHub/index.tsx b/control-ui/components/CodexSubscriptionHub/index.tsx
index ad255c6f9..230e78684 100644
--- a/control-ui/components/CodexSubscriptionHub/index.tsx
+++ b/control-ui/components/CodexSubscriptionHub/index.tsx
@@ -601,6 +601,16 @@ export function CodexSubscriptionHub() {
? await syncGrokSubscriptionCatalog(row.connectionKey)
: await syncCodexSubscriptionCatalog(row.connectionKey)
} catch (err) {
+ // A rejected saved credential changes the persisted grant before the
+ // sync endpoint responds. Reflect that transition in the open dialog
+ // immediately so its connected indicator becomes a Reconnect action.
+ if (err && typeof err === 'object' && 'code' in err && err.code === 'reauth_required') {
+ setEditing(current =>
+ current && hubRowId(current) === hubRowId(row)
+ ? { ...current, status: 'reauth_required', catalogStatus: 'auth-rejected' }
+ : current
+ )
+ }
setError(catalogSyncErrorMessage(err, brand))
return
}
diff --git a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
index 34e6d32de..e48f738e8 100644
--- a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
+++ b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
@@ -1290,7 +1290,7 @@ describe('CodexSubscriptionHub catalog re-sync', () => {
// message by design, and for this one that produced `400 Bad Request -
// reauth_required` — the least readable message on the most common
// recoverable failure.
- it('tells the operator to sign in again when the saved credentials are rejected', async () => {
+ it('shows Reconnect for Grok in the open dialog when saved credentials are rejected', async () => {
fetchMock.mockResolvedValueOnce(makeResponse(400, { error: 'reauth_required' }))
const dialog = await openGrokDialog()
@@ -1304,6 +1304,36 @@ describe('CodexSubscriptionHub catalog re-sync', () => {
// that rendered no error at all would satisfy the absence for free.
expect(within(dialog).queryByText(/400 Bad Request/)).not.toBeInTheDocument()
expect(fetchMock).toHaveBeenCalledTimes(1)
+ expect(await within(dialog).findByText('Reauthorization required')).toBeInTheDocument()
+ const reconnect = await within(dialog).findByRole('button', { name: 'Reconnect Grok' })
+ expect(reconnect).toBeVisible()
+ expect(reconnect).toBeEnabled()
+ expect(within(dialog).queryByTestId('codex-signin-connected')).not.toBeInTheDocument()
+ })
+
+ it('shows Reconnect for ChatGPT in the open dialog when saved credentials are rejected', async () => {
+ fetchMock.mockResolvedValueOnce(makeResponse(400, { error: 'reauth_required' }))
+
+ renderHub()
+ fireEvent.click(
+ await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
+ )
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
+ const dialog = await screen.findByRole('dialog', {
+ name: 'Update ChatGPT subscription Team A',
+ })
+ await within(dialog).findByLabelText('gpt-5.1')
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Sync catalog' }))
+
+ expect(await within(dialog).findByText('Reauthorization required')).toBeInTheDocument()
+ const reconnect = await within(dialog).findByRole('button', { name: 'Reconnect ChatGPT' })
+ expect(reconnect).toBeVisible()
+ expect(reconnect).toBeEnabled()
+ expect(within(dialog).queryByTestId('codex-signin-connected')).not.toBeInTheDocument()
+ expect(fetchMock).toHaveBeenCalledTimes(1)
+ const [url, init] = fetchMock.mock.calls[0] as [string, RequestInit]
+ expect(url).toContain('/codex-subscription/connections/codex-aaa/catalog/sync')
+ expect(init.method).toBe('POST')
})
it('says the provider did not answer when the credential refresh is unavailable', async () => {