From 97cdd73aa628ee6bcaacc20f71c5c7061b7d2f5f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 3 May 2026 14:24:14 +0100 Subject: [PATCH] refactor: remove bootstrap warning alias --- src/agents/bootstrap-budget.ts | 3 --- src/agents/cli-runner/execute.ts | 4 ++-- .../run/attempt.spawn-workspace.bootstrap-warning.test.ts | 4 ++-- src/agents/pi-embedded-runner/run/attempt.ts | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/agents/bootstrap-budget.ts b/src/agents/bootstrap-budget.ts index 4da6033e19a..8e2b91e4558 100644 --- a/src/agents/bootstrap-budget.ts +++ b/src/agents/bootstrap-budget.ts @@ -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; diff --git a/src/agents/cli-runner/execute.ts b/src/agents/cli-runner/execute.ts index 43659f5d54e..64547840f65 100644 --- a/src/agents/cli-runner/execute.ts +++ b/src/agents/cli-runner/execute.ts @@ -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, diff --git a/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-warning.test.ts b/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-warning.test.ts index 0fc83e076b6..6fe2a82144c 100644 --- a/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-warning.test.ts +++ b/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-warning.test.ts @@ -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", diff --git a/src/agents/pi-embedded-runner/run/attempt.ts b/src/agents/pi-embedded-runner/run/attempt.ts index 8c8456ced00..d10d41fd7e2 100644 --- a/src/agents/pi-embedded-runner/run/attempt.ts +++ b/src/agents/pi-embedded-runner/run/attempt.ts @@ -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, {