fix: improve OpenCode update and desktop menu behavior

Restart OpenCode after successful updates so the new version is active
Open native About menu into the app About dialog
Update desktop View menu actions for the new layout
This commit is contained in:
Bohdan Triapitsyn
2026-05-20 17:29:00 +03:00
parent 966f35da6c
commit aaffd6c598
12 changed files with 130 additions and 98 deletions
@@ -73,6 +73,8 @@ This module provides OpenCode server integration utilities for the web server ru
- `GET /api/config/settings`
- `PUT /api/config/settings`
- `GET /api/config/opencode-resolution`
- `POST /api/opencode/upgrade` (proxies OpenCode upgrade, then restarts managed OpenCode so the new binary is active)
- `GET /api/opencode/upgrade-status`
- `POST /api/opencode/directory`
- `GET /api/provider/:providerId/source`
- `DELETE /api/provider/:providerId/auth`
+14 -1
View File
@@ -155,7 +155,20 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
error: payload?.error || response.statusText || 'Failed to upgrade OpenCode',
});
}
return res.json(payload ?? { success: true });
try {
await refreshOpenCodeAfterConfigChange('OpenCode upgrade');
} catch (restartError) {
return res.status(500).json({
success: false,
upgraded: true,
error: restartError instanceof Error
? `OpenCode upgraded, but restart failed: ${restartError.message}`
: 'OpenCode upgraded, but restart failed',
});
}
return res.json({ ...(payload ?? { success: true }), restarted: true });
} catch (error) {
console.error('Failed to upgrade OpenCode:', error);
return res.status(500).json({