Repository navigation
refactor(webhooks): deslop target ownership and body guards - #160846
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: blocked before merge. Reviewed September 28, 2026, 8:57 PM ET / September 29, 2026, 00:57 UTC. ClawSweeper reviewWhat this changesThe branch makes Nextcloud Talk webhook registrations own shared rate limiters and removes Feishu’s second body-size guard while retaining a bounded body reader. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open. Feishu’s 408 and 413 webhook responses lose their previous text Content-Type because the shared rejection writer clears the header set by the new code. The other reviewed webhook paths have no confirmed regression. Priority: P2 Review scores
Verification
How this fits togetherThe Feishu and Nextcloud Talk plugins receive signed HTTP callbacks through Gateway routes and compatibility listeners. Their monitors select an account, limit unauthenticated requests, admit events, and return HTTP acknowledgements or errors. flowchart LR
A[Signed webhook callback] --> B[Gateway or legacy listener]
B --> C[Live target registration]
C --> D[Rate and body limits]
D --> E[Signature and account selection]
E --> F[Event admission and HTTP response]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -62. Total -62 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one bounded body reader and live-target-owned limiter sharing, with Feishu’s HTTP status, body, and MIME preserved on Gateway and legacy listeners. Do we have a high-confidence way to reproduce the issue? Yes. An oversized or timed-out Feishu callback reaches a rejection helper that clears the pre-set Content-Type; this source-proven path was not executed in the read-only review. Is this the best way to solve the issue? No, not yet. Target-owned limiter sharing is a fitting simplification, but the Feishu rejection path must explicitly retain its previous MIME instead of relying on a header the shared writer clears. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against caf777893868. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
342 upstream commits, including the Slack huddles plugin (openclaw#159879), scoped Slack plugin reviewers (openclaw#159525) and two Feishu webhook changes (openclaw#160455, openclaw#160846) in files this branch does not touch. No file outside the generated set changed on both sides. Two conflicts, both generated: docs/.generated/config-baseline.counts.json and docs/.generated/config-baseline.sha256. openclaw#159879 takes plugin from 4374 to 4431 and openclaw#159525 takes core from 2464 to 2475. This branch keeps channel at 3788. Both files came from upstream and were regenerated. build:docker ran in a separate detached checkout of this commit outside the nested node_modules install. Regenerating there changed those two files and nothing else, giving the predicted counts, the upstream core and plugin hashes, this branch's channel hash and a new combined hash. The three generated-file checks pass there. Upstream deleted 102 test files in this range. None of them were added or changed by this branch. Feishu: 107 files and 1859 tests in the extension project, 17 files and 312 tests in the database-workers project. The forwarder test and the routing guards pass, 430 tests after upstream pruned test-projects.test.ts in this range. tsgo:core, tsgo:extensions, tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines and assertion-safety ratchets against upstream/main, oxlint and oxfmt on the 43 changed code files all pass.
…#160846) ## What Problem This Solves Webhook monitors retain redundant limiter registries and duplicate body-read guards after moving onto Gateway routes. ## User Impact Internal refactor with no deliberate behavior changes. Callback ports and paths, implicit legacy defaults, `legacyWebhook: false`, `/healthz`, signature verification, upload limits, durable acknowledgement, and shutdown behavior are preserved. No SDK, configuration, schema, protocol, or update migration changes. ## Why This Change Was Made Nextcloud's live target registrations now own the shared Gateway-path and legacy-endpoint limiters. This removes separate handler and endpoint maps plus their synchronization. Feishu uses the existing bounded body reader once instead of installing a second guard over the same stream, preserving the rejection content type and supported older host floor. Production: **+195 / -257 / net -62**. Tests: **+0 / -0 / net 0**. Docs: **+0 / -0 / net 0**. ## Evidence Blacksmith Testbox `tbx_01m3n1nmg2jxjz3yfzzxaspbqn`, after `pnpm install --frozen-lockfile`: **105 tests passed across 10 suites; 74.98s wall**. No tests were added or changed, so this adds no per-PR test cost. ```sh pnpm test \ extensions/nextcloud-talk/src/monitor.limiter-lifecycle.test.ts \ extensions/nextcloud-talk/src/monitor.replay.test.ts \ extensions/nextcloud-talk/src/monitor.preauth-inflight.test.ts \ extensions/nextcloud-talk/src/monitor.durable-ack.test.ts \ extensions/nextcloud-talk/src/monitor-runtime.abort.test.ts \ extensions/feishu/src/monitor.webhook-security.test.ts \ extensions/feishu/src/monitor.webhook-e2e.test.ts \ extensions/feishu/src/monitor.webhook-activity.test.ts \ extensions/feishu/src/monitor.webhook-host-floor.test.ts \ extensions/feishu/src/monitor.webhook-routing.test.ts --maxWorkers=1 ``` Independent Codex autoreview completed with no actionable P0–P2 findings. Formatting, diff sanity, removed-symbol searches, boundary guards, and the full unused-export scan passed. All heavy checks ran through `node scripts/crabbox-wrapper.mjs`. The original-base `node scripts/check-changed.mjs` hit the inherited 477/476 environment-variable budget failure, fixed on main by eb5a39d. A clean-main reproduction passed at 476/476. This slice is rebased onto fresh main and is published independently of the queue slice's typecheck correction under the campaign's focused-proof publication policy. Enforced PR CI remains the landing gate. Both changed files were checked against the open-PR inventory; oversized API file lists were resolved from Git refs. No operator Gateway or live provider was changed.
What Problem This Solves
Webhook monitors retain redundant limiter registries and duplicate body-read guards after moving onto Gateway routes.
User Impact
Internal refactor with no deliberate behavior changes. Callback ports and paths, implicit legacy defaults,
legacyWebhook: false,/healthz, signature verification, upload limits, durable acknowledgement, and shutdown behavior are preserved. No SDK, configuration, schema, protocol, or update migration changes.Why This Change Was Made
Nextcloud's live target registrations now own the shared Gateway-path and legacy-endpoint limiters. This removes separate handler and endpoint maps plus their synchronization. Feishu uses the existing bounded body reader once instead of installing a second guard over the same stream, preserving the rejection content type and supported older host floor.
Production: +195 / -257 / net -62. Tests: +0 / -0 / net 0. Docs: +0 / -0 / net 0.
Evidence
Blacksmith Testbox
tbx_01m3n1nmg2jxjz3yfzzxaspbqn, afterpnpm install --frozen-lockfile: 105 tests passed across 10 suites; 74.98s wall. No tests were added or changed, so this adds no per-PR test cost.pnpm test \ extensions/nextcloud-talk/src/monitor.limiter-lifecycle.test.ts \ extensions/nextcloud-talk/src/monitor.replay.test.ts \ extensions/nextcloud-talk/src/monitor.preauth-inflight.test.ts \ extensions/nextcloud-talk/src/monitor.durable-ack.test.ts \ extensions/nextcloud-talk/src/monitor-runtime.abort.test.ts \ extensions/feishu/src/monitor.webhook-security.test.ts \ extensions/feishu/src/monitor.webhook-e2e.test.ts \ extensions/feishu/src/monitor.webhook-activity.test.ts \ extensions/feishu/src/monitor.webhook-host-floor.test.ts \ extensions/feishu/src/monitor.webhook-routing.test.ts --maxWorkers=1Independent Codex autoreview completed with no actionable P0–P2 findings. Formatting, diff sanity, removed-symbol searches, boundary guards, and the full unused-export scan passed. All heavy checks ran through
node scripts/crabbox-wrapper.mjs.The original-base
node scripts/check-changed.mjshit the inherited 477/476 environment-variable budget failure, fixed on main by 6188881. A clean-main reproduction passed at 476/476. This slice is rebased onto fresh main and is published independently of the queue slice's typecheck correction under the campaign's focused-proof publication policy. Exact-head PR CI subsequently passed its production/test types, lint, selected tests, boundary checks, and enforced CI/security gates. Merged as 17813c8; reviewed file blobs and merge ancestry verified on main.Both changed files were checked against the open-PR inventory; oversized API file lists were resolved from Git refs. No operator Gateway or live provider was changed.