Repository navigation
refactor(line): retire the Express webhook adapter - #157369
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 12:00 PM ET / 16:00 UTC (Revision 3). ClawSweeper reviewWhat this changesRemoves LINE’s unused Express webhook adapter and private exports, moves its contract tests to the active Node handler, and updates the Express dependency inventory. Merge readiness✅ Ready for maintainer review Keep open for normal merge review. Current main and the latest release still contain the adapter that the earlier merged LINE cleanup expressly deferred. The reviewed branch has a distinct, useful purpose, and I found no introduced defect. Priority: P3 Review scores
Verification
How this fits togetherThe LINE plugin receives signed webhook requests through an OpenClaw Gateway route. Its Node handler selects the matching account, validates the request, admits events for durable delivery, and returns an HTTP response to LINE. flowchart LR
A[LINE webhook request] --> B[Gateway LINE route]
B --> C[Node request handler]
C --> D{Signature matches one account?}
D -->|No| E[HTTP rejection]
D -->|Yes| F[Durable event admission]
F --> G[HTTP acknowledgment]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -121, Tests -283, Other +1. Total -403 across 7 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the Node handler as LINE’s sole webhook implementation, preserving signed raw-body checks and durable acknowledgment while retaining Express for Browser and Teams. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses redundant implementation rather than a reported user failure. Source identifies both the unused adapter and the registered Node route. Is this the best way to solve the issue? Yes: removing the unused private adapter leaves the existing Node route as the single LINE webhook owner without introducing a parallel API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against efca9bd05a13. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
Merged via squash.
|
* commit '9a1a6f7db9783d0b8abaf918bfe12978ea745b57': (26 commits) fix(maintainer): restore cold PR worktree provisioning (#157394) feat(ios): establish native Cloudflare Access sign-in sessions (#146996) fix: restore the Gateway after interrupted Doctor maintenance (#156854) refactor(line): retire the Express webhook adapter (#157369) refactor(cron): consolidate unavailable delivery targets (#157393) ci: apply Go memory defaults to architecture checks fix(cli): preserve the first PowerShell completion test failure (#157267) refactor(agents): consolidate transcript-tail model selection (#157382) fix(release): honor frozen validation contracts (#157034) fix(perf): use settled Kova terminal CPU accounting (#157029) chore(windows): verify packaged repair worker lifecycle (#157047) refactor(logging): share memory pressure threshold selection (#157164) fix(release): verify bundled fs-safe native bindings (#157027) perf(skills): skip warm prompt search when minimum cannot fit (#157343) fix(ui): avoid retaining detached tooltip anchors (#157226) perf(ci): reuse compiler state and shorten guard and UI tests (#157265) perf(ui): preserve model caches on unrelated metadata updates (#157254) chore: remove the tracked PR-body artifact and ignore .artifacts (#157296) refactor: consolidate duplicate MCP lifecycle tests (#157360) test(qa): consolidate CLI runtime fixtures (#118496) ...
What Problem This Solves
Retires LINE's unused Express webhook implementation so its webhook contracts have one production owner.
User Impact
No intended user-visible behavior change. The registered Gateway route continues to use
createLineNodeWebhookHandler, preserving signature verification before JSON parsing, the 64 KiB pre-auth limit, error responses, and durable-delivery markers. No public SDK/plugin API, configuration, protocol, or stored-state shape changes.Why This Change Was Made
Peter approved this cleanup on September 24, 2026: "approve the line cleanup", following the deferral in #157099. The adapter and its option types were exposed only through LINE's explicitly private runtime barrel. Searches across all source roots, tests, manifests and SDK/public entrypoints found no production consumer of the retired adapter.
The useful Express-path tests now exercise Node request streams and the registered monitor boundary; adapter-specific mocks and representations are deleted.
Dependency audit: no dependency declaration can safely be removed in this scope. LINE itself declares neither
expressnor its typings. Browser and Teams still declare Express, and bundled Browser chunks import it from the root package. The repository ownership audit classifies it asroot_owned_extension_runtimethroughbrowser:dependencies. Root@types/expressalso serves Browser/Teams and Slack Bolt's peer. Following the work order's shared-consumer exception, all those declarations and the lockfile remain unchanged.pnpm installwas run; no lockfile was hand-edited.Fixes Found Along the Way
Knip loses its last visible root Express import when the LINE adapter disappears, despite the packaged Browser runtime still requiring the dependency. Peter explicitly approved the single
expressentry inrootBundledPluginRuntimeDependencieson September 24, 2026. Its comment names Browser and Teams as the remaining importers. Rootexpressand its typings remain unchanged; no other Knip entries or allowances are added. The existing shrink-only assertion-ratchet change removes the deleted adapter row.Build-reported startup/Mermaid asset-budget diagnostics are already owned by open #157161; this change touches no UI files or budgets. The inspected selected-handler shutdown behavior is an explicit
durable-after-stopcontract and is preserved.Evidence
Exact-head CI run 36021543312 passed for
e688aae9558113db2e85c91763129c0cc642ee30. The native watcher returned GREEN; the latest check list has 128 passed, 45 skipped, zero failed or pending.pnpm test:extensions:batch line: 68 files / 1,030 passed, 45.09 s on Linux Testbox.pnpm build: passed, 25m 26.9s. Package compilation (12m 20.3s) and unified declarations (8m 52.9s) account for most of the time.node scripts/check-package-dist-imports.mjs: passed on the fresh build.tbx_01m39ntj6y931c3y7qq3n39mtq, workflow 35998560812, verified source bytes and command exit 0. Lease stopped after completion.pnpm plugin-sdk:surface:check: passed.node scripts/run-vitest.mjs test/scripts/plugin-sdk-surface-report.test.ts src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts src/plugins/contracts/package-manifest.contract.test.ts src/plugins/contracts/extension-runtime-dependencies.contract.test.ts: 4 files / 549 passed.deps:root-ownership --checkanddeps:ownership-surface:check: passed.node scripts/check-changed.mjs: passed on the final committed source, 24m 13.8s on Linux Testbox workflow 36020898462. All seven changed/deleted paths were verified byte-identical to the committed source; the one-shot lease stopped successfully.pnpm dlx --package [email protected] knip --config config/knip.config.ts --production --no-progress --reporter compact --no-config-hints --dependencies: passed, including the approved root Express entry.Standalone one-worker costs (
pnpm test <file> --maxWorkers=1):webhook-node.test.ts221.07 s wall,monitor.lifecycle.test.ts241.78 s wall, both passed. These cold local runs were dominated by imports/worker preparation on the contended host; the full Linux batch above gives the hosted-runtime context. The monitor cases retain real transport, durable admission and lifecycle boundaries. On exact-head CI, the full LINE batch again passed 68 files / 1,030 tests in 131.59 s; the enclosing changed-extension job took 316 s including setup. Summed reported test execution was 0.073 s forwebhook-node.test.tsand 0.920 s formonitor.lifecycle.test.ts, excluding imports and transforms.Production-only diff (excluding tests, test directories and docs):
4 files changed, 2 insertions(+), 122 deletions(-)— 120 net lines removed, including the required one-line deleted-file ratchet prune; 121 production implementation lines retired.