Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: preserve pending vision tests when reopening diagnostics (#10020)

[._.]/ Adam Eivy37b9720f6794
diff --git a/client/src/components/providers/ProviderVisionTest.jsx b/client/src/components/providers/ProviderVisionTest.jsx
index 2ba5d61b02..c0279746d0 100644
--- a/client/src/components/providers/ProviderVisionTest.jsx
+++ b/client/src/components/providers/ProviderVisionTest.jsx
@@ -8,7 +8,9 @@ export default function ProviderVisionTest({ provider }) {
const id = useId();
const [open, setOpen] = useState(false);
const [health, setHealth] = useState(null);
- const [busy, setBusy] = useState(false);
+ const [checking, setChecking] = useState(false);
+ const [testing, setTesting] = useState(false);
+ const busy = checking || testing;
const [error, setError] = useState('');
const [result, setResult] = useState(null);
const [imagePath, setImagePath] = useState('');
@@ -19,20 +21,20 @@ export default function ProviderVisionTest({ provider }) {
setOpen(true);
setResult(null);
setHealth(null);
- setBusy(true);
+ setChecking(true);
setError('');
getProviderVisionHealth(provider.id, { silent: true })
- .then(setHealth).catch(err => setError(err.message)).finally(() => setBusy(false));
+ .then(setHealth).catch(err => setError(err.message)).finally(() => setChecking(false));
};
const run = (suite) => {
- setBusy(true);
+ setTesting(true);
setError('');
setResult(null);
const body = model.trim() ? { model: model.trim() } : {};
const request = suite
? runProviderVisionSuite(provider.id, body, { silent: true })
: testProviderVision(provider.id, { ...body, imagePath: imagePath.trim(), prompt }, { silent: true });
- request.then(setResult).catch(err => setError(err.message)).finally(() => setBusy(false));
+ request.then(setResult).catch(err => setError(err.message)).finally(() => setTesting(false));
};
return <>
<button className={buttonClass} disabled={!provider.enabled} onClick={checkHealth}>Test vision</button>
@@ -43,7 +45,7 @@ export default function ProviderVisionTest({ provider }) {
</div>
<p className="text-sm text-port-text-muted">Tests send screenshots stored on this server to this provider and may incur provider charges. The suite sends one stored screenshot twice.</p>
<div role="status" className="text-sm text-port-text-muted">
- {busy ? 'Checking vision…' : health ? (health.available ? 'Endpoint reachable. Run a test to verify vision support.' : health.error || 'Vision unavailable') : 'Health check did not complete.'}
+ {testing ? 'Running vision test…' : checking ? 'Checking vision…' : health ? (health.available ? 'Endpoint reachable. Run a test to verify vision support.' : health.error || 'Vision unavailable') : 'Health check did not complete.'}
</div>
<div className="space-y-2">
<label htmlFor={`${id}-model`} className="block text-sm text-port-text">Model</label>
diff --git a/client/src/components/providers/ProviderVisionTest.test.jsx b/client/src/components/providers/ProviderVisionTest.test.jsx
index 7998e8bd30..d145ec0524 100644
--- a/client/src/components/providers/ProviderVisionTest.test.jsx
+++ b/client/src/components/providers/ProviderVisionTest.test.jsx
@@ -49,6 +49,26 @@ describe('provider card vision diagnostics', () => {
await waitFor(() => expect(screen.getByRole('alert')).toHaveTextContent('Connection lost'));
});
+ it('keeps a pending test disabled after close/reopen and a second health response', async () => {
+ let finish;
+ request.mockResolvedValueOnce({ available: true })
+ .mockImplementationOnce(() => new Promise(resolve => { finish = resolve; }))
+ .mockResolvedValueOnce({ available: true });
+ renderCard();
+ fireEvent.click(screen.getByRole('button', { name: 'Test vision' }));
+ await screen.findByText(/Endpoint reachable/);
+ fireEvent.click(screen.getByRole('button', { name: 'Run vision suite' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Close' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Test vision' }));
+ await waitFor(() => expect(request).toHaveBeenCalledTimes(3));
+ expect(screen.getByRole('button', { name: 'Run vision suite' })).toBeDisabled();
+ fireEvent.click(screen.getByRole('button', { name: 'Run vision suite' }));
+ expect(request).toHaveBeenCalledTimes(3);
+ finish({ success: true, results: [] });
+ await screen.findByText('Vision test passed');
+ expect(screen.getByRole('button', { name: 'Run vision suite' })).toBeEnabled();
+ });
+
it('shows unavailable health and refuses test calls, and offers no vision action for CLI providers', async () => {
request.mockResolvedValueOnce({ available: false, error: 'API endpoint not reachable' });
const { unmount } = renderCard();