Skip to content

fix: complete Feishu webhook upgrades before activation - #165303

Merged
shakkernerd merged 1 commit into
mainfrom
fix/deferred-webhook-pins
Oct 5, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/deferred-webhook-pins

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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: false settings 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=1 took 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 published 2026.9.7 replay completed candidate Doctor, candidate-gateway-startup, and package swap with exit code 0. The updater reported ok and the expected candidate 2026.9.8 build, clearing the original preactivation failure.

The complete 2026.9.8 scenario 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 establish 2026.9.8 compatibility.

Compatible-host qualification then passed the complete, unchanged published-2026.9.7 Feishu scenario in 407 seconds. A disposable, unpublished 2026.9.9-beta.1 candidate 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.9 channel 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.legacyWebhook pin. A subsequent Doctor reads the retained 127.0.0.1:3000 listener 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.

Identity Value
Reviewed product head d044d960f74332512ff71bbe9d56ae804bb722c8
Private test snapshot e6cf0d7f6b76ee5109a59840fa4035bc296813d0
Private package version 2026.9.9-beta.1
Root package SHA-256 764de8bd320a5a9cb7412fc785cec24a87acdbee180930e85e80a1b78dc380c6
Feishu package SHA-256 f952d19295fe4b5c19aa00f6cba8d8bda971a81ab82b0389a0ec7033e91a3407

The 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.8 result and does not imply a 2026.9.9 release has been published.

@clawsweeper

clawsweeper Bot commented Oct 5, 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 docs Improvements or additions to documentation channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram channel: feishu Channel integration: feishu size: M labels Oct 5, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 12:36 AM ET / 04:36 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: d044d960f74332512ff71bbe9d56ae804bb722c8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-preserving repair with meaningful regressions and recorded compatible-host upgrade qualification.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The captured body records the published 2026.9.7 updater exercising Doctor selection, listener pin publication, plugin convergence, and candidate startup successfully with a compatible private candidate derived from the reviewed head. Existing-state compatibility is supported by recorded endpoint/completion observations and focused preservation regressions. The private raw receipts were not independently inspected; callback delivery is outside this unchanged transport path, so the earlier callback request is not retained as a blocker.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The captured body records the published 2026.9.7 updater exercising Doctor selection, listener pin publication, plugin convergence, and candidate startup successfully with a compatible private candidate derived from the reviewed head. Existing-state compatibility is supported by recorded endpoint/completion observations and focused preservation regressions. The private raw receipts were not independently inspected; callback delivery is outside this unchanged transport path, so the earlier callback request is not retained as a blocker.
Evidence reviewed 9 items Pinned introduction and merge ownership: The introduced delta is b0c93a8..d044d96. Raw test-merge records confirm main parent c706b9e followed by the exact PR head; the inspected merged module change preserves the same optional operation.
Current main still needs the fix: Fetched main still filters deferred records out of owner selection and unconditionally skips the retained host contract for a deferred official plugin. It does not contain the new listener-only fallback.
Owner precedence and narrow fallback: Config repair retains deferred manifest identities without loading their executable contracts. A selected installed or replacement owner shadows the host artifact; only a missing deferred official owner receives the listener-specific normalizer, with legacy rules disabled.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Source +87, Tests +157, Docs +9. Total +253 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 6 117 30 +87
Tests 1 157 0 +157
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 283 30 +253

Review metrics

Metric Value Why it matters
Production versus regression growth production +117/-30, net +87; tests +157/-0 Production growth is justified by listener-only extraction across four retained artifacts and deferred-owner selection; five focused cases cover the distinct registry failures.
External plugin requirements 1 optional host operation; 0 new required external hooks Existing external Doctor implementations remain compatible with the documented host-only fallback.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/feishu/src/doctor-contract.ts, migration/backfill/repair: extensions/nextcloud-talk/src/doctor-contract.ts, migration/backfill/repair: extensions/telegram/src/doctor-contract.ts, migration/backfill/repair: src/plugins/doctor-contract-module.ts, unknown-data-model-change: src/plugins/doctor-contract-registry.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #165299
Summary: This PR is the candidate repair for the linked preactivation failure; the merged webhook migration is related foundational work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body records the published 2026.9.7 updater exercising Doctor selection, listener pin publication, plugin convergence, and candidate startup successfully with a compatible private candidate derived from the reviewed head. Existing-state compatibility is supported by recorded endpoint/completion observations and focused preservation regressions. The private raw receipts were not independently inspected; callback delivery is outside this unchanged transport path, so the earlier callback request is not retained as a blocker.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P1: The reported failure prevents an existing Feishu webhook installation from activating an update candidate.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The captured body records the published 2026.9.7 updater exercising Doctor selection, listener pin publication, plugin convergence, and candidate startup successfully with a compatible private candidate derived from the reviewed head. Existing-state compatibility is supported by recorded endpoint/completion observations and focused preservation regressions. The private raw receipts were not independently inspected; callback delivery is outside this unchanged transport path, so the earlier callback request is not retained as a blocker.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records the published 2026.9.7 updater exercising Doctor selection, listener pin publication, plugin convergence, and candidate startup successfully with a compatible private candidate derived from the reviewed head. Existing-state compatibility is supported by recorded endpoint/completion observations and focused preservation regressions. The private raw receipts were not independently inspected; callback delivery is outside this unchanged transport path, so the earlier callback request is not retained as a blocker.

