Repository navigation
fix: complete Feishu webhook upgrades before activation - #165303
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 October 5, 2026, 12:36 AM ET / 04:36 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR lets update-time Doctor preserve historical webhook listener settings for missing channel plugins while keeping other plugin repairs deferred. Merge readiness✅ Ready for maintainer review This remains a useful fix for an unresolved update failure on current main. No actionable patch defect was found, and the newly recorded compatible-candidate qualification resolves the earlier upgrade-proof blocker. Priority: P1 Review scores
Verification
How this fits togetherDoctor prepares existing configuration before an updated OpenClaw package starts. Its plugin contract registry selects the migration owner and passes normalized settings and completion decisions into the existing config publication flow. flowchart TD
A[Existing channel configuration] --> B[Update rehearsal]
B --> C[Doctor owner selection]
C --> D[Installed or custom owner]
C --> E[Missing official plugin]
E --> F[Retained listener migration]
D --> G[Existing config publication]
F --> G
G --> H[Candidate startup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +87, Tests +157, Docs +9. Total +253 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Complete historical listener decisions through the existing Doctor publication owner before candidate activation, preserving selected plugin ownership and operator-authored endpoints. Do we have a high-confidence way to reproduce the issue? Yes: current main skips the retained listener contract when the missing Feishu plugin is deferred, matching the linked published-updater failure. This review inspected the source path and supplied run evidence without executing it. Is this the best way to solve the issue? Yes: the patch reuses the migration owner while separating listener preservation from deferred plugin repairs, and keeps installed or custom owners authoritative. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eaae0fdae778. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Fixed: upgrades preserve historical webhook listener settings before candidate Gateway activation. |
133 upstream commits. Upstream's X guest mode (openclaw#165354) adds 18 channel config entries. openclaw#165303 changes four Feishu files for webhook upgrades, client.ts, client-timeout.ts, client.test.ts and doctor-contract.ts. This branch touches none of them, so they merged as upstream has them. Three generated files conflicted, docs/.generated/config-baseline.counts.json, config-baseline.sha256 and src/config/bundled-channel-config-metadata.generated.ts. All three were regenerated from this merge rather than hand-merged. build:docker ran in a separate detached checkout of this commit. Counts are core 2505, channel 3866 and plugin 4490, which is upstream's counts plus this branch's two channel entries. The core and plugin hashes match upstream/main and the channel hash is new, as predicted. The three generated-file checks pass there. Feishu: 102 files and 1523 tests in the extension project, 17 files and 241 tests in the database-workers project, all passing. The forwarder test and the routing guards pass, 503 tests. tsgo:core, tsgo:extensions, tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines, assertion-safety, database-worker, test-timeout-race and test-mock-exports ratchets against upstream/main, oxlint and oxfmt on the 43 changed code files all pass.
) Preserve historical webhook endpoints when update rehearsal defers missing official plugins, allowing candidate Gateway activation. Fixes openclaw#165299.
What Problem This Solves
Updates from
[email protected]can stop before activating the candidate when Feishu uses webhooks and its external plugin is not installed yet. The candidate Doctor correctly defers plugin installation during rehearsal, but also skips the retained historical listener migration. Candidate startup then detects the unapplied migration and refuses to continue.Fixes #165299.
User Impact
The update rehearsal can preserve the existing Feishu callback endpoint before candidate startup. Authored listener ports and bind addresses, account inheritance, and explicit
legacyWebhook: falsesettings retain their existing meaning. The same host fallback covers the retained Telegram, Microsoft Teams, and Nextcloud Talk listener contracts.Plugin installation remains deferred during rehearsal. Installed or custom channel owners continue to take precedence, unrelated plugin repairs stay deferred, and this fallback does not report that plugin inspection has completed. This change introduces no new configuration option or required external-plugin capability.
Why This Change Was Made
The Doctor registry now retains deferred owner identities when deciding whether a host contract may apply, while continuing to exclude their executable contracts. For a missing official plugin, historical-listener mode can use a narrow operation from the retained host config Doctor artifact. That operation reuses the existing listener migration and eligibility rules, so explicit endpoint normalization happens before an implicit pin is considered.
Keeping the operation listener-specific preserves unavailable plugin-owned configuration. Keeping deferred owner identities visible also prevents a replacement plugin from accidentally inheriting the official host fallback. The developer documentation describes this optional host operation.
Evidence
The original failing upgrade and diagnostic replay used the same candidate package and plugin archive bytes. The replay exposed the unapplied Feishu listener plan at candidate startup after Doctor completed.
The extended registry regression fails on the original production code in four intended cases: missing official-plugin pinning, authored endpoint preservation, warning propagation, and deferred replacement ownership. Independent source review accepted the corrected implementation; the separate P0 autoreview found no accepted findings.
On the exact candidate, remote changed-file formatting/lint and the core, plugin test, extension, and extension test type graphs passed. The registry regression passed all 23 cases, including the four that failed before the fix. An additional 150 tests across 11 files passed, covering retained/installed contracts, unavailable paths, historical pins, and all four channel Doctor implementations.
pnpm test src/plugins/doctor-contract-registry.selection.test.ts --maxWorkers=1took 16.00 seconds including preparation; the five added cases used 23 milliseconds of test time. The unchanged production baseline with the new cases took 18.29 seconds and failed four cases. The sibling batch took 34.90 seconds. The same 23-case file passed in 4.18 seconds in exact-head CI; its five new cases used 34 milliseconds of test time.The full package build passed, and all reported PR checks are green on
d044d960f743. The published2026.9.7replay completed candidate Doctor,candidate-gateway-startup, and package swap with exit code 0. The updater reportedokand the expected candidate2026.9.8build, clearing the original preactivation failure.The complete
2026.9.8scenario failed its plugin-convergence assertion: the matching Feishu archive requires Plugin API>=2026.9.9. That floor is intentional under #162759 and remains unchanged. This result does not establish2026.9.8compatibility.Compatible-host qualification then passed the complete, unchanged published-
2026.9.7Feishu scenario in 407 seconds. A disposable, unpublished2026.9.9-beta.1candidate was prepared from the reviewed product head using the native release-preparation and package builders. Independent review verified that its preparation changes only version/cohort metadata and a private qualification note; executable code, dependency implementations, migration logic, fixtures, assertions, timeouts, and all four existing stable>=2026.9.9channel floors are unchanged. No public version or release was changed.The untruncated update receipt records the historical listener completion decision and the
channels.feishu.accounts.default.legacyWebhookpin. A subsequent Doctor reads the retained127.0.0.1:3000listener and Gateway route:18789/feishu/events. All 19 update steps exit successfully, and Codex, Discord, Feishu, and WhatsApp converge to the private candidate cohort. The remaining plugin warnings describe synthetic fixture configuration, with no plugin errors or integrity drift.The native run verified the installed candidate, automatic migration, external-plugin convergence, configured-state survival, subsequent Doctor validation, and final Gateway startup, health, readiness, and status. Startup took 32 seconds; health, readiness, and status each took one second. Full package/build-import validation passed in 491 seconds, and the four matching plugin archives were prepared in 12 seconds. The retained source bundle, full preparation patch, artifact identities, and runtime receipts bind this result to the private candidate and reviewed product code.
d044d960f74332512ff71bbe9d56ae804bb722c8e6cf0d7f6b76ee5109a59840fa4035bc296813d02026.9.9-beta.1764de8bd320a5a9cb7412fc785cec24a87acdbee180930e85e80a1b78dc380c6f952d19295fe4b5c19aa00f6cba8d8bda971a81ab82b0389a0ec7033e91a3407The registry and migration-owner regressions separately verify exact listener ports/hosts, inheritance, explicit opt-out, completion semantics, and deferred-owner precedence. The upgrade scenario disables channel runtimes and uses synthetic state; it is not a live Feishu callback or message-delivery test. No real provider or channel calls, compatibility overrides, or weakened assertions were used. The passing private compatible-host result preserves the failed
2026.9.8result and does not imply a2026.9.9release has been published.