From 0f5317797179f53c9daed3c554a6f7e8d483ea46 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 7 Mar 2026 18:57:27 +0000 Subject: [PATCH] fix(tests): stabilize diffs localReq headers (supersedes #39063) Co-authored-by: Shennng --- CHANGELOG.md | 1 + extensions/diffs/index.test.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a35ca9fada7..4b01b216c6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -251,6 +251,7 @@ Docs: https://docs.openclaw.ai - Gateway/loopback announce URLs: treat `http://` and `https://` aliases with the same loopback/private-network policy as websocket URLs so loopback cron announce delivery no longer fails secure URL validation. (#39064) Thanks @Narcooo. - Models/default provider fallback: when the hardcoded default provider is removed from `models.providers`, resolve defaults from configured providers instead of reporting stale removed-provider defaults in status output. (#38947) Thanks @davidemanuelDEV. - Agents/cache-trace stability: guard stable stringify against circular references in trace payloads so near-limit payloads no longer crash with `Maximum call stack size exceeded`; adds regression coverage. (#38935) Thanks @MumuTW. +- Extensions/diffs CI stability: add `headers` to the `localReq` test helper in `extensions/diffs/index.test.ts` so forwarding-hint checks no longer crash with `req.headers` undefined. (supersedes #39063) Thanks @Shennng. ## 2026.3.2 diff --git a/extensions/diffs/index.test.ts b/extensions/diffs/index.test.ts index 1723fc3c73d..df0a0a79192 100644 --- a/extensions/diffs/index.test.ts +++ b/extensions/diffs/index.test.ts @@ -140,9 +140,14 @@ describe("diffs plugin registration", () => { }); }); -function localReq(input: { method: string; url: string }): IncomingMessage { +function localReq(input: { + method: string; + url: string; + headers?: IncomingMessage["headers"]; +}): IncomingMessage { return { ...input, + headers: input.headers ?? {}, socket: { remoteAddress: "127.0.0.1" }, } as unknown as IncomingMessage; }