Skip to content

fix: (GPT 5.4 Parity vs. Opus Agentic) stabilize post-parity-program main (target-resolver, memory-wiki, pruning-defaults)#64675

Closed
100yenadmin wants to merge 2 commits into
openclaw:mainfrom
electricsheephq:fix/stabilize-post-parity-main
Closed

fix: (GPT 5.4 Parity vs. Opus Agentic) stabilize post-parity-program main (target-resolver, memory-wiki, pruning-defaults)#64675
100yenadmin wants to merge 2 commits into
openclaw:mainfrom
electricsheephq:fix/stabilize-post-parity-main

Conversation

@100yenadmin

Copy link
Copy Markdown
Contributor

Summary

Fix the three inherited test failures that are red on every recent main commit since the GPT-5.4 / Codex parity program's PR B (#64439) and PR C (#64300) landed. Each failure is a stale test surface that a production code change forgot to update.

Tracked by #64227. Unblocks PR D (#64441) and PR E (#64662) from inheriting the same red signal on rebase.

Scope

  • Refs #64227
  • test-only fix; no runtime behavior changes
  • no cross-cutting refactor, no parity-harness scope

What changed

  1. src/infra/outbound/target-resolver.test.ts — mock factory for ../../plugins/runtime.js only declared getActivePluginChannelRegistryVersion. After src/channels/registry.ts started calling getActivePluginChannelRegistry + getActivePluginRegistry through listRegisteredChannelPluginEntries(), every resolveMessagingTarget test that reaches normalizeTargetForProvider hits:

    [vitest] No "getActivePluginChannelRegistry" export is defined on the "../../plugins/runtime.js" mock

    Fix: add both exports to the mock factory, seeded with a registry of the channel plugin ids the test cases actually use (discord, imessage, mattermost, slack, telegram) so normalizeAnyChannelId resolves them the same way the real runtime would.

  2. extensions/memory-wiki/index.test.ts — asserted 16 gateway methods, but extensions/memory-wiki/src/gateway.ts now registers 19 after wiki.importRuns, wiki.importInsights, and wiki.palace were added between wiki.status and wiki.init. Update the expected list to match the real registration order.

  3. src/config/config.pruning-defaults.test.ts — flagged by test/extension-test-boundary.test.ts as a core test deep-importing ../../extensions/anthropic/provider-policy-api.js, which violates the extension-test-boundary rule ("Keep plugin-owned behavior suites under the bundled plugin tree"). Move the whole test to extensions/anthropic/config-pruning-defaults.test.ts, replace the direct ../../src/config/config.js OpenClawConfig import with inferred types from applyAnthropicConfigDefaults's parameter / return shape — matching the pattern already used by the sibling extensions/anthropic/provider-policy-api.test.ts — and delete the orphaned core copy.

Why

All three failures predate any parity-program PR and all three have been red on the same check lanes (checks-node-core-test-core-runtime, checks-node-extensions-shard-6, checks-node-core-test-core-support-boundary) on every recent main commit. Maintainer has been pushing a stream of test: narrow … stabilization commits; this PR concentrates the three remaining lane-specific fixes into one reviewable unit so PR D (#64441) and PR E (#64662) can rebase onto a green main and actually produce a first-wave parity verdict.

Validation

Focused checks on the rebased branch:

  • pnpm test src/infra/outbound/target-resolver.test.ts → 6/6 pass
  • pnpm test extensions/memory-wiki/index.test.ts → 1/1 pass (70 other memory-wiki tests also pass)
  • pnpm test extensions/anthropic/config-pruning-defaults.test.ts → 7/7 pass
  • pnpm test test/extension-test-boundary.test.ts → 4/4 pass (boundary offender list empty)

Non-goals

  • does not change any runtime behavior, config shape, or plugin SDK surface
  • does not rewrite any core/extension boundary other than moving the pruning-defaults test to its owning extension
  • does not touch PR D / PR E / parity-pack logic
  • does not change the .generated baseline SHA files or any config schema

Linked issues

Eva added 2 commits April 11, 2026 13:22
…i + pruning-defaults)

Fixes three inherited failures that are red on every recent main commit
since PR B (#64439) and PR C (#64300) landed. Each failure is a stale
test surface that a production change forgot to update.

1) target-resolver.test.ts is mocking plugins/runtime.js with only
   getActivePluginChannelRegistryVersion. After src/channels/registry.ts
   started calling getActivePluginChannelRegistry + getActivePluginRegistry
   through listRegisteredChannelPluginEntries(), every resolveMessagingTarget
   test that reaches normalizeTargetForProvider fails with
   'No getActivePluginChannelRegistry export is defined on the
   ../../plugins/runtime.js mock'. Adds both exports to the mock factory
   with a registry seeded from the channels the test cases actually use
   (discord, imessage, mattermost, slack, telegram) so normalizeAnyChannelId
   resolves them the way real runtime would.

2) memory-wiki/index.test.ts expects 16 gateway methods, but
   src/gateway.ts now registers 19 after wiki.importRuns, wiki.importInsights,
   and wiki.palace were added between wiki.status and wiki.init. Extends
   the expected list to match the real registration order.

