Agent: ignore off-mode bootstrap signatures for once dedupe

This commit is contained in:
Gustavo Madeira Santana
2026-03-03 16:18:48 -05:00
parent 7578a4e040
commit 5d6d4ddfa6
2 changed files with 26 additions and 0 deletions

View File

@@ -125,6 +125,27 @@ describe("bootstrap prompt warnings", () => {
expect(resolveBootstrapWarningSignaturesSeen(undefined)).toEqual([]);
});
it("ignores single-signature fallback when warning mode is off", () => {
expect(
resolveBootstrapWarningSignaturesSeen({
bootstrapTruncation: {
warningMode: "off",
promptWarningSignature: "off-mode-signature",
},
}),
).toEqual([]);
expect(
resolveBootstrapWarningSignaturesSeen({
bootstrapTruncation: {
warningMode: "off",
warningSignaturesSeen: ["prior-once-signature"],
promptWarningSignature: "off-mode-signature",
},
}),
).toEqual(["prior-once-signature"]);
});
it("dedupes warnings in once mode by signature", () => {
const analysis = analyzeBootstrapBudget({
files: [

View File

@@ -100,6 +100,7 @@ function appendSeenSignature(signatures: string[], signature: string): string[]
export function resolveBootstrapWarningSignaturesSeen(report?: {
bootstrapTruncation?: {
warningMode?: BootstrapPromptWarningMode;
warningSignaturesSeen?: string[];
promptWarningSignature?: string;
};
@@ -109,6 +110,10 @@ export function resolveBootstrapWarningSignaturesSeen(report?: {
if (seenFromReport.length > 0) {
return seenFromReport;
}
// In off mode, signature metadata should not seed once-mode dedupe state.
if (truncation?.warningMode === "off") {
return [];
}
const single =
typeof truncation?.promptWarningSignature === "string"
? truncation.promptWarningSignature.trim()