Skip to content

fix(plugins): Gateway stalls when a model change reloads the OpenAI plugin - #182194

Merged
steipete merged 1 commit into
mainfrom
steipete/redmain-config-rpc-zombie
Oct 24, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/redmain-config-rpc-zombie

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Gateway stalls when a config RPC model change enables or reloads the OpenAI plugin.

User Impact

Model changes can finish reloading the plugin without capturing unrelated built plugins and assets. Used file and directory URL assets retain their existing capture behavior.

Why This Change Was Made

The generated audio codec contains an unused new URL(".", _scriptName).href calculation. Static source inspection treated that as an asset reference, recursively capturing the build directory. Local workers remained alive and CPU-bound in file capture and source parsing; the historical zombie diagnostics were collected after the watchdog sent SIGTERM.

Track discarded expression results through member access and exclude only unused URL calculations from asset discovery. Continue inspecting their arguments. The regression covers aliased and direct URL bases and preserves a used aliased file asset; existing tests cover directory assets, cycle rejection, native Workers, and recovery. No timeout, retry, config-write, or teardown changes.

Evidence

  • Whole-plan reproduction used the repository compact planner's agentic-control-plane-runtime-config selection, currently checks-node-compact-small-12: test/vitest/vitest.gateway-server.config.ts, including only src/gateway/server.config-patch.test.ts, runtime prebuild, two workers, plan concurrency one. Historical compact indices differ.
  • Reproduced the stall with the pinned Bun fork and the CI Node 24.22.1 launcher; a Node worker comparison supplied a CPU profile. At one sampled point, the erroneous capture contained 3,645 files and 4,693 symlinks, including unrelated plugin bundles. No first-bad commit is established.
  • Both new regression cases fail on unchanged production code by capturing the unrelated host sentinel.
  • The identical CI-selected plan passes: 67/67 tests, normal process exit, 126.926 seconds end to end (109.33 seconds in Vitest). The unrelated-include and include-only operations complete in 2.868 and 10.521 seconds respectively.
  • Focused plugin capture/inspection suites: 48/48 pass, including both new red-on-base regressions, used aliased URL assets, directory-cycle rejection, Worker recovery, and disposal.
  • pnpm build, core and plugins-platform test typechecking through the repository tsrs lanes, targeted type-aware oxlint, formatting, and git diff --check pass. Independent local review is clean through P2.
  • OpenAI cold-import screening completes with verified child cleanup. Its source/build identity is unqualified because the source was still uncommitted; no comparative startup-performance claim is made.

Local reproduction host: macOS arm64 M3 Ultra (32 CPUs), Vitest 5.0.5. The saved CI jobs used Ubuntu x64 AMD EPYC (2 reported CPUs), Vitest 5.0.3; Linux CI remains the broad proof.

CI plan replay

Use Node 24.22.1 and the pinned Bun fork (1.4.4-canary.1+ef37c31de):

OPENCLAW_CI_TEST_RUNTIME_POLICY=bun-all \
OPENCLAW_VITEST_MAX_WORKERS=2 \
OPENCLAW_NODE_TEST_PLAN_CONCURRENCY=1 \
OPENCLAW_NODE_TEST_VITEST_ARGS_JSON='[]' \
OPENCLAW_NODE_TEST_GROUPS_JSON='[{"configs":["test/vitest/vitest.gateway-server.config.ts"],"includePatterns":["src/gateway/server.config-patch.test.ts"],"pretestBuildMode":"runtime","requiresDist":false,"runner":"blacksmith-4vcpu-ubuntu-2404","shard_name":"agentic-control-plane-runtime-config","timing_key":"agentic-control-plane-runtime-config-parallel","env":{"OPENCLAW_VITEST_MAX_WORKERS":"2"}}]' \
node --import ./scripts/tsx.mjs scripts/ci-run-node-test-shard.mts

The local runs also used external temporary/cache directories and crash diagnostics. The existing no-output timeout remained 300000 ms.

Do not infer asset ownership from an unused URL expression or its discarded
property value. Continue inspecting arguments and preserve used file and
directory URL captures.

A generated codec directory URL caused config RPC model changes to capture
unrelated build output during the OpenAI plugin reload. Cover the bundled
capture boundary with aliased and direct-base regressions.

Validation: 67 config RPC plan tests, 48 plugin capture tests, full build,
targeted typecheck/lint/format, and independent P2 review.
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-24T04:15:21.941475Z 1134d9a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Oct 24, 2026
@steipete
steipete merged commit 647d7d0 into main Oct 24, 2026
115 checks passed
@steipete
steipete deleted the steipete/redmain-config-rpc-zombie branch October 24, 2026 04:23
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…lugin (openclaw#182194)

Do not infer asset ownership from an unused URL expression or its discarded
property value. Continue inspecting arguments and preserve used file and
directory URL captures.

A generated codec directory URL caused config RPC model changes to capture
unrelated build output during the OpenAI plugin reload. Cover the bundled
capture boundary with aliased and direct-base regressions.

Validation: 67 config RPC plan tests, 48 plugin capture tests, full build,
targeted typecheck/lint/format, and independent P2 review.
steipete added a commit that referenced this pull request Nov 5, 2026
…#184851)

* test(plugins): cover unused URL expressions in source references

Restore regression coverage for #182194: a discarded new URL(...) or its
discarded .href is not a plugin source asset, while the URL's arguments
are still traced. The original regression was deleted with the bundled
reload module in #182403, and #184340 removed this suite's visitor
assertion.

Before #182194, this pattern in a generated codec made the OpenAI plugin
reload capture the host build, which hung Linux Bun teardown of
server.config-patch.test.ts in restart.close.config-reloader.

* test(plugins): pass a lazy resolver to the source reference visitor

#188890 changed visitPluginSourceReferences to take getResolver. The old
call throws a TypeError on current main, and stale PR CI could not see it.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
…openclaw#184851)

* test(plugins): cover unused URL expressions in source references

Restore regression coverage for openclaw#182194: a discarded new URL(...) or its
discarded .href is not a plugin source asset, while the URL's arguments
are still traced. The original regression was deleted with the bundled
reload module in openclaw#182403, and openclaw#184340 removed this suite's visitor
assertion.

Before openclaw#182194, this pattern in a generated codec made the OpenAI plugin
reload capture the host build, which hung Linux Bun teardown of
server.config-patch.test.ts in restart.close.config-reloader.

* test(plugins): pass a lazy resolver to the source reference visitor

openclaw#188890 changed visitPluginSourceReferences to take getResolver. The old
call throws a TypeError on current main, and stale PR CI could not see it.
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Nov 6, 2026
…openclaw#184851)

* test(plugins): cover unused URL expressions in source references

Restore regression coverage for openclaw#182194: a discarded new URL(...) or its
discarded .href is not a plugin source asset, while the URL's arguments
are still traced. The original regression was deleted with the bundled
reload module in openclaw#182403, and openclaw#184340 removed this suite's visitor
assertion.

Before openclaw#182194, this pattern in a generated codec made the OpenAI plugin
reload capture the host build, which hung Linux Bun teardown of
server.config-patch.test.ts in restart.close.config-reloader.

* test(plugins): pass a lazy resolver to the source reference visitor

openclaw#188890 changed visitPluginSourceReferences to take getResolver. The old
call throws a TypeError on current main, and stale PR CI could not see it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant