Skip to content

Commit 90a7763

Browse files
Eva Syufactory-droid[bot]
authored andcommitted
fix: send appType as 'default' for terminal apps to avoid server validation error
The cloud API does not yet recognize 'terminal' as a valid appType, returning 400 INVALID_REQUEST. Map terminal appType to 'default' in the request while still stripping noisy accessibility context fields. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent a520dc4 commit 90a7763

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

apps/desktop/src/pipeline/providers/transcription/amical-cloud-provider.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,10 @@ export class AmicalCloudProvider implements TranscriptionProvider {
287287
const appType = detectApplicationType(
288288
this.currentAccessibilityContext,
289289
);
290-
// Terminal apps expose command output, ANSI escape sequences, and
291-
// prompt strings via the accessibility API. Sending this raw text
292-
// as context to the cloud transcription endpoint degrades
293-
// recognition quality (garbled output). Strip the surrounding
294-
// text for terminal-type applications.
290+
// Terminal apps expose noisy accessibility context (command
291+
// output, ANSI escapes, prompt strings) that degrades cloud
292+
// transcription quality. Strip text fields and send appType
293+
// as "default" since the server does not yet know "terminal".
295294
const isTerminal = appType === "terminal";
296295
return {
297296
selectedText: isTerminal
@@ -306,7 +305,7 @@ export class AmicalCloudProvider implements TranscriptionProvider {
306305
? undefined
307306
: this.currentAccessibilityContext!.context?.textSelection
308307
?.postSelectionText,
309-
appType,
308+
appType: isTerminal ? "default" : appType,
310309
appBundleId:
311310
this.currentAccessibilityContext!.context?.application
312311
?.bundleIdentifier,

0 commit comments

Comments
 (0)