refactor: remove pre-2026.4 compatibility shims and legacy migrations#104650
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac78cf55c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| throw new Error("Invalid stored reference: missing conversation.id"); | ||
| } | ||
| const agent = ref.agent ?? ref.bot ?? undefined; | ||
| const agent = ref.agent ?? undefined; |
There was a problem hiding this comment.
Migrate legacy Teams bot references before dropping fallback
When a stored Teams conversation was created before the Agents SDK, or imported by extensions/msteams/doctor-contract-api.ts:311 without rewriting the reference shape, it can have bot but no agent. With this fallback removed, buildConversationReference throws missing agent.id before proactive sends/replies can use that conversation, so existing users lose Teams proactive delivery until a new inbound message refreshes each reference. Please keep the fallback or move the bot→agent rewrite into the doctor/state migration before removing it from runtime.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 4:15 PM ET / 20:15 UTC. Summary Reproducibility: yes. for the UI regression from current-head source: seed only Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Keep canonical scoped settings and current runtime shapes, independently delete the legacy token-bearing settings key during startup, then land the cleanup only after maintainers explicitly accept the documented stepping-stone and deprecated public API cutoff. Do we have a high-confidence way to reproduce the issue? Yes for the UI regression from current-head source: seed only Is this the best way to solve the issue? No as currently written; canonical-only readers are appropriate, but credential cleanup must be independent of legacy preference migration and the intentional compatibility cutoff needs explicit approval. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e34bff22763d. Label changesLabel changes:
Label justifications:
Evidence reviewedSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
edb4c19 to
cccd8cc
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: refactor: remove pre-2026.4 compatibility shims and legacy migrations This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9103fbbfb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| legacyAliases: [pageDerivedUrl], | ||
| remoteLegacyPageUrl: pageDerivedUrl, | ||
| }); | ||
| const defaultSource = readSettingsForGateway(storage, defaultUrl); |
There was a problem hiding this comment.
Scrub legacy settings even after dropping migration
For users who still have the old unscoped openclaw.control.settings.v1 blob with a persisted token, this now returns no source, so loadSettings() falls back to defaults and never reaches the token rewrite/removal path; persistSettings() is the only remaining code that removes LEGACY_SETTINGS_KEY. That leaves the plaintext gateway token in localStorage indefinitely unless the user later saves settings, despite the intended legacy token scrub. Please remove or scrub the legacy key on load even if its preferences are no longer migrated.
Useful? React with 👍 / 👎.
a9103fb to
5c366b5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c366b5d1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| env: params.env, | ||
| log: logger, | ||
| }); | ||
| fs.mkdirSync(params.storagePaths.rootDir, { recursive: true }); |
There was a problem hiding this comment.
Preserve snapshots for remaining Matrix sidecar imports
When a 2026.6-era account-scoped Matrix root still has file sidecars, this path still mutates user state by importing into SQLite and archiving bot-storage.json, recovery-key.json, legacy-crypto-migration.json, or IndexedDB snapshots as .migrated, but the pre-mutation maybeCreateMatrixMigrationSnapshot gate was removed for the whole path. If any import or archive step goes wrong, users no longer have the focused recovery archive that the previous implementation created before these same account-scoped migrations; keep the snapshot guard for the still-supported sidecar imports while dropping only the flat-store migration.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
Squash-rebased #103679 segment onto the durable-approval-registry tip on current main. Typed approval/command/select presentation actions replace raw-string inference across slack/telegram/discord/matrix/imessage/whatsapp, approval.resolve carries an explicit kind, and channel adapters map native callback envelopes through the typed action registry. Drift reconciliation: deprecated buildExecApprovalInteractiveReply assertions dropped (#104650 removed the shims); worker_environments bootstrap-column migration kept alongside the approval resolution_ref backfill; plugin-sdk API baseline regenerated. (cherry picked from commit 68765a5d39d2118c88a7a54d00387337912d4494) (cherry picked from commit 8642ac12af142e4b751f4f30d4b114615e7e5f66) (cherry picked from commit 036c4bc39499925fc03de16ec9302e346769350a) (cherry picked from commit 19dc350d6bc34e29a5169c6bc80971b0ad12adde) (cherry picked from commit fc978b0bad86aef421c79f6a211b25cc1b743c01) (cherry picked from commit 10de4d1ed5071f9be6ad1ee5d1e32c0fa8c9d11c) (cherry picked from commit 9a664ced1b1fa740172b258f355f1a82925ae41c) (cherry picked from commit c5ff69abbf444139e9e007bfa45beb0f00ffea54)
Squash-rebased #103679 segment onto the durable-approval-registry tip on current main. Typed approval/command/select presentation actions replace raw-string inference across slack/telegram/discord/matrix/imessage/whatsapp, approval.resolve carries an explicit kind, and channel adapters map native callback envelopes through the typed action registry. Drift reconciliation: deprecated buildExecApprovalInteractiveReply assertions dropped (#104650 removed the shims); worker_environments bootstrap-column migration kept alongside the approval resolution_ref backfill; plugin-sdk API baseline regenerated. (cherry picked from commit 68765a5d39d2118c88a7a54d00387337912d4494) (cherry picked from commit 8642ac12af142e4b751f4f30d4b114615e7e5f66) (cherry picked from commit 036c4bc39499925fc03de16ec9302e346769350a) (cherry picked from commit 19dc350d6bc34e29a5169c6bc80971b0ad12adde) (cherry picked from commit fc978b0bad86aef421c79f6a211b25cc1b743c01) (cherry picked from commit 10de4d1ed5071f9be6ad1ee5d1e32c0fa8c9d11c) (cherry picked from commit 9a664ced1b1fa740172b258f355f1a82925ae41c) (cherry picked from commit c5ff69abbf444139e9e007bfa45beb0f00ffea54) (cherry picked from commit d466a80) (cherry picked from commit f5b4fe40dd5c961322f8553cc80b2fdfb3f6503e) (cherry picked from commit 7340b4749a4cc4c72f7a41cce1bc9cb550cae038) (cherry picked from commit a151f41808f23ae60b10305ccd2bc959b9169a86)
Squash-rebased #103679 segment onto the durable-approval-registry tip on current main. Typed approval/command/select presentation actions replace raw-string inference across slack/telegram/discord/matrix/imessage/whatsapp, approval.resolve carries an explicit kind, and channel adapters map native callback envelopes through the typed action registry. Drift reconciliation: deprecated buildExecApprovalInteractiveReply assertions dropped (#104650 removed the shims); worker_environments bootstrap-column migration kept alongside the approval resolution_ref backfill; plugin-sdk API baseline regenerated. (cherry picked from commit 68765a5d39d2118c88a7a54d00387337912d4494) (cherry picked from commit 8642ac12af142e4b751f4f30d4b114615e7e5f66) (cherry picked from commit 036c4bc39499925fc03de16ec9302e346769350a) (cherry picked from commit 19dc350d6bc34e29a5169c6bc80971b0ad12adde) (cherry picked from commit fc978b0bad86aef421c79f6a211b25cc1b743c01) (cherry picked from commit 10de4d1ed5071f9be6ad1ee5d1e32c0fa8c9d11c) (cherry picked from commit 9a664ced1b1fa740172b258f355f1a82925ae41c) (cherry picked from commit c5ff69abbf444139e9e007bfa45beb0f00ffea54) (cherry picked from commit d466a80) (cherry picked from commit f5b4fe40dd5c961322f8553cc80b2fdfb3f6503e) (cherry picked from commit 7340b4749a4cc4c72f7a41cce1bc9cb550cae038) (cherry picked from commit a151f41808f23ae60b10305ccd2bc959b9169a86) (cherry picked from commit 60397dd)
Squash-rebased #103679 segment onto the durable-approval-registry tip on current main. Typed approval/command/select presentation actions replace raw-string inference across slack/telegram/discord/matrix/imessage/whatsapp, approval.resolve carries an explicit kind, and channel adapters map native callback envelopes through the typed action registry. Drift reconciliation: deprecated buildExecApprovalInteractiveReply assertions dropped (#104650 removed the shims); worker_environments bootstrap-column migration kept alongside the approval resolution_ref backfill; plugin-sdk API baseline regenerated. (cherry picked from commit 68765a5d39d2118c88a7a54d00387337912d4494) (cherry picked from commit 8642ac12af142e4b751f4f30d4b114615e7e5f66) (cherry picked from commit 036c4bc39499925fc03de16ec9302e346769350a) (cherry picked from commit 19dc350d6bc34e29a5169c6bc80971b0ad12adde) (cherry picked from commit fc978b0bad86aef421c79f6a211b25cc1b743c01) (cherry picked from commit 10de4d1ed5071f9be6ad1ee5d1e32c0fa8c9d11c) (cherry picked from commit 9a664ced1b1fa740172b258f355f1a82925ae41c) (cherry picked from commit c5ff69abbf444139e9e007bfa45beb0f00ffea54) (cherry picked from commit d466a80) (cherry picked from commit f5b4fe40dd5c961322f8553cc80b2fdfb3f6503e) (cherry picked from commit 7340b4749a4cc4c72f7a41cce1bc9cb550cae038) (cherry picked from commit a151f41808f23ae60b10305ccd2bc959b9169a86)
* fix(gateway): approval registry hardening and protocol-surface follow-ups Follow-up delta to the merged #103579 head, rebased onto current main: - gateway-protocol wire types derive from owner-module schema consts (types.ts tombstone) and ProtocolSchemas leaves the package index so the public plugin-sdk d.ts graph tree-shakes the registry declaration - approval access authority follows the operator.approvals scope tier with reviewerDeviceIds as the opt-in restriction (cross-surface first-answer-wins; requester identity gates only legacy adapters) - plugin node.invoke approvals register directly so unrenderable presentations fail closed before request routing - exec-approval manager reconciliation with #103515 revocation hardening (resolution source attribution, one-shot ask-fallback consumption) - surface-report pins and plugin-sdk API baseline refreshed; Swift models regenerated * feat(channels): add typed operator approval actions Squash-rebased #103679 segment onto the durable-approval-registry tip on current main. Typed approval/command/select presentation actions replace raw-string inference across slack/telegram/discord/matrix/imessage/whatsapp, approval.resolve carries an explicit kind, and channel adapters map native callback envelopes through the typed action registry. Drift reconciliation: deprecated buildExecApprovalInteractiveReply assertions dropped (#104650 removed the shims); worker_environments bootstrap-column migration kept alongside the approval resolution_ref backfill; plugin-sdk API baseline regenerated. (cherry picked from commit 68765a5d39d2118c88a7a54d00387337912d4494) (cherry picked from commit 8642ac12af142e4b751f4f30d4b114615e7e5f66) (cherry picked from commit 036c4bc39499925fc03de16ec9302e346769350a) (cherry picked from commit 19dc350d6bc34e29a5169c6bc80971b0ad12adde) (cherry picked from commit fc978b0bad86aef421c79f6a211b25cc1b743c01) (cherry picked from commit 10de4d1ed5071f9be6ad1ee5d1e32c0fa8c9d11c) (cherry picked from commit 9a664ced1b1fa740172b258f355f1a82925ae41c) (cherry picked from commit c5ff69abbf444139e9e007bfa45beb0f00ffea54) (cherry picked from commit d466a80) (cherry picked from commit f5b4fe40dd5c961322f8553cc80b2fdfb3f6503e) (cherry picked from commit 7340b4749a4cc4c72f7a41cce1bc9cb550cae038) (cherry picked from commit a151f41808f23ae60b10305ccd2bc959b9169a86) * fix(approvals): preserve typed transport ownership * test(imessage): narrow chunked approval text * refactor(protocol): remove retired type tombstone * fix(plugin-sdk): align surface budgets after rebase * docs(changelog): note typed operator approvals * docs(changelog): defer typed approval release note
…openclaw#104650) * refactor(matrix): retire pre-2026.4 legacy crypto and flat-storage migrations * refactor(cli): drop pre-tsdown daemon-cli dist compat shim from the build * refactor(diffs): remove deprecated image*/format tool params and output aliases * refactor(ui): drop pre-gateway-scoped localStorage readers and legacy theme map * refactor: remove assorted pre-2026.4 compat shims and deprecated aliases * fix(discord): map legacy thread-binding fields in the doctor JSON import * fix(msteams): keep bot read fallback for legacy imported conversation rows * test(msteams): cover legacy bot-only imported conversation references * fix(ui): keep channel-prefixed session key display fallback * chore: refresh native i18n inventory and build-docker step count * chore(matrix): drop now-unused migration-config module * chore: re-pin plugin SDK public export budget after compat removals * chore: refresh native i18n inventory after rebase * chore: re-pin plugin SDK callable budget and refresh i18n inventory after rebase
…3679) * fix(gateway): approval registry hardening and protocol-surface follow-ups Follow-up delta to the merged openclaw#103579 head, rebased onto current main: - gateway-protocol wire types derive from owner-module schema consts (types.ts tombstone) and ProtocolSchemas leaves the package index so the public plugin-sdk d.ts graph tree-shakes the registry declaration - approval access authority follows the operator.approvals scope tier with reviewerDeviceIds as the opt-in restriction (cross-surface first-answer-wins; requester identity gates only legacy adapters) - plugin node.invoke approvals register directly so unrenderable presentations fail closed before request routing - exec-approval manager reconciliation with openclaw#103515 revocation hardening (resolution source attribution, one-shot ask-fallback consumption) - surface-report pins and plugin-sdk API baseline refreshed; Swift models regenerated * feat(channels): add typed operator approval actions Squash-rebased openclaw#103679 segment onto the durable-approval-registry tip on current main. Typed approval/command/select presentation actions replace raw-string inference across slack/telegram/discord/matrix/imessage/whatsapp, approval.resolve carries an explicit kind, and channel adapters map native callback envelopes through the typed action registry. Drift reconciliation: deprecated buildExecApprovalInteractiveReply assertions dropped (openclaw#104650 removed the shims); worker_environments bootstrap-column migration kept alongside the approval resolution_ref backfill; plugin-sdk API baseline regenerated. (cherry picked from commit 68765a5d39d2118c88a7a54d00387337912d4494) (cherry picked from commit 8642ac12af142e4b751f4f30d4b114615e7e5f66) (cherry picked from commit 036c4bc39499925fc03de16ec9302e346769350a) (cherry picked from commit 19dc350d6bc34e29a5169c6bc80971b0ad12adde) (cherry picked from commit fc978b0bad86aef421c79f6a211b25cc1b743c01) (cherry picked from commit 10de4d1ed5071f9be6ad1ee5d1e32c0fa8c9d11c) (cherry picked from commit 9a664ced1b1fa740172b258f355f1a82925ae41c) (cherry picked from commit c5ff69abbf444139e9e007bfa45beb0f00ffea54) (cherry picked from commit d466a80) (cherry picked from commit f5b4fe40dd5c961322f8553cc80b2fdfb3f6503e) (cherry picked from commit 7340b4749a4cc4c72f7a41cce1bc9cb550cae038) (cherry picked from commit a151f41808f23ae60b10305ccd2bc959b9169a86) * fix(approvals): preserve typed transport ownership * test(imessage): narrow chunked approval text * refactor(protocol): remove retired type tombstone * fix(plugin-sdk): align surface budgets after rebase * docs(changelog): note typed operator approvals * docs(changelog): defer typed approval release note
Closes #104648
What Problem This Solves
The tree carried compatibility code for state shapes and call sites that have not shipped since before the 2026.4 release train: the Matrix flat-storage/legacy-crypto migration stack, a pre-tsdown daemon-CLI dist shim rebuilt on every build, deprecated model-facing tool params in the diffs plugin, Control UI readers for pre-gateway-scoped localStorage, and assorted deprecated aliases. Per repo policy these are migration debt: runtime must read canonical shapes only, and doctor owns legacy normalization.
Why This Change Was Made
Requested cleanup pass: anything older than April 2026 goes, to reduce LOC and simplify. Net effect: -4,087 lines (145 added, 4,232 deleted) across 81 files, 21 files deleted outright.
maybeMigrateLegacyStorageanddoctor-contract-api.tsare untouched.docs/channels/matrix-migration.mdnow documents the 2026.6 stepping-stone upgrade for flat-layout installs.src/cli/daemon-cli-compat.tsandscripts/write-cli-compat.ts(thedist/cli/daemon-cli.jsshim only served pre-tsdown installed updaters) plus its build-step wiring.imageQuality/imageFormat/imageScale/imageMaxWidth/formattool params and duplicatedimage*/formatoutput detail aliases. Config-key aliases (defaults.image*) stay until a doctor rename rule exists.openclaw.control.settings.v1blob reader/claim heuristics, the legacy theme-name map, the<think>-tag transcript fallback, and channel-prefixed legacy session keys. Legacy token scrubbing is kept (security).botref field andfindByUserId; discord thread-bindingexpiresAt/sessionKeyread-compat moved out of runtime into the doctor JSON import where it belongs; ollamacreateConfiguredOllamaCompatNumCtxWrapper; gateway-clientconnectDelayMs; net-policyvalidateIPv4AddressInput; two dead exec-approval reply wrappers; macOS no-opmigrateLegacyDefaults.User Impact
No impact for installs on any 2026.4+ release: every removed migration already ran there. Installs upgrading directly from pre-2026.4 releases with unmigrated Matrix flat storage step through a 2026.6 release first (documented). Agents calling the diffs tool with the deprecated
image*params must use thefile*names (deprecated in the schema since March).Evidence
pnpm check:changedgreen on Blacksmith Testbox through Crabbox:tbx_01kx97v5k9j2cv559n4ed70avd(all guard/typecheck/lint/format lanes + changed-file Vitest shards), Actions run https://github.com/openclaw/openclaw/actions/runs/29163971600tbx_01kx98xc11s28v6jh5nt8ga9bn), msteams 1095/1095 + discord 2000/2000 (tbx_01kx99saz4ce50v4rvsnysanym+ post-fix rerun), UI settings/theme/session-display/chat 233/233 (tbx_01kx98t27gatv5nfhw4t26tgya), gateway-client/net-policy/exec-approval/build-all shards green (tbx_01kx98xc11s28v6jh5nt8ga9bn)docs_map.mdclean locallytbx_01kx9a1c3ta415fm1ap52k0567), msteams 1097/1097 incl. two new bot-only regression tests (tbx_...brrgzvgfvrun)CHANGELOG.md, migration note lives in this PR body); the durable-data finding on the assorted commit was accepted for msteams (read fallback restored + regression tests) and rejected for discord with code proof (its doctor JSON import normalizes before write). The matrix and ui commit bundles were refused by the reviewer's secret scanner (token-like test fixture strings, false positive); those two commits are covered by the matrix 1445-test and UI 233-test suites plus manual line review.