Files
openchamber/packages/web/server/lib/opencode/config-mutation-response.js
T
Cursor AgentandSerhii Dziupin 395e08c683 Document deferred OpenCode restart contract and drop dead helper.
Add config-mutation-response.js to owning docs, describe restartDeferred
and external requiresManualRestart on /api/config/reload, and remove the
unused buildConfigMutationResponse export.

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
2026-08-03 12:03:37 +00:00

27 lines
632 B
JavaScript

/**
* Shared response shapes for OpenCode config mutations.
*
* Settings writes persist to disk immediately but defer the OpenCode restart
* so the UI can accumulate pending changes and apply them once via
* POST /api/config/reload ("Apply & Restart OpenCode").
*/
export function buildDeferredRestartResponse(message) {
return {
success: true,
requiresReload: false,
requiresRestart: true,
restartDeferred: true,
message,
};
}
export function buildExternalManualRestartResponse(message) {
return {
success: true,
requiresReload: false,
requiresManualRestart: true,
message,
};
}