From 3d0659433e3b07cd23920f7fb9f2fe7271d1334e Mon Sep 17 00:00:00 2001 From: "clawsweeper[bot]" <274271284+clawsweeper[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 01:51:50 +0000 Subject: [PATCH] fix(build): pin synthetic auth runtime dist entry (#86714) Summary: - Adds `plugins/synthetic-auth.runtime` as an explicit tsdown dist entry and adds a regression test tying PI model-discovery synthetic-auth imports to that stable entry. - PR surface: Tests +22, Other +1. Total +23 across 2 files. - Reproducibility: yes. as a source-reproducible package-build path: current main imports synthetic-auth from ... y. The PR proof covers emitted production `dist/` imports, though it did not run a live scheduled cron job. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(build): pin synthetic auth runtime dist entry Validation: - ClawSweeper review passed for head cb99947919c2d31358f06a037c8524006c0429e1. - Required merge gates passed before the squash merge. Prepared head SHA: cb99947919c2d31358f06a037c8524006c0429e1 Review: https://github.com/openclaw/openclaw/pull/86714#issuecomment-4538919657 Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com> --- src/infra/tsdown-config.test.ts | 22 ++++++++++++++++++++++ tsdown.config.ts | 1 + 2 files changed, 23 insertions(+) diff --git a/src/infra/tsdown-config.test.ts b/src/infra/tsdown-config.test.ts index ac1a8c87272..25893d13e73 100644 --- a/src/infra/tsdown-config.test.ts +++ b/src/infra/tsdown-config.test.ts @@ -81,6 +81,13 @@ function readGatewayRunLoopSource(): string { return readFileSync(new URL("../cli/gateway-cli/run-loop.ts", import.meta.url), "utf8"); } +function readPiModelDiscoveryCacheSource(): string { + return readFileSync( + new URL("../agents/pi-embedded-runner/model-discovery-cache.ts", import.meta.url), + "utf8", + ); +} + describe("tsdown config", () => { it("keeps core, plugin runtime, plugin-sdk, bundled root plugins, and bundled hooks in one dist graph", () => { const distGraph = requireUnifiedDistGraph(); @@ -105,6 +112,7 @@ describe("tsdown config", () => { "plugins/provider-discovery.runtime", "plugins/provider-runtime.runtime", "plugins/runtime/index", + "plugins/synthetic-auth.runtime", "web-fetch/runtime", "plugin-sdk/compat", "plugin-sdk/index", @@ -149,6 +157,20 @@ describe("tsdown config", () => { ); }); + it("keeps PI model discovery synthetic auth refs behind one stable runtime dist entry", () => { + const distGraph = requireUnifiedDistGraph(); + const importSpecifiers = [ + ...readPiModelDiscoveryCacheSource().matchAll( + /from ["']([^"']*synthetic-auth\.runtime\.js)["']/gu, + ), + ].map((match) => match[1]); + + expect(importSpecifiers).toEqual(["../../plugins/synthetic-auth.runtime.js"]); + expect(entrySources(distGraph)["plugins/synthetic-auth.runtime"]).toBe( + "src/plugins/synthetic-auth.runtime.ts", + ); + }); + it("keeps Telegram ingress worker behind one root stable dist entry", () => { const distGraph = requireUnifiedDistGraph(); diff --git a/tsdown.config.ts b/tsdown.config.ts index 06941873b5d..fb8ed496577 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -239,6 +239,7 @@ function buildCoreDistEntries(): Record { "server-close.runtime": "src/gateway/server-close.runtime.ts", "plugins/hook-runner-global": "src/plugins/hook-runner-global.ts", "plugins/memory-state": "src/plugins/memory-state.ts", + "plugins/synthetic-auth.runtime": "src/plugins/synthetic-auth.runtime.ts", "subagent-registry.runtime": "src/agents/subagent-registry.runtime.ts", "task-registry-control.runtime": "src/tasks/task-registry-control.runtime.ts", "agents/pi-model-discovery-runtime": "src/agents/pi-model-discovery-runtime.ts",