refactor: remove bootstrap warning alias

This commit is contained in:
Peter Steinberger
2026-05-03 14:24:14 +01:00
parent 8f20d03373
commit 97cdd73aa6
4 changed files with 6 additions and 9 deletions

View File

@@ -354,9 +354,6 @@ export function appendBootstrapPromptWarning(
return prompt ? `${prompt}\n\n${warningBlock}` : warningBlock;
}
/** @deprecated Use appendBootstrapPromptWarning. */
export const prependBootstrapPromptWarning = appendBootstrapPromptWarning;
export function buildBootstrapTruncationReportMeta(params: {
analysis: BootstrapBudgetAnalysis;
warningMode: BootstrapPromptWarningMode;

View File

@@ -7,7 +7,7 @@ import { sanitizeHostExecEnv } from "../../infra/host-env-security.js";
import { enqueueSystemEvent as enqueueSystemEventImpl } from "../../infra/system-events.js";
import { getProcessSupervisor as getProcessSupervisorImpl } from "../../process/supervisor/index.js";
import { scopedHeartbeatWakeOptions } from "../../routing/session-key.js";
import { prependBootstrapPromptWarning } from "../bootstrap-budget.js";
import { appendBootstrapPromptWarning } from "../bootstrap-budget.js";
import {
createCliJsonlStreamingParser,
extractCliErrorMessage,
@@ -248,7 +248,7 @@ export async function executePreparedCliRun(
? params.prompt
: (context.openClawHistoryPrompt ?? params.prompt);
let prompt = applyPluginTextReplacements(
prependBootstrapPromptWarning(basePrompt, context.bootstrapPromptWarningLines, {
appendBootstrapPromptWarning(basePrompt, context.bootstrapPromptWarningLines, {
preserveExactPrompt: context.heartbeatPrompt,
}),
context.backendResolved.textTransforms?.input,

View File

@@ -3,7 +3,7 @@ import {
analyzeBootstrapBudget,
buildBootstrapInjectionStats,
buildBootstrapPromptWarning,
prependBootstrapPromptWarning,
appendBootstrapPromptWarning,
} from "../../bootstrap-budget.js";
import { composeSystemPromptWithHookContext } from "./attempt.thread-helpers.js";
@@ -28,7 +28,7 @@ describe("runEmbeddedAttempt bootstrap warning prompt assembly", () => {
analysis,
mode: "once",
});
const promptWithWarning = prependBootstrapPromptWarning("hello", warning.lines);
const promptWithWarning = appendBootstrapPromptWarning("hello", warning.lines);
const systemPrompt = composeSystemPromptWithHookContext({
baseSystemPrompt: promptWithWarning,
prependSystemContext: "hook context",

View File

@@ -58,7 +58,7 @@ import {
buildBootstrapPromptWarning,
buildBootstrapTruncationReportMeta,
buildBootstrapInjectionStats,
prependBootstrapPromptWarning,
appendBootstrapPromptWarning,
} from "../../bootstrap-budget.js";
import {
FULL_BOOTSTRAP_COMPLETED_CUSTOM_TYPE,
@@ -2585,7 +2585,7 @@ export async function runEmbeddedAttempt(
// Run before_prompt_build hooks to allow plugins to inject prompt context.
// Legacy compatibility: before_agent_start is also checked for context fields.
let effectivePrompt = prependBootstrapPromptWarning(
let effectivePrompt = appendBootstrapPromptWarning(
params.prompt,
bootstrapPromptWarning.lines,
{