Skip to content

refactor(line): retire the Express webhook adapter - #157369

Merged
steipete merged 1 commit into
mainfrom
deslop/l33-line-express
Sep 24, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l33-line-express

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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 express nor its typings. Browser and Teams still declare Express, and bundled Browser chunks import it from the root package. The repository ownership audit classifies it as root_owned_extension_runtime through browser:dependencies. Root @types/express also 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 install was 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 express entry in rootBundledPluginRuntimeDependencies on September 24, 2026. Its comment names Browser and Teams as the remaining importers. Root express and 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-stop contract 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.

  • Focused Node webhook, monitor lifecycle and wire tests: 3 files / 45 passed.
  • 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.
  • Linux proof: Testbox 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 --check and deps: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.
  • Independent Codex autoreview after the approved Knip correction: scoped-clean, no accepted/actionable P0–P2 findings. ClawSweeper also reviewed the exact PR head with no findings.
  • 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.
  • Focused LINE/Browser/Teams tests after the approved entry: 9 files / 86 passed (LINE webhook-node, monitor lifecycle and webhook-wire; Browser middleware, bridge auth, token gates and fail-closed HTTP; Teams monitor hardening and lifecycle).

Standalone one-worker costs (pnpm test <file> --maxWorkers=1): webhook-node.test.ts 221.07 s wall, monitor.lifecycle.test.ts 241.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 for webhook-node.test.ts and 0.920 s for monitor.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.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: line Channel integration: line size: L labels Sep 24, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 12:00 PM ET / 16:00 UTC (Revision 3).

ClawSweeper review

What this changes

Removes 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
Reviewed head: e688aae9558113db2e85c91763129c0cc642ee30

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused deletion preserves the active webhook boundary and has substantial reported validation, with no actionable finding in this review.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The registered Gateway route already uses the Node handler; this MEMBER-authored internal cleanup is exempt from the external-contributor real-setup gate. The PR reports Testbox webhook checks with mocked bot dispatch, and no stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The registered Gateway route already uses the Node handler; this MEMBER-authored internal cleanup is exempt from the external-contributor real-setup gate. The PR reports Testbox webhook checks with mocked bot dispatch, and no stored-data contract changes.
Evidence reviewed 9 items Introduced change: The pinned branch diff removes the Express adapter export from LINE’s private runtime barrel and deletes its implementation and dedicated tests.
Current main still has the adapter: The fetched main runtime barrel still exports the Express webhook middleware and starter, so the requested cleanup is not implemented there.
Active webhook owner: Current main registers the Node webhook handler through LINE’s Gateway route; the proposed patch does not change that registration.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -121, Tests -283, Other +1. Total -403 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 0 121 -121
Tests 3 132 415 -283
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 1 +1
Total 7 134 537 -403

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a focused internal cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The registered Gateway route already uses the Node handler; this MEMBER-authored internal cleanup is exempt from the external-contributor real-setup gate. The PR reports Testbox webhook checks with mocked bot dispatch, and no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Eden: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-24T15:42:47.601Z sha e688aae :: needs maintainer review before merge. :: none
  • reviewed September 24, 2026, 12:00 PM ET / 16:00 UTC (Revision 2) sha unknown :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 9f8b453 into main Sep 24, 2026
190 of 191 checks passed
@steipete
steipete deleted the deslop/l33-line-express branch September 24, 2026 16:49
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 24, 2026
* 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)
  ...
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: line Channel integration: line P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant