Skip to content

fix(agents): import the side-effect owner key from the module that exports it - #133155

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
edenfunf:fix/code-mode-side-effect-owner-import
Aug 30, 2026
Merged

vincentkoc merged 1 commit into
openclaw:mainfrom
edenfunf:fix/code-mode-side-effect-owner-import

Conversation

@edenfunf

Copy link
Copy Markdown
Contributor

What Problem This Solves

main does not type-check, so every open pull request goes red on check-prod-types and the checks that depend on it:

$ pnpm tsgo:core
src/agents/embedded-agent-runner/run/code-mode-reconciliation.ts(2,10): error TS2305:
  Module '"../../../plugins/tools.js"' has no exported member 'getPluginToolSideEffectOwnerKey'.
[tsgo] FAILED (exit 1)

The failure is not in the branch that hits it. It reproduces on a clean checkout of main at 41dccabf179.

Why This Change Was Made

getPluginToolSideEffectOwnerKey is defined and exported in src/plugins/tool-metadata.ts. src/plugins/tools.ts never exported it — it only imports copyPluginToolMeta and setPluginToolMeta from that module, so it is not a barrel for this symbol.

code-mode-reconciliation.ts reached for it through plugins/tools.js. Its sibling in the same directory, attempt-client-tools.ts, already imports the same function from the module that owns it:

import {
  getPluginToolMeta,
  getPluginToolSideEffectOwnerKey,
} from "../../../plugins/tool-metadata.js";

This points the one wrong import at that same owner rather than adding a re-export, so the symbol keeps a single source and the two call sites in this directory agree.

User Impact

main type-checks again, and pull requests stop inheriting a red check-prod-types that has nothing to do with their own changes. No runtime behavior changes: the imported function is the same one in both modules' object graph.

Evidence

Broken on a clean main (41dccabf179), before any change:

$ git show origin/main:src/plugins/tools.ts | grep -c getPluginToolSideEffectOwnerKey
0
$ git grep -n "export function getPluginToolSideEffectOwnerKey" origin/main -- src/
origin/main:src/plugins/tool-metadata.ts:62:export function getPluginToolSideEffectOwnerKey(...

After this change, on the same checkout:

$ node scripts/run-tsgo.mjs -p tsconfig.core.json --noEmit
CORE_EXIT=0

oxfmt --check passes on the touched file.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@edenfunf
edenfunf marked this pull request as ready for review August 30, 2026 07:20
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Aug 30, 2026
@vincentkoc vincentkoc self-assigned this Aug 30, 2026
@steipete

steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Independently confirmed this is the canonical repair. The sole diff is byte-identical to our independently reviewed fix in #133162: reconciliation now reads the existing metadata owner, preserving its single WeakMap, producer/wrapper identity, and SDK/client-tool consumers. We will close our duplicate draft in favor of this PR.

Before/after proof from trusted main aace96c6720e283f95d84921c15610b33c9d3171 plus this identical one-line patch:

  • node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo: TS2305 before; exit 0 after.
  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/code-mode-reconciliation.test.ts: 3 failures/12 passes before (getPluginToolSideEffectOwnerKey is not a function); 15/15 after. The adjacent attempt-client-tools.test.ts also passes 13/13.
  • Formatting and diff checks pass. Fresh autoreview, an independent source review, and a separate exact-commit read-only Codex review found no actionable findings. These reviews/proofs cover our patch-identical commit d4172019980394296eb9dc6c64ed4ebd79c18bda; they do not claim execution of this fork's exact head. Full trusted-tree build now passes (6m 10s), including CLI bootstrap import checks, plugin SDK export checks, and the Control UI build: OPENCLAW_BUILD_ALL_NO_PNPM=1 node --import ./scripts/tsx.mjs scripts/build-all.mts.

One historical clarification for the description: tools.ts did previously export the helper. Raw-parent/patch inspection confirms that #132932 (87b71210c8d1f1107e80548d9b9fb582bb849bd0) moved it to tool-metadata.ts but missed this already-existing caller. No new regression test is necessary here: the existing recovery tests fail before the fix and protect the actual boundary. Production delta is +1/-1, net zero.

The repair is independently verified; our QA campaign is waiting for this existing maintainer-owned PR to unblock main. We are not taking over its branch or landing.

@vincentkoc
vincentkoc merged commit be5e79c into openclaw:main Aug 30, 2026
320 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants