Skip to content

[upstream PR 867] f<!-- -->ix: make CALL_TIMEOUT_MS env-overridable and raise HTTP worker default_timeout to 600 s #411

@wbugitlab1

Description

@wbugitlab1

Source: Source pull request number: 867 in rohitg00/agentmemory (URL omitted to avoid GitHub cross-reference)
Title: fix: make CALL_TIMEOUT_MS env-overridable and raise HTTP worker default_timeout to 600 s
Author: kek-Sec
State: open
Draft: no
Merged: no
Head: kek-Sec/agentmemory:fix/866-configurable-call-timeout @ 6b1b780
Base: main @ 749c280
Labels: (none)
Changed files: 0
Commits: 0
Created: 2026-06-09T09:28:06Z
Updated: 2026-06-09T09:48:42Z
Closed: (not closed)
Merged at: (not merged)

Original PR body:

What

  • CALL_TIMEOUT_MS in src/mcp/rest-proxy.ts is now env-overridable via
    AGENTMEMORY_CALL_TIMEOUT_MS, with a default of 600 000 ms (was 15 000 ms).
    Mirrors the existing AGENTMEMORY_PROBE_TIMEOUT_MS pattern already in the
    same file.
  • iii-config.yaml default_timeout raised from 180 000 ms to 600 000 ms.
  • callTimeoutMs() is exported; test/mcp-call-timeout.test.ts covers the
    default value, env-var parsing, malformed-value fallback, and the abort
    behaviour under a hanging server response (9 new tests, all pass).

Why

On stores with 1 100+ semantic memories and 630+ insights,
memory_consolidate and memory_reflect reliably time out because the
proxy's HTTP client aborts the request after 15 s — before the server
finishes the LLM-backed operation.

Making the timeout env-overridable is a non-breaking improvement: users who
don't set the env var get the new 600 s default; anyone who needs a
different ceiling can set AGENTMEMORY_CALL_TIMEOUT_MS in their MCP server
env config.

Related to #655 (which addresses the server-side sequential KV bottleneck).
This addresses the client-side transport ceiling — both fixes are needed for
large stores to complete reliably.

How to verify

  1. Point the server at a large memory store (500+ semantic entries).
  2. Run memory_consolidate — it should complete instead of returning a
    timeout error.
  3. Set AGENTMEMORY_CALL_TIMEOUT_MS=5000 and confirm a small store still
    respects the override.
  4. npm test — the new suite at test/mcp-call-timeout.test.ts passes (9
    tests); no regressions in the existing suite.

Fixes #866

Summary by CodeRabbit

  • New Features

    • Increased HTTP worker default timeout to support longer-running operations (now 600s).
    • Proxied request timeout is now configurable and resilient to invalid values, with safe clamping to platform limits.
  • Tests

    • Added comprehensive tests validating timeout parsing, clamping, defaults, and proxy abort behavior.

Local branch: review/issue-866-pr-867-mcp-proxy-timeout
Fork PR: not created
Fork decision: adapted for this fork according to local review documentation. Local decision evidence: adapted import.
Verification: see local task record docs/todos/2026-06-15-issue-866-pr-867-mcp-timeout/todo.md for recorded checks and evidence.
Notes: tracker updated from local review documentation on 2026-06-16; issue remains open until separately closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision-modifiedFork adopted a modified versionupstream-openUpstream pull request is openupstream-prTracks an upstream pull request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions