Skip to content

bug(desktop): generation timeout abort surfaces as raw 'Request was aborted.' losing reason #164

Closed

Description

@hqhq1025

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.)

Activity

  1. github-actions commented on Apr 22, 2026

    @github-actions
    Contributor

    Thanks for the detailed report — I checked this against the current codebase and your diagnosis is largely correct.

    GENERATION_TIMEOUT support exists, but timeout reason propagation can still be lost in the main generate path. The timeout guard aborts with a CodesignError(..., GENERATION_TIMEOUT), but the main catch currently rethrows whatever upstream error bubbles out (without remapping from signal.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 to 300s, 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 uses CodesignError(..., GENERATION_TIMEOUT)
    • apps/desktop/src/main/index.ts:688 — generate catch logs/rethrows err directly; no timeout-specific remap from controller.signal.reason
    • packages/shared/src/error-codes.ts:38 — GENERATION_TIMEOUT error code is defined
    • packages/shared/src/error-codes.ts:202 — user-facing mapping for GENERATION_TIMEOUT
    • packages/i18n/src/locales/en.json:1027 — i18n string for timeout message
    • apps/desktop/src/main/preferences-ipc.ts:56 — default generationTimeoutSec is 1200
    • apps/desktop/src/renderer/src/components/Settings.tsx:2051 — Advanced timeout options only include 60/120/180/300

    open-codesign Bot

  2. added a commit that references this issue on Apr 23, 2026
    011b25d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions