This commit is contained in:
九灵云 2026-01-30 04:46:03 -07:00 committed by GitHub
commit d0e413ab56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -176,7 +176,14 @@ export const skillsHandlers: GatewayRequestHandlers = {
...cfg,
skills,
};
await writeConfigFile(nextConfig);
// Respond first to ensure the client receives the response before any gateway restart
respond(true, { ok: true, skillKey: p.skillKey, config: current }, undefined);
// Write config asynchronously after responding to avoid aborting the response
// when the config file watcher triggers a gateway restart (SIGUSR1)
setImmediate(() => {
writeConfigFile(nextConfig).catch(() => {
// Config write errors are logged elsewhere; catch here to prevent unhandled rejection
});
});
},
};