Repository navigation
bug(desktop): generation timeout abort surfaces as raw 'Request was aborted.' losing reason #164
Description
Summary
User reports of `CodesignError: Request was aborted.` during long generations (e.g. one-shot full PDP / multi-section pages). The error is opaque — users have no idea this is a local timeout fire, not a network/model failure.
Root Cause
Two compounding issues:
1. Abort reason is dropped before reaching the user
`apps/desktop/src/main/generation-ipc.ts:76-78` correctly aborts with a descriptive reason:
```ts
controller.abort(
new Error(`Generation aborted after ${timeoutSec}s (Settings → Advanced → Generation timeout).`)
);
```
But the underlying SDK (Anthropic / OpenAI) wraps the abort and throws its own generic message — `node_modules/@anthropic-ai/sdk/.../error.ts:112`:
```ts
super(undefined, undefined, message || 'Request was aborted.', undefined);
```
The original `controller.signal.reason` is never read by the catch block in main, so the user sees `Request was aborted.` with no context.
2. Settings → Advanced → Generation timeout dropdown is broken
(Tracked internally; surfacing here.)
- Default value is `1200s` but the `` options max out at `300s` UI shows blank-selected on load Save silently downgrades to a value within range So a user who wants 30-minute generations cannot pick a value above 5 minutes — they get auto-aborted at `300s` (or whatever the silently-downgraded value is) without warning. Expected Behavior Timeout aborts surface with a clear message including the timeout value AND a link/button to Settings → Advanced → Generation timeout Dropdown supports a usable range (at least 1800s, ideally 3600s+ or unlimited "no timeout") No silent downgrade — if a stored value isn't in the list, show it as a custom option or surface a warning Proposed Fix Detect timeout abort in main/generate catch: read `controller.signal.reason` and rewrap as `CodesignError(GENERATION_TIMEOUT, { meta: { timeoutSec } })` New error code `GENERATION_TIMEOUT` with i18n message: "Generation timed out after {seconds}s. You can raise the limit in Settings → Advanced → Generation timeout." Settings dropdown: extend options to {60, 300, 600, 1200, 1800, 3600, 7200} or replace with numeric input; remove silent downgrade Why This Matters Users with custom providers, slow models, or one-shot multi-section requests hit this routinely and have no idea why. The current UX makes it look like the gateway / model failed. This compounds with 正常对话时报 403 错误:Error invoking remote method 'codesign:v1:generate' #124 / bug: 第三方中转服务测试连接通过但生成返回 500 not implemented #158 / bug(desktop): generation fails with codesign:v1:generate 404 on Win11 relay setup #130 confusion: every "generation failed" report has to be triaged manually because the error message reveals nothing. Related 正常对话时报 403 错误:Error invoking remote method 'codesign:v1:generate' #124 / bug: 第三方中转服务测试连接通过但生成返回 500 not implemented #158 / bug(desktop): generation fails with codesign:v1:generate 404 on Win11 relay setup #130 / bug(desktop): macOS generation fails with Instructions are required and no visible output #134 — all part of the broader "generation failures need diagnose() bridge" effort Internal note: timeout dropdown options upper bound vs default mismatch
Activity
github-actions commentedon Apr 22, 2026
Thanks for the detailed report — I checked this against the current codebase and your diagnosis is largely correct.
GENERATION_TIMEOUTsupport exists, but timeout reason propagation can still be lost in the main generate path. The timeout guard aborts with aCodesignError(..., GENERATION_TIMEOUT), but the main catch currently rethrows whatever upstream error bubbles out (without remapping fromsignal.reason) so generic aborted messages can still surface depending on provider/SDK behavior.The Settings timeout mismatch is also present: persisted default is
1200s, but the Advanced UI select currently only exposes up to300s, which can produce the blank/invalid-selection behavior you described.This repo is still pre-alpha, so some UX/error-handling paths are still being hardened and roadmap items may not be fully implemented yet.
Relevant code:
apps/desktop/src/main/generation-ipc.ts:76— timeout abort usesCodesignError(..., GENERATION_TIMEOUT)apps/desktop/src/main/index.ts:688— generate catch logs/rethrowserrdirectly; no timeout-specific remap fromcontroller.signal.reasonpackages/shared/src/error-codes.ts:38—GENERATION_TIMEOUTerror code is definedpackages/shared/src/error-codes.ts:202— user-facing mapping forGENERATION_TIMEOUTpackages/i18n/src/locales/en.json:1027— i18n string for timeout messageapps/desktop/src/main/preferences-ipc.ts:56— defaultgenerationTimeoutSecis1200apps/desktop/src/renderer/src/components/Settings.tsx:2051— Advanced timeout options only include60/120/180/300open-codesign Bot
fix(desktop): preserve generation timeout reason and raise dropdown c…
fix(desktop): preserve generation timeout reason and raise dropdown c…
fix(desktop): preserve generation timeout reason and raise dropdown c…