GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — My Work refresh with the api agent times out at ~300 s: Bun's fetch idle timeout fires before REQUEST_TIMEOUT_MS · Issue #6222 · thedotmack/claude-mem

My Work refresh with the api agent times out at ~300 s: Bun's fetch idle timeout fires before REQUEST_TIMEOUT_MS #6222

New issue
Copy link
New issue
Copy link
Closed
#6224
Closed
My Work refresh with the api agent times out at ~300 s: Bun's fetch idle timeout fires before REQUEST_TIMEOUT_MS#6222
#6224
Copy link

Description

@Moep90
Moep90
opened on Nov 16, 2026
Issue body actions

Before submitting

  • I searched existing issues and confirmed this is not a duplicate (closest: My Work: goals step with the api agent never succeeds on a first run with ~6k prompts (whole window in one request, all-or-nothing quote check) #5969, a different cause in the same step)

Bug Description

With CLAUDE_MEM_WORK_VIEW_AGENT=api, the My Work refresh fails in its review step with the selected API provider: The operation timed out. whenever one answer takes longer than about 5 to 6 minutes. askApiTarget in src/services/agent-runner/api-agent.ts bounds the request with REQUEST_TIMEOUT_MS = 600_000, but the worker runs on Bun, and Bun's fetch ends a request on its own after about 300 s without data (the timer resets with every received chunk, and with stream: false nothing arrives until the answer is complete). So the 600 s limit never applies and the refresh fails on every long review call.

The review batch is 8 groups and max_tokens is 16,000, so on a local model at 25 to 40 tokens/s a full answer needs 400 to 640 s. Seven refreshes in a row failed for me; each left needs.unplaced unchanged.

Steps to Reproduce

  1. Run the worker on Bun 1.4.4 with CLAUDE_MEM_WORK_VIEW_AGENT=api against an OpenAI-compatible endpoint that serves a local model.
  2. Let a refresh reach review with enough groups that one answer runs past ~300 s.
  3. The step fails with The operation timed out. The gateway logs the same call as successful, finishing later.

A minimal check of the Bun behaviour, inside the worker image with no network:

const s = Bun.serve({ port: 0, idleTimeout: 0, fetch: () => new Promise(() => {}) });
const t = Date.now();
try { await fetch(`http://127.0.0.1:${s.port}/`); } catch (e) { console.log(((Date.now() - t) / 1000).toFixed(1), e.name); }

With the defaults this fails at 360.4 s with TimeoutError; with BUN_CONFIG_HTTP_IDLE_TIMEOUT=20 it fails at 24.0 s.

Expected Behavior

The request runs until REQUEST_TIMEOUT_MS or the caller's abort signal ends it.

Suggested fix

Pass Bun's timeout: false in the fetch options of askApiTarget, so the existing AbortSignal.timeout(REQUEST_TIMEOUT_MS) is the only limit. opencode made the same change for its provider requests (anomalyco/opencode#55007). Streaming the answer would also keep the connection alive, but it is a larger change.

Workaround until then: BUN_CONFIG_HTTP_IDLE_TIMEOUT=900 in the worker's environment.

Environment

  • Claude-mem version: 15.19.0 (worker in Docker)
  • Claude Code version: 2.1.325
  • OS: Linux
  • Platform: Bun 1.4.4, OpenAI-compatible endpoint (LiteLLM in front of vLLM)

Activity

  1. thedotmack
    closed this as completedin #6224on Nov 17, 2026
  2. thedotmack commented on Nov 17, 2026

    @thedotmack
    thedotmack
    on Nov 17, 2026
    Owner
    More actions

    Fixed by #6224 (01ec3d4). The api agent's request now turns off Bun's fetch idle timeout, so a long non-streamed answer runs until the agent's 10-minute request deadline instead of failing at about 5 minutes. Thanks @Moep90 for the report and for the fix. It's on main and ships in the next release.

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

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.