fix(macos): ensure exec approval prompt displays the command (#5042)

* fix(config): migrate audio.transcription with any CLI command

Two bugs fixed:
1. Removed CLI allowlist from mapLegacyAudioTranscription - the modern
   config format has no such restriction, so the allowlist only blocked
   legacy migration of valid configs like whisperx-transcribe.sh
2. Moved audio.transcription migration to a separate migration entry -
   it was nested inside routing.config-v2 which early-exited when no
   routing section existed

Closes #5017

* fix(macos): ensure exec approval prompt displays the command

The NSStackView and NSScrollView for the command text lacked proper
width constraints, causing the accessory view to collapse to zero
width in some cases. This fix:

1. Adds minimum width constraint (380px) to the root stack view
2. Adds minimum width constraint to the command scroll view
3. Enables vertical resizing and scrolling for long commands
4. Adds max height constraint to prevent excessively tall prompts

Closes #5038

* fix: validate legacy audio transcription migration input (openclaw#5042) thanks @shayan919293

* docs: add changelog note for legacy audio migration guard (openclaw#5042) thanks @shayan919293

* fix: satisfy lint on audio transcription migration braces (openclaw#5042) thanks @shayan919293

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
shayan919293
2026-02-13 06:49:06 -08:00
committed by GitHub
parent a7d6e44719
commit ab4adf7170
5 changed files with 97 additions and 41 deletions

View File

@@ -134,6 +134,45 @@ describe("legacy config detection", () => {
});
expect(res.config?.routing).toBeUndefined();
});
it("migrates audio.transcription with custom script names", async () => {
vi.resetModules();
const { migrateLegacyConfig } = await import("./config.js");
const res = migrateLegacyConfig({
audio: {
transcription: {
command: ["/home/user/.scripts/whisperx-transcribe.sh"],
timeoutSeconds: 120,
},
},
});
expect(res.changes).toContain("Moved audio.transcription → tools.media.audio.models.");
expect(res.config?.tools?.media?.audio).toEqual({
enabled: true,
models: [
{
command: "/home/user/.scripts/whisperx-transcribe.sh",
type: "cli",
timeoutSeconds: 120,
},
],
});
expect(res.config?.audio).toBeUndefined();
});
it("rejects audio.transcription when command contains non-string parts", async () => {
vi.resetModules();
const { migrateLegacyConfig } = await import("./config.js");
const res = migrateLegacyConfig({
audio: {
transcription: {
command: [{}],
timeoutSeconds: 120,
},
},
});
expect(res.changes).toContain("Removed audio.transcription (invalid or empty command).");
expect(res.config?.tools?.media?.audio).toBeUndefined();
expect(res.config?.audio).toBeUndefined();
});
it("migrates agent config into agents.defaults and tools", async () => {
vi.resetModules();
const { migrateLegacyConfig } = await import("./config.js");