3) test/extension-test-boundary.test.ts flags
   src/config/config.pruning-defaults.test.ts as a core test that deep-imports
   extensions/anthropic/provider-policy-api.js, which violates the
   extension-test-boundary rule. Moves the test to
   extensions/anthropic/config-pruning-defaults.test.ts with inferred types
   from applyAnthropicConfigDefaults's parameter/return shape, matching the
   pattern used by the sibling provider-policy-api.test.ts.

Local validation:
- pnpm test src/infra/outbound/target-resolver.test.ts
- pnpm test extensions/memory-wiki/index.test.ts
- pnpm test extensions/anthropic/config-pruning-defaults.test.ts
- pnpm test test/extension-test-boundary.test.ts

Refs #64227
The test was moved to extensions/anthropic/config-pruning-defaults.test.ts
in the previous commit to comply with the extension-test-boundary rule
(keep plugin-owned behavior suites under the bundled plugin tree).
This commit removes the now-orphaned core copy.

The committer script only stages file additions, not deletions, so this
removal is committed directly with git commit -m.

Refs #64227

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes three inherited, lane-specific test failures on main by updating test mocks/expectations to match recent production surface changes (target resolver plugin registry access, memory-wiki gateway method registration count/order, and extension-boundary compliance for Anthropic config pruning defaults).

Changes:

  • Extend target-resolver tests to mock the additional plugin-runtime registry exports now used transitively by channel normalization.
  • Update memory-wiki plugin registration test expectations to include newly registered gateway methods in the correct order.
  • Relocate / adapt the Anthropic pruning-defaults test to live under the owning extension and infer types from applyConfigDefaults.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/infra/outbound/target-resolver.test.ts Adds runtime registry mocks + seeded channel entries so normalizeAnyChannelId resolves channels used in the suite.
extensions/memory-wiki/index.test.ts Updates expected gateway method list to match the current registerMemoryWikiGatewayMethods registration order.
extensions/anthropic/config-pruning-defaults.test.ts Keeps the test within the Anthropic extension boundary and removes core-only type imports via inferred types.

@greptile-apps

greptile-apps Bot commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes three inherited test failures on main by updating stale test surfaces to match production code changes from the parity program PRs. All changes are test-only: extending the plugins/runtime.js mock in target-resolver.test.ts with the two registry exports that listRegisteredChannelPluginEntries() now calls; updating the memory-wiki gateway method list from 16 to 19 to match wiki.importRuns, wiki.importInsights, and wiki.palace additions in extensions/memory-wiki/src/gateway.ts; and relocating the config pruning-defaults test from core to the owning extensions/anthropic package, replacing the direct OpenClawConfig import with inferred types from applyAnthropicConfigDefaults's signature to satisfy the extension-test-boundary rule.

Confidence Score: 5/5

This PR is safe to merge — all changes are test-only with no runtime behavior impact.

All three fixes correctly align test expectations with their production counterparts. The mock shape, gateway method order, and type derivation patterns have all been verified against source. No P0/P1 findings identified.

No files require special attention.

Reviews (1): Last reviewed commit: "fix: remove moved anthropic pruning-defa..." | Re-trigger Greptile

@100yenadmin

Copy link
Copy Markdown
Contributor Author

Loop-6 status (pass 1): no code fixes needed on this PR. Prior bot findings were all addressed in earlier pushes. Re-requesting fresh review pass from @Copilot. Paired with the loop-6 pushes on #64679, #64681, #64685, and the re-opened parity-summary PR (#64789, replacing closed #64689) this PR is ready for merge once main is green.

@100yenadmin 100yenadmin changed the title fix: stabilize post-parity-program main (target-resolver, memory-wiki, pruning-defaults) fix: (GPT 5.4 Parity vs. Opus Agentic) stabilize post-parity-program main (target-resolver, memory-wiki, pruning-defaults) Apr 11, 2026
@100yenadmin
100yenadmin requested a review from Copilot April 11, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@100yenadmin

Copy link
Copy Markdown
Contributor Author

Closing as superseded. All three fixes this PR proposed have been independently resolved on main (HEAD 545490c592 at close time):

  1. src/infra/outbound/target-resolver.test.ts mock exports — main now has getActivePluginChannelRegistry: () => null and getActivePluginRegistry: () => null in the plugins/runtime.js mock factory. Verified via git show upstream/main:src/infra/outbound/target-resolver.test.ts grep for the two exports.

  2. src/memory-wiki/index.test.ts expected 19 gateway methods — the test file has been moved out of src/ entirely and now lives at extensions/memory-wiki/index.test.ts. The src-side file no longer exists.

  3. src/config/config.pruning-defaults.test.ts boundary violation — the test now imports from ./provider-policy.js (core) instead of deep-importing the extensions/anthropic/provider-policy-api.js extension surface, so the boundary violation is resolved.

Each of the three inherited red-main failures that PR F was fixing is now green on main through different commits, so this PR is no longer needed. Closing to keep the tracker clean. Completion gate criterion 5 progress on #64227 is unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants