From f8821e02090c38feefc22cf8f4fbe68836f9f50f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 2 Oct 2026 00:12:16 -0700 Subject: [PATCH] fix(lint): remove redundant artifact-loader suppression Load the Doctor artifact through the existing typed public-surface loader. Restore the optional channel adapter's object contract for its remaining callers instead of retaining a second return-only generic exception. Preserve the missing-artifact and initialization-error behavior from #162645. Explicitly allowlist the worker fixture's Node BroadcastChannel exception: its postMessage API has no browser targetOrigin argument. Keep the fixture and the suppression scanner unchanged. Fixes the production suppression guard from hourly run 36969503477. Validation: suppression guard plus 21 channel tests, touched-file and boundary lint, check-changed, full architecture checks, build, and P2 review. Checks ran locally after the Testbox request was canceled while queued; full owning Vitest suites were not run. Compatibility records are untouched. --- src/channels/plugins/doctor-contract-api.ts | 12 +++++++----- src/channels/plugins/optional-public-artifact.ts | 7 +++---- test/scripts/lint-suppressions.test.ts | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/channels/plugins/doctor-contract-api.ts b/src/channels/plugins/doctor-contract-api.ts index 18a1936a27c7..99e2b4aaede5 100644 --- a/src/channels/plugins/doctor-contract-api.ts +++ b/src/channels/plugins/doctor-contract-api.ts @@ -1,6 +1,6 @@ import type { LegacyConfigRule } from "../../config/legacy.shared.js"; import type { OpenClawConfig } from "../../config/types.js"; -import { loadOptionalBundledChannelPublicArtifact } from "./optional-public-artifact.js"; +import { loadBundledPluginPublicArtifactModuleFromCandidatesSync } from "../../plugins/public-surface-loader.js"; /** * Config returned after a bundled channel normalizes legacy compatibility state. @@ -29,8 +29,10 @@ type BundledChannelDoctorContractApi = { export function loadBundledChannelDoctorContractApi( channelId: string, ): BundledChannelDoctorContractApi | undefined { - return loadOptionalBundledChannelPublicArtifact({ - channelId, - artifactBasename: "doctor-contract-api.js", - }); + return ( + loadBundledPluginPublicArtifactModuleFromCandidatesSync({ + dirName: channelId.trim(), + artifactCandidates: ["doctor-contract-api.js"], + }) ?? undefined + ); } diff --git a/src/channels/plugins/optional-public-artifact.ts b/src/channels/plugins/optional-public-artifact.ts index 06132b69e9f6..940eb36597d6 100644 --- a/src/channels/plugins/optional-public-artifact.ts +++ b/src/channels/plugins/optional-public-artifact.ts @@ -1,13 +1,12 @@ import { loadBundledPluginPublicArtifactModuleFromCandidatesSync } from "../../plugins/public-surface-loader.js"; // Missing artifacts are optional; errors from resolved artifacts must propagate. -// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Callers supply the artifact's own public module surface type. -export function loadOptionalBundledChannelPublicArtifact(params: { +export function loadOptionalBundledChannelPublicArtifact(params: { channelId: string; artifactBasename: string; -}): T | undefined { +}): object | undefined { return ( - loadBundledPluginPublicArtifactModuleFromCandidatesSync({ + loadBundledPluginPublicArtifactModuleFromCandidatesSync({ dirName: params.channelId.trim(), artifactCandidates: [params.artifactBasename], }) ?? undefined diff --git a/test/scripts/lint-suppressions.test.ts b/test/scripts/lint-suppressions.test.ts index 17f35f63e940..39c6b473a9a6 100644 --- a/test/scripts/lint-suppressions.test.ts +++ b/test/scripts/lint-suppressions.test.ts @@ -260,6 +260,8 @@ describe("production lint suppressions", () => { "src/secrets/private-plan-file.ts|preserve-caught-error|1", "src/state/config-machine-state.ts|typescript/no-unnecessary-type-parameters|2", "src/state/openclaw-agent-db-admission.ts|typescript/prefer-promise-reject-errors|1", + // Node worker BroadcastChannel.postMessage accepts only a message, not a browser targetOrigin. + "src/state/openclaw-agent-worker-store.test-support.ts|unicorn/require-post-message-target-origin|1", "src/system-agent/setup-inference-activate.ts|preserve-caught-error|1", "src/test-utils/vitest-mock-fn.ts|typescript/no-explicit-any|1", "src/utils.ts|typescript/no-unnecessary-type-parameters|1",