Skip to content

Commit 8fe6ac7

Browse files
authored
refactor: remove pre-2026.4 compatibility shims and legacy migrations (#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
1 parent a4c1e22 commit 8fe6ac7

88 files changed

Lines changed: 203 additions & 4710 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/.i18n/native-source.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15107,15 +15107,15 @@
1510715107
},
1510815108
{
1510915109
"kind": "conditional-branch",
15110-
"line": 742,
15110+
"line": 739,
1511115111
"path": "apps/macos/Sources/OpenClaw/AppState.swift",
1511215112
"source": "\\(user)@\\(host)",
1511315113
"surface": "apple",
1511415114
"id": "native.apple.9cd2ced909f0952d"
1511515115
},
1511615116
{
1511715117
"kind": "conditional-branch",
15118-
"line": 742,
15118+
"line": 739,
1511915119
"path": "apps/macos/Sources/OpenClaw/AppState.swift",
1512015120
"source": "\\(user)@\\(host):\\(port)",
1512115121
"surface": "apple",

‎apps/macos/Sources/OpenClaw/AppState.swift‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,6 @@ final class AppState {
325325
isPreview || ApplicationRelocator.currentBundleAllowsPersistentIntegration()
326326
self.execApprovalsDefaultsAsyncResolver = execApprovalsDefaultsAsyncResolver
327327
self.execApprovalsReadRetryDelay = execApprovalsReadRetryDelay
328-
if !isPreview {
329-
migrateLegacyDefaults()
330-
}
331328
let onboardingSeen = UserDefaults.standard.bool(forKey: onboardingSeenKey)
332329
self.isPaused = UserDefaults.standard.bool(forKey: pauseDefaultsKey)
333330
self.launchAtLogin = false

‎apps/macos/Sources/OpenClaw/UserDefaultsMigration.swift‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎docs/channels/matrix-migration.md‎

Lines changed: 15 additions & 154 deletions
Large diffs are not rendered by default.

‎docs/docs_map.md‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,14 +538,10 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
538538
- Route: /channels/matrix-migration
539539
- Headings:
540540
- H2: What the migration does automatically
541-
- H2: What the migration cannot do automatically
541+
- H2: Upgrading from OpenClaw releases older than 2026.4
542542
- H2: Recommended upgrade flow
543-
- H2: How encrypted migration works
544543
- H2: Common messages and what they mean
545-
- H3: Upgrade and detection messages
546-
- H3: Encrypted-state recovery messages
547544
- H3: Manual recovery messages
548-
- H3: Custom plugin install messages
549545
- H2: If encrypted history still does not come back
550546
- H2: If you want to start fresh for future messages
551547
- H2: Related

‎docs/tools/diffs.md‎

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,6 @@ All fields are optional unless noted.
126126
</ParamField>
127127

128128
<AccordionGroup>
129-
<Accordion title="Legacy input aliases">
130-
Still accepted for backward compatibility:
131-
132-
- `format` -> `fileFormat`
133-
- `imageFormat` -> `fileFormat`
134-
- `imageQuality` -> `fileQuality`
135-
- `imageScale` -> `fileScale`
136-
- `imageMaxWidth` -> `fileMaxWidth`
137-
138-
</Accordion>
139129
<Accordion title="Validation and limits">
140130
- `before`/`after`: max 512 KiB each.
141131
- `patch`: max 2 MiB.
@@ -200,22 +190,13 @@ All successful results include `changed`: identical before/after input returns `
200190
- `fileMaxWidth`
201191

202192
</Accordion>
203-
<Accordion title="Compatibility aliases (always returned)">
204-
- `format` (= `fileFormat`)
205-
- `imagePath` (= `filePath`)
206-
- `imageBytes` (= `fileBytes`)
207-
- `imageQuality` (= `fileQuality`)
208-
- `imageScale` (= `fileScale`)
209-
- `imageMaxWidth` (= `fileMaxWidth`)
210-
211-
</Accordion>
212193
</AccordionGroup>
213194

214-
| Mode | Returns |
215-
| -------- | ------------------------------------------------------------------------------------------------------------ |
216-
| `"view"` | Viewer fields only. |
217-
| `"file"` | File fields only, no viewer artifact. |
218-
| `"both"` | Viewer fields plus file fields. If file rendering fails, viewer still returns with `fileError`/`imageError`. |
195+
| Mode | Returns |
196+
| -------- | ----------------------------------------------------------------------------------------------- |
197+
| `"view"` | Viewer fields only. |
198+
| `"file"` | File fields only, no viewer artifact. |
199+
| `"both"` | Viewer fields plus file fields. If file rendering fails, viewer still returns with `fileError`. |
219200

220201
### Collapsed unchanged sections
221202

‎extensions/diffs/README.md‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ Useful options:
7676
- `baseUrl`: override the gateway base URL used in the returned viewer link (origin or origin+base path only; no query/hash)
7777
- `viewerBaseUrl` plugin config: persistent fallback used when a tool call omits `baseUrl`
7878

79-
Legacy input aliases still accepted for backward compatibility:
80-
81-
- `format` -> `fileFormat`
82-
- `imageFormat` -> `fileFormat`
83-
- `imageQuality` -> `fileQuality`
84-
- `imageScale` -> `fileScale`
85-
- `imageMaxWidth` -> `fileMaxWidth`
86-
8779
Input safety limits:
8880

8981
- `before` and `after`: max 512 KiB each

‎extensions/diffs/src/config.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ describe("resolveDiffsPluginDefaults", () => {
181181

182182
expect(resolveDiffImageRenderOptions({ defaults }).format).toBe("pdf");
183183
expect(resolveDiffImageRenderOptions({ defaults, fileFormat: "png" }).format).toBe("png");
184-
expect(resolveDiffImageRenderOptions({ defaults, format: "png" }).format).toBe("png");
185184
});
186185

187186
it("accepts format as a config alias for fileFormat", () => {

‎extensions/diffs/src/config.ts‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -388,37 +388,27 @@ function normalizeTtlSeconds(ttlSeconds?: number): number {
388388
export function resolveDiffImageRenderOptions(params: {
389389
defaults: DiffFileDefaults;
390390
fileFormat?: DiffOutputFormat;
391-
format?: DiffOutputFormat;
392391
fileQuality?: DiffImageQualityPreset;
393392
fileScale?: number;
394393
fileMaxWidth?: number;
395-
imageFormat?: DiffOutputFormat;
396-
imageQuality?: DiffImageQualityPreset;
397-
imageScale?: number;
398-
imageMaxWidth?: number;
399394
}): {
400395
format: DiffOutputFormat;
401396
qualityPreset: DiffImageQualityPreset;
402397
scale: number;
403398
maxWidth: number;
404399
maxPixels: number;
405400
} {
406-
const format = normalizeFileFormat(
407-
params.fileFormat ?? params.imageFormat ?? params.format ?? params.defaults.fileFormat,
408-
);
409-
const qualityOverrideProvided =
410-
params.fileQuality !== undefined || params.imageQuality !== undefined;
411-
const qualityPreset = normalizeFileQuality(
412-
params.fileQuality ?? params.imageQuality ?? params.defaults.fileQuality,
413-
);
401+
const format = normalizeFileFormat(params.fileFormat ?? params.defaults.fileFormat);
402+
const qualityOverrideProvided = params.fileQuality !== undefined;
403+
const qualityPreset = normalizeFileQuality(params.fileQuality ?? params.defaults.fileQuality);
414404
const profile = DEFAULT_IMAGE_QUALITY_PROFILES[qualityPreset];
415405

416406
const scale = normalizeFileScale(
417-
params.fileScale ?? params.imageScale,
407+
params.fileScale,
418408
qualityOverrideProvided ? profile.scale : params.defaults.fileScale,
419409
);
420410
const maxWidth = normalizeFileMaxWidth(
421-
params.fileMaxWidth ?? params.imageMaxWidth,
411+
params.fileMaxWidth,
422412
qualityOverrideProvided ? profile.maxWidth : params.defaults.fileMaxWidth,
423413
);
424414

‎extensions/diffs/src/tool.test.ts‎

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,10 @@ describe("diffs tool", () => {
165165
expect(result?.content).toHaveLength(1);
166166
const details = readDetails(result);
167167
expect(requireString(details.filePath, "filePath")).toMatch(/preview\.png$/);
168-
expect(requireString(details.imagePath, "imagePath")).toMatch(/preview\.png$/);
169-
expect(details.format).toBe("png");
168+
expect(details.fileFormat).toBe("png");
170169
expect(details.fileQuality).toBe("standard");
171-
expect(details.imageQuality).toBe("standard");
172170
expect(details.fileScale).toBe(2);
173-
expect(details.imageScale).toBe(2);
174171
expect(details.fileMaxWidth).toBe(960);
175-
expect(details.imageMaxWidth).toBe(960);
176172
expect(details.viewerUrl).toBeUndefined();
177173
expect(cleanupSpy).toHaveBeenCalledTimes(1);
178174
});
@@ -200,7 +196,7 @@ describe("diffs tool", () => {
200196

201197
expect(screenshotter["screenshotHtml"]).toHaveBeenCalledTimes(1);
202198
expect(readTextContent(result, 0)).toContain("Diff PDF generated at:");
203-
expect((result.details as Record<string, unknown>).format).toBe("pdf");
199+
expect((result.details as Record<string, unknown>).fileFormat).toBe("pdf");
204200
expect((result.details as Record<string, unknown>).filePath).toMatch(/preview\.pdf$/);
205201
});
206202

@@ -302,52 +298,6 @@ describe("diffs tool", () => {
302298
}
303299
});
304300

305-
it("accepts image* tool options for backward compatibility", async () => {
306-
const screenshotter = createPngScreenshotter({
307-
assertImage: (image) => {
308-
expect(image.qualityPreset).toBe("hq");
309-
expect(image.scale).toBe(2.4);
310-
expect(image.maxWidth).toBe(1100);
311-
},
312-
});
313-
314-
const tool = createToolWithScreenshotter(store, screenshotter);
315-
316-
const result = await tool.execute?.("tool-2legacy", {
317-
before: "one\n",
318-
after: "two\n",
319-
mode: "file",
320-
imageQuality: "hq",
321-
imageScale: "2.4",
322-
imageMaxWidth: "1100",
323-
});
324-
325-
expect((result.details as Record<string, unknown>).fileQuality).toBe("hq");
326-
expect((result.details as Record<string, unknown>).fileScale).toBe(2.4);
327-
expect((result.details as Record<string, unknown>).fileMaxWidth).toBe(1100);
328-
});
329-
330-
it("accepts deprecated format alias for fileFormat", async () => {
331-
const screenshotter = createPdfScreenshotter();
332-
333-
const tool = createDiffsTool({
334-
api: createApi(),
335-
store,
336-
defaults: DEFAULT_DIFFS_TOOL_DEFAULTS,
337-
screenshotter,
338-
});
339-
340-
const result = await tool.execute?.("tool-2format", {
341-
before: "one\n",
342-
after: "two\n",
343-
mode: "file",
344-
format: "pdf",
345-
});
346-
347-
expect((result.details as Record<string, unknown>).fileFormat).toBe("pdf");
348-
expect((result.details as Record<string, unknown>).filePath).toMatch(/preview\.pdf$/);
349-
});
350-
351301
it("honors defaults.mode=file when mode is omitted", async () => {
352302
const screenshotter = createPngScreenshotter();
353303
const tool = createToolWithScreenshotter(store, screenshotter, {
@@ -384,7 +334,6 @@ describe("diffs tool", () => {
384334
expect(result?.content).toHaveLength(1);
385335
expect(readTextContent(result, 0)).toContain("File rendering failed");
386336
expect((result.details as Record<string, unknown>).fileError).toBe("browser missing");
387-
expect((result.details as Record<string, unknown>).imageError).toBe("browser missing");
388337
});
389338

390339
it("rejects invalid base URLs as tool input errors", async () => {
@@ -539,7 +488,7 @@ describe("diffs tool", () => {
539488

540489
expect((result.details as Record<string, unknown>).mode).toBe("both");
541490
expect(screenshotter["screenshotHtml"]).toHaveBeenCalledTimes(1);
542-
expect((result.details as Record<string, unknown>).format).toBe("png");
491+
expect((result.details as Record<string, unknown>).fileFormat).toBe("png");
543492
expect((result.details as Record<string, unknown>).fileQuality).toBe("print");
544493
expect((result.details as Record<string, unknown>).fileScale).toBe(2.75);
545494
expect((result.details as Record<string, unknown>).fileMaxWidth).toBe(1320);

0 commit comments

Comments
 (0)