Skip to content

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

TypeScript

fix(control-ui): subscription hub connected state, dropdown selection contrast, search input sizing

M3e00098d51fa
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 90fb9afd5..63339935f 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -1414,7 +1414,7 @@ body.cu-body {
.cu-input--compact {
padding: 0.5rem 0.75rem;
- font-size: 0.8125rem;
+ font-size: var(--cu-font-size-sm);
}
.cu-input--invalid {
@@ -2591,6 +2591,7 @@ textarea.cu-input {
width: min(13rem, 100%);
min-width: 9rem;
max-width: 250px !important;
+ font-size: var(--cu-font-size-sm);
}
.cu-registry-layout {
@@ -6762,13 +6763,19 @@ td.cu-registry-description {
}
.cu-agent-select__option:hover,
-.cu-agent-select__option:focus-visible,
-.cu-agent-select__option[data-active='true'] {
+.cu-agent-select__option:focus-visible {
color: var(--cu-text);
background: rgba(var(--cu-accent-rgb), 0.18);
outline: none;
}
+.cu-agent-select__option[data-active='true'] {
+ color: var(--cu-text);
+ background: var(--cu-selection-bg);
+ box-shadow: inset 0 0 0 1px var(--cu-accent);
+ outline: none;
+}
+
.cu-agent-select__empty {
display: block;
padding: 0.6rem 0.65rem;
@@ -6995,13 +7002,19 @@ td.cu-registry-description {
}
.cu-selection-dropdown__option:hover,
-.cu-selection-dropdown__option:focus-visible,
-.cu-selection-dropdown__option[data-selected='true'] {
+.cu-selection-dropdown__option:focus-visible {
color: var(--cu-text);
background: rgba(var(--cu-accent-rgb), 0.16);
outline: none;
}
+.cu-selection-dropdown__option[data-selected='true'] {
+ color: var(--cu-text);
+ background: var(--cu-selection-bg);
+ box-shadow: inset 0 0 0 1px var(--cu-accent);
+ outline: none;
+}
+
.cu-selection-dropdown__option-leading {
display: inline-flex;
align-items: center;
diff --git a/control-ui/components/CodexSubscriptionHub/index.tsx b/control-ui/components/CodexSubscriptionHub/index.tsx
index c37750a47..51eba91c0 100644
--- a/control-ui/components/CodexSubscriptionHub/index.tsx
+++ b/control-ui/components/CodexSubscriptionHub/index.tsx
@@ -674,6 +674,13 @@ export function CodexSubscriptionHub() {
const offeredDefaults = editModels.filter(row => row.enabled && !row.stale).map(row => row.model)
const initialLoad = loading && connections.length === 0
const uiStatus = editing ? mapConnectionStatus(editing.status) : 'disconnected'
+ // The sign-in action and the status badge above it share this one status
+ // source, so they can never disagree: a connected grant shows the signed-in
+ // indicator instead of the sign-in button, and only a grant that expired
+ // (reauth-required) surfaces the explicit reconnect action. The
+ // create/setup flow keeps the plain sign-in button throughout.
+ const connectedGrant = editing !== null && !setupNew && uiStatus === 'connected'
+ const needsReconnect = editing !== null && !setupNew && uiStatus === 'reauth-required'
const dialogBroker: HubBroker = editing?.broker ?? createBroker
const dialogCopy = HUB_PROVIDER_COPY[dialogBroker]
// Table-level copy stays ChatGPT-specific while Grok is off (unchanged Codex
@@ -946,27 +953,41 @@ export function CodexSubscriptionHub() {
// where the deployment turns it on.
'Agents authorize through this subscription’s ChatGPT grant. Reconnect if the grant expired. The catalog is read at sign-in — use Sync catalog to pick up models published since, or periodic reconciliation where this deployment enables it.'}
</p>
- <div className="cu-form-inline">
- <span
- title={editing || editName.trim() ? undefined : 'Type a name to get started'}
- className="cu-hover-hint"
+ {connectedGrant ? (
+ <p
+ className="cu-field__hint"
+ data-testid="codex-signin-connected"
+ style={{ margin: 0 }}
>
- <button
- type="button"
- className="cu-btn cu-btn--ghost cu-btn--sm"
- onClick={() => {
- // Before the grant exists this creates it (with the
- // typed name) and chains straight into sign-in, so
- // the button never sits there dead.
- if (editing) void handleConnect(editing)
- else void handleCreate()
- }}
- disabled={Boolean(busyKey)}
+ {`Signed in with ${dialogCopy.brand} — agents authorize through this grant.`}
+ </p>
+ ) : (
+ <div className="cu-form-inline">
+ <span
+ title={
+ editing || editName.trim() ? undefined : 'Type a name to get started'
+ }
+ className="cu-hover-hint"
>
- {`Sign in with ${dialogCopy.brand}`}
- </button>
- </span>
- </div>
+ <button
+ type="button"
+ className="cu-btn cu-btn--ghost cu-btn--sm"
+ onClick={() => {
+ // Before the grant exists this creates it (with the
+ // typed name) and chains straight into sign-in, so
+ // the button never sits there dead.
+ if (editing) void handleConnect(editing)
+ else void handleCreate()
+ }}
+ disabled={Boolean(busyKey)}
+ >
+ {needsReconnect
+ ? `Reconnect ${dialogCopy.brand}`
+ : `Sign in with ${dialogCopy.brand}`}
+ </button>
+ </span>
+ </div>
+ )}
{userCode ? (
<div className="cu-device-setup" data-testid="codex-device-code">
<p className="cu-device-setup__step">
diff --git a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
index e51bc31a9..2b59874e0 100644
--- a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
+++ b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx
@@ -282,11 +282,21 @@ describe('CodexSubscriptionHub', () => {
expect(screen.getByRole('menuitem', { name: 'Delete' })).toBeInTheDocument()
})
- it('renders the ChatGPT verification link from the Update sign-in path', async () => {
+ it('renders the ChatGPT verification link from the Update reconnect path', async () => {
vi.stubGlobal(
'open',
vi.fn(() => ({}))
)
+ // The Update dialog only offers the sign-in entry to a grant that needs
+ // reauthorization (BUG-138); a connected grant shows the signed-in
+ // indicator instead.
+ vi.mocked(listCodexSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'codex-aaa',
+ displayName: 'Team A',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startCodexDeviceConnect).mockResolvedValue({
userCode: 'WXYZ-9876',
verificationUri: 'https://auth.openai.com/codex/device',
@@ -303,7 +313,7 @@ describe('CodexSubscriptionHub', () => {
await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
)
fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
- fireEvent.click(await screen.findByRole('button', { name: 'Sign in with ChatGPT' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Reconnect ChatGPT' }))
const link = await screen.findByTestId('codex-device-verification-link')
expect(link).toHaveAttribute('href', 'https://auth.openai.com/codex/device')
expect(link.getAttribute('rel') ?? '').toContain('noopener')
@@ -311,7 +321,7 @@ describe('CodexSubscriptionHub', () => {
expect(screen.getByTestId('codex-device-code')).toHaveTextContent('WXYZ-9876')
})
- it('opens the grant modal for reconnect and model toggles without binding hosts', async () => {
+ it('opens the connected grant modal for model toggles without binding hosts', async () => {
vi.mocked(startCodexDeviceConnect).mockResolvedValue({
userCode: 'ABCD-1234',
verificationUri: CODEX_DEVICE_VERIFICATION_URI,
@@ -335,7 +345,13 @@ describe('CodexSubscriptionHub', () => {
await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
)
fireEvent.click(await screen.findByRole('menuitem', { name: 'Update' }))
- expect(await screen.findByRole('button', { name: 'Sign in with ChatGPT' })).toBeInTheDocument()
+ // BUG-138: a connected grant must not offer sign-in next to its CONNECTED
+ // badge; the same slot states the signed-in state instead.
+ expect(await screen.findByTestId('codex-signin-connected')).toHaveTextContent(
+ 'Signed in with ChatGPT'
+ )
+ expect(screen.queryByRole('button', { name: 'Sign in with ChatGPT' })).not.toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: 'Reconnect ChatGPT' })).not.toBeInTheDocument()
// Connect syncs the catalog once; a connected grant also offers the manual
// re-sync, because nothing refreshes it afterwards on its own.
expect(screen.getByRole('button', { name: 'Sync catalog' })).toBeInTheDocument()
@@ -363,6 +379,15 @@ describe('CodexSubscriptionHub', () => {
it('shows the device code card with the verification link and copy actions', async () => {
const openMock = vi.fn(() => ({}))
vi.stubGlobal('open', openMock)
+ // The Update dialog's sign-in entry only exists for a grant that needs
+ // reauthorization (BUG-138); connected grants show the signed-in indicator.
+ vi.mocked(listCodexSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'codex-aaa',
+ displayName: 'Team A',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startCodexDeviceConnect).mockResolvedValue({
userCode: 'ABCD-1234',
verificationUri: CODEX_DEVICE_VERIFICATION_URI,
@@ -385,7 +410,7 @@ describe('CodexSubscriptionHub', () => {
await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
)
fireEvent.click(await screen.findByRole('menuitem', { name: 'Update' }))
- fireEvent.click(await screen.findByRole('button', { name: 'Sign in with ChatGPT' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Reconnect ChatGPT' }))
const card = await screen.findByTestId('codex-device-code')
expect(card).toHaveTextContent('ABCD-1234')
// The verification tab opens synchronously in the click handler.
@@ -431,6 +456,15 @@ describe('CodexSubscriptionHub', () => {
'open',
vi.fn(() => ({}))
)
+ // The Update dialog's sign-in entry only exists for a grant that needs
+ // reauthorization (BUG-138); connected grants show the signed-in indicator.
+ vi.mocked(listCodexSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'codex-aaa',
+ displayName: 'Team A',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startCodexDeviceConnect).mockResolvedValue({
userCode: 'ABCD-1234',
verificationUri: CODEX_DEVICE_VERIFICATION_URI,
@@ -450,7 +484,7 @@ describe('CodexSubscriptionHub', () => {
await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
)
fireEvent.click(await screen.findByRole('menuitem', { name: 'Update' }))
- const signIn = await screen.findByRole('button', { name: 'Sign in with ChatGPT' })
+ const signIn = await screen.findByRole('button', { name: 'Reconnect ChatGPT' })
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] })
try {
fireEvent.click(signIn)
@@ -471,6 +505,113 @@ describe('CodexSubscriptionHub', () => {
vi.useRealTimers()
}
})
+
+ // BUG-138: the status badge and the sign-in action share one status source,
+ // so a CONNECTED badge can never sit next to a "Sign in with ChatGPT" button.
+ it('replaces the sign-in button with the connected indicator for a connected grant', async () => {
+ render(
+ <ToastProvider>
+ <CodexSubscriptionHub />
+ </ToastProvider>
+ )
+ fireEvent.click(
+ await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
+ )
+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Update' }))
+ const dialog = await screen.findByRole('dialog', {
+ name: 'Update ChatGPT subscription Team A',
+ })
+ expect(await within(dialog).findByText('Connected')).toBeInTheDocument()
+ expect(within(dialog).getByTestId('codex-signin-connected')).toHaveTextContent(
+ 'Signed in with ChatGPT'
+ )
+ expect(
+ within(dialog).queryByRole('button', { name: 'Sign in with ChatGPT' })
+ ).not.toBeInTheDocument()
+ expect(
+ within(dialog).queryByRole('button', { name: 'Reconnect ChatGPT' })
+ ).not.toBeInTheDocument()
+ })
+
+ it('surfaces the reconnect action only for a grant that needs reauthorization', async () => {
+ vi.mocked(listCodexSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'codex-aaa',
+ displayName: 'Team A',
+ status: 'reauth_required',
+ }),
+ ])
+ render(
+ <ToastProvider>
+ <CodexSubscriptionHub />
+ </ToastProvider>
+ )
+ fireEvent.click(
+ await screen.findByRole('button', { name: 'Actions for ChatGPT subscription Team A' })
+ )
+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Update' }))
+ const dialog = await screen.findByRole('dialog', {
+ name: 'Update ChatGPT subscription Team A',
+ })
+ expect(await within(dialog).findByText('Reauthorization required')).toBeInTheDocument()
+ expect(
+ await within(dialog).findByRole('button', { name: 'Reconnect ChatGPT' })
+ ).toBeInTheDocument()
+ expect(
+ within(dialog).queryByRole('button', { name: 'Sign in with ChatGPT' })
+ ).not.toBeInTheDocument()
+ expect(within(dialog).queryByTestId('codex-signin-connected')).not.toBeInTheDocument()
+ })
+
+ it('keeps the sign-in button through the new-subscription setup flow even after it connects', async () => {
+ vi.stubGlobal(
+ 'open',
+ vi.fn(() => ({}))
+ )
+ vi.mocked(createCodexSubscriptionConnection).mockResolvedValue(
+ connection({
+ connectionKey: 'codex-bbb',
+ displayName: 'New team',
+ status: 'disconnected',
+ defaultModel: null,
+ })
+ )
+ vi.mocked(startCodexDeviceConnect).mockResolvedValue({
+ userCode: 'ABCD-1234',
+ verificationUri: CODEX_DEVICE_VERIFICATION_URI,
+ intervalSeconds: 0.3,
+ state: 'state-1',
+ intent: 'connect',
+ })
+ vi.mocked(pollCodexDevice).mockResolvedValue({
+ status: 'connected',
+ connection: connection({ connectionKey: 'codex-bbb', displayName: 'New team' }),
+ })
+ vi.mocked(listCodexConnectionModels).mockResolvedValue([
+ { model: 'gpt-5.1', enabled: true, stale: false },
+ ])
+ render(
+ <ToastProvider>
+ <CodexSubscriptionHub />
+ </ToastProvider>
+ )
+ expect(await screen.findByText('Team A')).toBeInTheDocument()
+ fireEvent.click(screen.getByRole('button', { name: 'Add subscription' }))
+ fireEvent.change(screen.getByRole('textbox', { name: 'Name' }), {
+ target: { value: 'New team' },
+ })
+ fireEvent.click(screen.getByRole('button', { name: 'Sign in with ChatGPT' }))
+ // Wait for the handshake to land: the grant flips to connected while the
+ // setup dialog is still open, and the setup flow keeps the sign-in entry.
+ await waitFor(() => {
+ expect(listCodexConnectionModels).toHaveBeenCalledWith('codex-bbb')
+ })
+ await waitFor(() => {
+ expect(screen.getByRole('button', { name: 'Finish setup' })).toBeInTheDocument()
+ })
+ expect(screen.getByRole('button', { name: 'Sign in with ChatGPT' })).toBeInTheDocument()
+ expect(screen.queryByTestId('codex-signin-connected')).not.toBeInTheDocument()
+ })
})
describe('CodexSubscriptionHub with Grok enabled', () => {
@@ -626,12 +767,46 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
expect(revokeGrokSubscription).not.toHaveBeenCalled()
})
- it('uses Grok copy (no ChatGPT wording) across the Grok dialog, device card and models', async () => {
+ it('uses Grok copy (no ChatGPT wording) across the connected Grok dialog and models', async () => {
+ renderHub()
+ fireEvent.click(
+ await screen.findByRole('button', { name: 'Actions for Grok subscription Team Grok' })
+ )
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
+ const dialog = await screen.findByRole('dialog', {
+ name: 'Update Grok subscription Team Grok',
+ })
+ expect(await within(dialog).findByLabelText('grok-4.6')).toBeInTheDocument()
+ // BUG-138: a connected grant shows the signed-in indicator in the sign-in
+ // slot, never a sign-in button next to the CONNECTED badge.
+ expect(within(dialog).getByTestId('codex-signin-connected')).toHaveTextContent(
+ 'Signed in with Grok'
+ )
+ expect(
+ within(dialog).queryByRole('button', { name: 'Sign in with Grok' })
+ ).not.toBeInTheDocument()
+ expect(within(dialog).getByText(/No longer in the Grok catalog/)).toBeInTheDocument()
+ expect(dialog.textContent ?? '').not.toMatch(/ChatGPT/)
+ expect(attributeText(dialog)).not.toMatch(/ChatGPT/)
+ expect(dialog.querySelectorAll('[data-provider="codex-subscription"]').length).toBe(0)
+ })
+
+ it('uses Grok copy (no ChatGPT wording) across the reconnect device card', async () => {
const tab = { opener: {} as unknown, location: { replace: vi.fn() }, close: vi.fn() }
vi.stubGlobal(
'open',
vi.fn(() => tab)
)
+ // The Update dialog's sign-in entry only exists for a grant that needs
+ // reauthorization (BUG-138); connected grants show the signed-in indicator.
+ vi.mocked(listGrokSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'grok-aaa',
+ displayName: 'Team Grok',
+ defaultModel: 'grok-4.6',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startGrokDeviceConnect).mockResolvedValue({
userCode: 'GROK-1234',
verificationUri: 'https://auth.x.ai/device?user_code=GROK-1234',
@@ -647,13 +822,10 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
const dialog = await screen.findByRole('dialog', {
name: 'Update Grok subscription Team Grok',
})
- expect(await within(dialog).findByLabelText('grok-4.6')).toBeInTheDocument()
- fireEvent.click(within(dialog).getByRole('button', { name: 'Sign in with Grok' }))
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Reconnect Grok' }))
expect(await within(dialog).findByTestId('codex-device-code')).toHaveTextContent('GROK-1234')
expect(dialog.textContent ?? '').not.toMatch(/ChatGPT/)
expect(attributeText(dialog)).not.toMatch(/ChatGPT/)
- expect(within(dialog).getByText(/No longer in the Grok catalog/)).toBeInTheDocument()
- expect(dialog.querySelectorAll('[data-provider="codex-subscription"]').length).toBe(0)
})
it('titles the Grok create dialog for Grok when Grok is the selected provider', async () => {
@@ -672,6 +844,16 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
const tab = { opener: {} as unknown, location: { replace: vi.fn() }, close: vi.fn() }
const openMock = vi.fn(() => tab)
vi.stubGlobal('open', openMock)
+ // BUG-138: the Update dialog's sign-in entry exists only for a grant that
+ // needs reauthorization; connected grants show the signed-in indicator.
+ vi.mocked(listGrokSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'grok-aaa',
+ displayName: 'Team Grok',
+ defaultModel: 'grok-4.6',
+ status: 'reauth_required',
+ }),
+ ])
const started = deferred<{
userCode: string
verificationUri: string
@@ -685,7 +867,7 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
await screen.findByRole('button', { name: 'Actions for Grok subscription Team Grok' })
)
fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
- fireEvent.click(await screen.findByRole('button', { name: 'Sign in with Grok' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Reconnect Grok' }))
// Opened synchronously inside the click (user activation), before the start resolves.
expect(openMock).toHaveBeenCalledTimes(1)
expect(openMock.mock.calls[0]?.[0]).not.toBe('https://auth.x.ai')
@@ -715,13 +897,23 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
'open',
vi.fn(() => tab)
)
+ // BUG-138: the Update dialog's sign-in entry exists only for a grant that
+ // needs reauthorization; connected grants show the signed-in indicator.
+ vi.mocked(listGrokSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'grok-aaa',
+ displayName: 'Team Grok',
+ defaultModel: 'grok-4.6',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startGrokDeviceConnect).mockRejectedValue(new Error('start boom'))
renderHub()
fireEvent.click(
await screen.findByRole('button', { name: 'Actions for Grok subscription Team Grok' })
)
fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
- fireEvent.click(await screen.findByRole('button', { name: 'Sign in with Grok' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Reconnect Grok' }))
expect(await screen.findByText('start boom')).toBeInTheDocument()
expect(tab.close).toHaveBeenCalled()
expect(tab.location.replace).not.toHaveBeenCalled()
@@ -733,6 +925,16 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
'open',
vi.fn(() => null)
)
+ // BUG-138: the Update dialog's sign-in entry exists only for a grant that
+ // needs reauthorization; connected grants show the signed-in indicator.
+ vi.mocked(listGrokSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'grok-aaa',
+ displayName: 'Team Grok',
+ defaultModel: 'grok-4.6',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startGrokDeviceConnect).mockResolvedValue({
userCode: 'GROK-1234',
verificationUri: 'https://auth.x.ai/device?user_code=GROK-1234',
@@ -745,7 +947,7 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
await screen.findByRole('button', { name: 'Actions for Grok subscription Team Grok' })
)
fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
- fireEvent.click(await screen.findByRole('button', { name: 'Sign in with Grok' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Reconnect Grok' }))
const card = await screen.findByTestId('codex-device-code')
expect(card).toHaveTextContent('Open the Grok verification page')
expect(screen.getByTestId('codex-device-verification-link')).toHaveAttribute(
@@ -760,6 +962,16 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
'open',
vi.fn(() => tab)
)
+ // BUG-138: the Update dialog's sign-in entry exists only for a grant that
+ // needs reauthorization; connected grants show the signed-in indicator.
+ vi.mocked(listGrokSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'grok-aaa',
+ displayName: 'Team Grok',
+ defaultModel: 'grok-4.6',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startGrokDeviceConnect).mockResolvedValue({
userCode: 'GROK-1234',
verificationUri: null as unknown as string,
@@ -772,7 +984,7 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
await screen.findByRole('button', { name: 'Actions for Grok subscription Team Grok' })
)
fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
- fireEvent.click(await screen.findByRole('button', { name: 'Sign in with Grok' }))
+ fireEvent.click(await screen.findByRole('button', { name: 'Reconnect Grok' }))
const link = await screen.findByTestId('codex-device-verification-link')
expect(link).toHaveAttribute('href', 'https://accounts.x.ai/oauth2/device')
expect(link).not.toHaveAttribute('href', CODEX_DEVICE_VERIFICATION_URI)
@@ -790,6 +1002,16 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
'open',
vi.fn(() => tab)
)
+ // BUG-138: the Update dialog's sign-in entry exists only for a grant that
+ // needs reauthorization; connected grants show the signed-in indicator.
+ vi.mocked(listGrokSubscriptionConnections).mockResolvedValue([
+ connection({
+ connectionKey: 'grok-aaa',
+ displayName: 'Team Grok',
+ defaultModel: 'grok-4.6',
+ status: 'reauth_required',
+ }),
+ ])
vi.mocked(startGrokDeviceConnect).mockResolvedValue({
userCode: 'GROK-1234',
verificationUri: 'https://auth.x.ai/device?user_code=GROK-1234',
@@ -806,7 +1028,7 @@ describe('CodexSubscriptionHub with Grok enabled', () => {
await screen.findByRole('button', { name: 'Actions for Grok subscription Team Grok' })
)
fireEvent.click(screen.getByRole('menuitem', { name: 'Update' }))
- const signIn = await screen.findByRole('button', { name: 'Sign in with Grok' })
+ const signIn = await screen.findByRole('button', { name: 'Reconnect Grok' })
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] })
try {
fireEvent.click(signIn)
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 982acfe34..6a11d5f01 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.653",
+ "version": "0.1.654",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.653",
+ "version": "0.1.654",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index 23fe01de0..956a113f2 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.653",
+ "version": "0.1.654",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",