Agents: move bootstrap warnings out of system prompt (#48753)

Merged via squash.

Prepared head SHA: dc1d4d075a
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Reviewed-by: @scoootscooob
This commit is contained in:
scoootscooob
2026-03-16 23:25:04 -07:00
committed by GitHub
parent 57204b4fa9
commit 80a2af1d65
11 changed files with 299 additions and 34 deletions

View File

@@ -15,6 +15,7 @@ import {
buildBootstrapInjectionStats,
buildBootstrapPromptWarning,
buildBootstrapTruncationReportMeta,
prependBootstrapPromptWarning,
} from "./bootstrap-budget.js";
import { makeBootstrapWarn, resolveBootstrapContextForRun } from "./bootstrap-files.js";
import { resolveCliBackendConfig } from "./cli-backends.js";
@@ -162,7 +163,6 @@ export async function runCliAgent(params: {
docsPath: docsPath ?? undefined,
tools: [],
contextFiles,
bootstrapTruncationWarningLines: bootstrapPromptWarning.lines,
modelDisplay,
agentId: sessionAgentId,
});
@@ -218,7 +218,9 @@ export async function runCliAgent(params: {
let imagePaths: string[] | undefined;
let cleanupImages: (() => Promise<void>) | undefined;
let prompt = params.prompt;
let prompt = prependBootstrapPromptWarning(params.prompt, bootstrapPromptWarning.lines, {
preserveExactPrompt: heartbeatPrompt,
});
if (params.images && params.images.length > 0) {
const imagePayload = await writeCliImages(params.images);
imagePaths = imagePayload.paths;