From 1f14ba2cbe2f6ceef89797534a8a07d50fecfbe8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 2 Oct 2026 08:29:02 -0700 Subject: [PATCH] fix(ci): restore the OPENCLAW_* env-var budget The system-update custom-type constant was counted as an environment variable name; rename it so the budget only counts real names. Raise the budget to 477 for OPENCLAW_PROMPT_CACHE_ASSERT (#163379), the owner-approved prompt-cache assertion switch. --- config/env-var-count-budget.txt | 4 +++- packages/agent-core/src/operator-messages.ts | 6 +++--- .../embedded-agent-runner/run/runtime-context-prompt.ts | 4 ++-- src/agents/internal-runtime-context.ts | 2 +- src/agents/sessions/session-manager-current-turn.ts | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config/env-var-count-budget.txt b/config/env-var-count-budget.txt index ce6a40f9c2d6..9a4eb28b563f 100644 --- a/config/env-var-count-budget.txt +++ b/config/env-var-count-budget.txt @@ -5,4 +5,6 @@ # The next-turn runtime-context preface constant no longer exists as an OPENCLAW_* name. # OPENCLAW_PACKAGE_BUN_LAUNCHER (#159431) is the updater-to-preinstall handoff for Bun-only installs. # fs-safe 0.23 moves five existing native/Python environment names into OpenClaw's compatibility owner. -476 +# OPENCLAW_PROMPT_CACHE_ASSERT (#163379) is the owner-approved prompt-cache assertion switch; the operator system-update +# custom-type constant no longer counts as an OPENCLAW_* name. +477 diff --git a/packages/agent-core/src/operator-messages.ts b/packages/agent-core/src/operator-messages.ts index e9ef3abbcefc..747aad850dae 100644 --- a/packages/agent-core/src/operator-messages.ts +++ b/packages/agent-core/src/operator-messages.ts @@ -1,6 +1,6 @@ import { asOptionalRecord } from "@openclaw/normalization-core/record-coerce"; -export const OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE = "openclaw.system-update"; +export const SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE = "openclaw.system-update"; /** The same kind survives raw messages, transcript entries, and bounded navigation. */ export function getOpenClawSystemUpdateKind(value: unknown) { @@ -9,7 +9,7 @@ export function getOpenClawSystemUpdateKind(value: unknown) { if ( !message || (message.role !== "custom" && message.type !== "custom_message") || - message.customType !== OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE + message.customType !== SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE ) { return undefined; } @@ -21,7 +21,7 @@ export function isOpenClawSystemUpdateMessage(message: { role: string; customType?: string; }): boolean { - return message.role === "custom" && message.customType === OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE; + return message.role === "custom" && message.customType === SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE; } /** Order only a newly admitted batch; previously sent operator positions are immutable. */ diff --git a/src/agents/embedded-agent-runner/run/runtime-context-prompt.ts b/src/agents/embedded-agent-runner/run/runtime-context-prompt.ts index cb83f52e5627..b0754f53f0b2 100644 --- a/src/agents/embedded-agent-runner/run/runtime-context-prompt.ts +++ b/src/agents/embedded-agent-runner/run/runtime-context-prompt.ts @@ -4,7 +4,7 @@ import { INTERNAL_RUNTIME_CONTEXT_BEGIN, INTERNAL_RUNTIME_CONTEXT_END, OPENCLAW_RUNTIME_CONTEXT_CUSTOM_TYPE, - OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE, + SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE, type CurrentInboundPromptContext, type RuntimeContextFragment, } from "../../internal-runtime-context.js"; @@ -158,7 +158,7 @@ export function buildSystemUpdateMessage( ): RuntimeContextCustomMessage { return { role: "custom", - customType: OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE, + customType: SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE, content, display: false, details: { kind, turnScoped }, diff --git a/src/agents/internal-runtime-context.ts b/src/agents/internal-runtime-context.ts index b8294dcc58c5..a2109ada7128 100644 --- a/src/agents/internal-runtime-context.ts +++ b/src/agents/internal-runtime-context.ts @@ -8,7 +8,7 @@ import { getOpenClawSystemUpdateKind } from "../../packages/agent-core/src/opera import { escapeRegExp } from "../shared/regexp.js"; export { - OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE, + SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE, getOpenClawSystemUpdateKind, isOpenClawSystemUpdateMessage, orderSystemUpdateMessages, diff --git a/src/agents/sessions/session-manager-current-turn.ts b/src/agents/sessions/session-manager-current-turn.ts index 93454ebd7689..60b7ac14e520 100644 --- a/src/agents/sessions/session-manager-current-turn.ts +++ b/src/agents/sessions/session-manager-current-turn.ts @@ -8,7 +8,7 @@ import type { TranscriptEntryAnchor } from "../../config/sessions/transcript-ent import { captureOwnedTranscriptWriteAssertion } from "../../config/sessions/transcript-write-context.js"; import { OPENCLAW_RUNTIME_CONTEXT_CUSTOM_TYPE, - OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE, + SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE, } from "../internal-runtime-context.js"; import { isSessionContextMetadataEntry } from "./session-manager-codec.js"; import type { SessionEntry, SessionMessageEntry } from "./session-manager-types.js"; @@ -52,7 +52,7 @@ function traversalEntry( entry.type === "compaction" || (entry.type === "custom_message" && (entry.customType === OPENCLAW_RUNTIME_CONTEXT_CUSTOM_TYPE || - entry.customType === OPENCLAW_SYSTEM_UPDATE_CUSTOM_TYPE)) || + entry.customType === SYSTEM_UPDATE_MESSAGE_CUSTOM_TYPE)) || (isInterruptedTail?.(entry) ?? false), }; }