From 5d6d4ddfa620011e267d892b402751847d5ac0c3 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Tue, 3 Mar 2026 16:18:48 -0500 Subject: [PATCH] Agent: ignore off-mode bootstrap signatures for once dedupe --- src/agents/bootstrap-budget.test.ts | 21 +++++++++++++++++++++ src/agents/bootstrap-budget.ts | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/src/agents/bootstrap-budget.test.ts b/src/agents/bootstrap-budget.test.ts index 5625530608e..bee7a2d9036 100644 --- a/src/agents/bootstrap-budget.test.ts +++ b/src/agents/bootstrap-budget.test.ts @@ -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: [ diff --git a/src/agents/bootstrap-budget.ts b/src/agents/bootstrap-budget.ts index 1aeef0e7e98..ddfd4fb5d06 100644 --- a/src/agents/bootstrap-budget.ts +++ b/src/agents/bootstrap-budget.ts @@ -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()