different-ai/openwork · error
app.error_request_failed
Error message
app.error_request_failed
What it means
assertNoClientError inspects a result object for an error field and throws an Error whose message is describeProviderError(maybe.error, t("app.error_request_failed")). The literal 'app.error_request_failed' surfaces when the error value couldn't be described into a friendlier message (missing translation or undescribable error shape), so the user sees the generic localized fallback key. It marks a client-side/provider request that returned an error payload.
Source
Thrown at apps/app/src/react-app/domains/session/sync/actions-store.ts:302
if (raw && !generic && raw !== heading) lines.push(raw);
if (status && !heading.includes(String(status))) lines.push(`Status: ${status}`);
if (provider && !heading.includes(provider)) lines.push(`Provider: ${provider}`);
if (code) lines.push(`Code: ${code}`);
if (response) lines.push(`Response: ${response}`);
if (lines.length > 1) return lines.join("\n");
if (raw && !generic) return raw;
if (error && typeof error === "object") {
const serialized = safeStringify(error);
if (serialized && serialized !== "{}") return serialized;
}
return fallback;
};
const assertNoClientError = (result: unknown) => {
const maybe = result as { error?: unknown } | null | undefined;
if (!maybe || maybe.error === undefined) return;
throw new Error(describeProviderError(maybe.error, t("app.error_request_failed")));
};
const lastPromptSent = () => snapshot.lastPromptSent;
const selectedSessionAgent = () => {
const id = options.selectedSessionId();
if (!id) return null;
return snapshot.sessionAgentById[id] ?? null;
};
const sessionRevertMessageId = () => options.selectedSession()?.revert?.messageID ?? null;
async function createReadySession(workspaceId: string, initialPrompt?: string) {
const id = workspaceId.trim();
if (!id) return undefined;
const c = options.client();
if (!c) {
return undefined;View on GitHub (pinned to 2b7df46e8a)
Solutions
- Log the raw error payload (maybe.error) at the call site to find the real underlying provider error and fix that (API key, model ID, quota).
- Ensure the app.error_request_failed key exists in all locale files if users see the raw key instead of translated text.
- Extend describeProviderError to map the unrecognized error shape to a human-readable message.
Example fix
// before
throw new Error(describeProviderError(maybe.error, t("app.error_request_failed")));
// after
throw new Error(describeProviderError(maybe.error, t("app.error_request_failed"), { raw: safeStringify(maybe.error) })); Defensive patterns
Strategy: try-catch
Validate before calling
const result = await sendPrompt(payload);
if (result && "error" in result && result.error !== undefined) {
handleProviderError(result.error); // inspect before it becomes a generic message
} Type guard
function hasClientError(r: unknown): r is { error: unknown } {
return typeof r === "object" && r !== null && "error" in r && (r as { error?: unknown }).error !== undefined;
} Try / catch
try {
await sendPrompt(payload);
} catch (e) {
if (e instanceof Error && e.message === "app.error_request_failed") {
logRawProviderError(lastResult.error); // dig out the real cause
showToast("Provider request failed — check model/API key/quota");
return;
}
throw e;
} Prevention
- Keep app.error_request_failed defined in every locale file so users never see the raw key.
- Extend describeProviderError mappings whenever you add a provider or it returns new error shapes.
- Log the raw error payload from the provider alongside the localized message for debuggability.
- Pre-flight check API key validity and model availability before sending prompts.
When it happens
Trigger: sendPrompt receives a result containing an error property from the provider/client layer, and describeProviderError falls back to the t("app.error_request_failed") translation — either because the error object has no recognizable shape or the i18n key is missing from the active locale.
Common situations: Provider API returned an error (rate limit, invalid model, bad API key) that the error-describer doesn't recognize; missing translation entry for app.error_request_failed in a custom locale file.
Related errors
- request_failed
- t("providers.custom_providers_disabled")
- extensions.add_name_required
- extensions.add_mcp_url_required
- extensions.add_description_required
AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01).
Data as JSON: /api/errors/5f4b316e70ac772a.
Report an issue: GitHub.