Evidence

What I checked:

  • Pinned introduction and merge ownership: The introduced delta is b0c93a8..d044d96. Raw test-merge records confirm main parent c706b9e followed by the exact PR head; the inspected merged module change preserves the same optional operation. (src/plugins/doctor-contract-module.ts:218, 31625475c2be)
  • Current main still needs the fix: Fetched main still filters deferred records out of owner selection and unconditionally skips the retained host contract for a deferred official plugin. It does not contain the new listener-only fallback. (src/plugins/doctor-contract-registry.ts:264, eaae0fdae778)
  • Owner precedence and narrow fallback: Config repair retains deferred manifest identities without loading their executable contracts. A selected installed or replacement owner shadows the host artifact; only a missing deferred official owner receives the listener-specific normalizer, with legacy rules disabled. (src/plugins/doctor-contract-registry.ts:254, d044d960f743)
  • Existing migration owner reused: The four retained channel artifacts reuse the existing listener migration and account eligibility rules. The pin producer still honors canonical endpoints, explicit opt-out, prior-operation evidence, warnings, and completion markers; the patch adds no competing writer or stored format. (extensions/feishu/src/doctor-contract.ts:200, d044d960f743)
  • Focused regression coverage: Five table cases exercise missing-plugin pins, authored endpoints and inheritance, warning propagation, deferred installed ownership, and replacement ownership through the registry. Expected config is independently written; unrelated repairs, input mutation, plugin execution, and false inspection completion are checked. The captured body reports four intended failures on original production code and all 23 cases passing afterward. (src/plugins/doctor-contract-registry.selection.test.ts:92, d044d960f743)
  • Compatible published-driver qualification: The complete captured PR body records a 407-second successful published-2026.9.7 upgrade into an unpublished 2026.9.9-beta.1 candidate derived from the reviewed product head. It identifies snapshot e6cf0d7f6b76ee5109a59840fa4035bc296813d0, root package SHA-256 764de8bd320a5a9cb7412fc785cec24a87acdbee180930e85e80a1b78dc380c6, and Feishu archive SHA-256 f952d19295fe4b5c19aa00f6cba8d8bda971a81ab82b0389a0ec7033e91a3407. Reported observations include the default-account pin and completion decision, retained 127.0.0.1:3000 endpoint, all 19 update steps succeeding, plugin convergence, subsequent Doctor validation, and final Gateway health/readiness/status. Private raw receipts were not independently opened in this review. (d044d960f743)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: 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-10-05T03:17:32.428Z sha d044d96 :: blocked before merge. :: none
  • reviewed 2026-10-05T03:46:59.477Z sha d044d96 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Oct 5, 2026
@shakkernerd shakkernerd self-assigned this Oct 5, 2026
@shakkernerd
shakkernerd merged commit b57e493 into main Oct 5, 2026
178 of 179 checks passed
@shakkernerd
shakkernerd deleted the fix/deferred-webhook-pins branch October 5, 2026 04:39
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: upgrades preserve historical webhook listener settings before candidate Gateway activation.

MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Oct 5, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
)

Preserve historical webhook endpoints when update rehearsal defers missing official plugins, allowing candidate Gateway activation.

Fixes openclaw#165299.
RomneyDa added a commit that referenced this pull request Oct 8, 2026
Backport b57e493 (#165303) by Shakker, retaining the canonical plugin-owned listener migration. Move existing scope selection into its relevance owner for the October registry size limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

[Bug]: Feishu webhook upgrades fail before package activation

1 participant