workaround: LINE webhook route 404 on cold start (#49803)#3
Open
daniel-rudaev wants to merge 1 commit intomainfrom
Open
workaround: LINE webhook route 404 on cold start (#49803)#3daniel-rudaev wants to merge 1 commit intomainfrom
daniel-rudaev wants to merge 1 commit intomainfrom
Conversation
Bug: when OpenClaw starts, the LINE plugin registers its webhook route (/line/webhook) but the bundler splits runtime.ts into two chunks. The chunk that initialises the global registry object first creates it without the httpRoute fields the other chunk expects — so the LINE plugin registers into one registry and the HTTP server queries a different one. Result: 404 on cold start, works after hot-reload. Upstream fix PRs #53642 and #54686 are open but both stale against the current refactored source (httpRoute structure changed completely). Workaround: a background process in entrypoint.sh waits 20s after gateway start, then writes a temporary `_reloadTs` field to openclaw.json. The gateway's file-watcher detects the change and hot-reloads the LINE channel, re-registering routes into the correct registry. The field is removed 5s later. This is explicitly documented as a workaround. Remove this block once a real fix ships from upstream and is included in the source we build from. See the extensive comment block in entrypoint.sh for full details, upstream issue links, and the two PRs tracking the real fix. Upstream issue: openclaw/openclaw#49803 Upstream PRs: openclaw/openclaw#53642, openclaw/openclaw#54686
3632bf5 to
251b773
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes LINE (and Google Chat, Mattermost) webhook routes returning 404 even when the plugin is enabled and configured.
Based on upstream PR openclaw/openclaw#53642 (open as of 2026-04-05).
Root Cause
When the bundler splits
src/plugins/runtime.tsacross multiple output chunks (registry-*.jsfor the gateway HTTP handler andpi-embedded-*.jsfor channel plugin runtimes), whichever chunk initializesglobalThis[Symbol.for('openclaw.pluginRegistryState')]first determines its shape.The gateway chunk initializes state with only
{ registry, key, version }, omittinghttpRouteRegistryandhttpRouteRegistryPinned. When the LINE plugin callsregisterPluginHttpRoute()→requireActivePluginHttpRouteRegistry(), the missing field causes routes to register on a fallback instance the gateway never queries.Result:
POST /line/webhook→ 404.Fix
patches/apply-line-plugin-route-fix.shis applied during Docker build (beforepnpm build). It defensively ensureshttpRouteRegistryandhttpRouteRegistryPinnedfields exist on the shared state object in the IIFE initializer, regardless of which chunk creates it first.+13 lines, 1 file (
src/plugins/runtime.ts).