Changes from background agent bc-b072b4af-98b7-4de6-bc1c-8faa623cdb13 (#210)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Haze <hazeone@users.noreply.github.com>
This commit is contained in:
Haze
2026-02-28 15:37:02 +08:00
committed by GitHub
Unverified
parent 163099add8
commit 6859656847
12 changed files with 526 additions and 107 deletions

View File

@@ -15,6 +15,7 @@ import { warmupNetworkOptimization } from '../utils/uv-env';
import { ClawHubService } from '../gateway/clawhub';
import { ensureClawXContext, repairClawXOnlyBootstrapFiles } from '../utils/openclaw-workspace';
import { autoInstallCliIfNeeded, generateCompletionCache, installCompletionToProfile } from '../utils/openclaw-cli';
import { isQuitting, setQuitting } from './app-state';
// Disable GPU hardware acceleration globally for maximum stability across
@@ -203,6 +204,16 @@ async function initialize(): Promise<void> {
logger.warn('Failed to merge ClawX context into workspace:', error);
});
// Auto-install openclaw CLI and shell completions (non-blocking).
void autoInstallCliIfNeeded((installedPath) => {
mainWindow?.webContents.send('openclaw:cli-installed', installedPath);
}).then(() => {
generateCompletionCache();
installCompletionToProfile();
}).catch((error) => {
logger.warn('CLI auto-install failed:', error);
});
// Re-apply ClawX context after every gateway restart because the gateway
// may re-seed workspace files with clean templates (losing ClawX markers).
gatewayManager.on('status', (status: { state: string }) => {

View File

@@ -23,7 +23,7 @@ import {
type ProviderConfig,
} from '../utils/secure-storage';
import { getOpenClawStatus, getOpenClawDir, getOpenClawConfigDir, getOpenClawSkillsDir, ensureDir } from '../utils/paths';
import { getOpenClawCliCommand, installOpenClawCliMac } from '../utils/openclaw-cli';
import { getOpenClawCliCommand } from '../utils/openclaw-cli';
import { getSetting } from '../utils/store';
import {
saveProviderKeyToOpenClaw,
@@ -692,10 +692,6 @@ function registerOpenClawHandlers(gatewayManager: GatewayManager): void {
}
});
// Install a system-wide openclaw command on macOS (requires admin prompt)
ipcMain.handle('openclaw:installCliMac', async () => {
return installOpenClawCliMac();
});
// ==================== Channel Configuration Handlers ====================