fix(gateway): sync dirty plugin metadata in watch mode

This commit is contained in:
Peter Steinberger
2026-05-01 10:58:28 +01:00
parent 90554ea048
commit 6e3fd67084
4 changed files with 67 additions and 3 deletions

View File

@@ -798,7 +798,10 @@ const writeBuildStamp = (deps) => {
}
};
const shouldSkipCleanWatchRuntimeSync = (deps) => deps.env.OPENCLAW_WATCH_MODE === "1";
const shouldSkipWatchRuntimeSync = (deps, requirement) =>
deps.env.OPENCLAW_WATCH_MODE === "1" &&
requirement.reason === "missing_runtime_postbuild_stamp" &&
hasDirtyRuntimePostBuildInputs(deps) !== true;
const isGatewayClientCommand = (args) =>
args[0] === "gateway" && (args[1] === "call" || args[1] === "status");
@@ -885,9 +888,12 @@ export async function runNodeMain(params = {}) {
return await closeRunNodeOutputTee(deps, exitCode);
}
if (!buildRequirement.shouldBuild) {
if (!useExistingGatewayClientDist && !shouldSkipCleanWatchRuntimeSync(deps)) {
if (!useExistingGatewayClientDist) {
const runtimePostBuildRequirement = resolveRuntimePostBuildRequirement(deps);
if (runtimePostBuildRequirement.shouldSync) {
if (
runtimePostBuildRequirement.shouldSync &&
!shouldSkipWatchRuntimeSync(deps, runtimePostBuildRequirement)
) {
const synced = await withRunNodeBuildLock(deps, async () => {
const lockedRuntimePostBuildRequirement = resolveRuntimePostBuildRequirement(deps);
if (!lockedRuntimePostBuildRequirement.shouldSync) {