mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 03:56:45 +00:00
Agent: ignore off-mode bootstrap signatures for once dedupe
This commit is contained in:
@@ -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: [
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user