[GH-ISSUE #73] [Issue]: Make slow Hierarchical Maps generation resilient to provider timeouts #34

Closed
opened 2026-10-20 17:23:43 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @thetopham on GitHub (Jul 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/73

Originally assigned to: @thetopham on GitHub.

Summary

Slow local-model map generation can complete in KoboldCPP after Marinara Engine has already aborted the connection with an Undici HeadersTimeoutError. Hierarchical Maps then reports a generic generation failure even though the provider was still producing the requested map.

Affected package

Hierarchical Maps (hierarchical-maps), latest reported patch; current source package version 1.1.5

Expected behavior

  • Map creation and expansion can wait for a deliberately configured slow local text-generation request.
  • The UI explains that large maps may take several minutes and keeps a clear persistent loading state.
  • Timeout failures are distinguished from invalid model output and ordinary connection failures.
  • Users receive a safe retry path without losing their existing map or unsaved editor state.
  • Supported text-generation timeout settings are documented and actually govern the outbound LLM request.

Actual behavior

A Windows user configured a 1,200,000 ms timeout, but map generation still failed with fetch failed: Headers Timeout Error. KoboldCPP subsequently reported that the established connection had been aborted and its completed response could not be sent.

Current source diagnosis shows:

  • the shared Engine LLM transport uses a hard-coded five-minute headersTimeout;
  • the Maps draft route calls a buffered chatComplete request without a longer route signal or configurable dispatcher timeout; and
  • existing documented .env timeout variables cover media, embeddings, custom tools, and selected integrations, not general text-generation headers.

This makes the report consistent with Engine aborting just before KoboldCPP tried to return the completed response.

Steps to reproduce

  1. Configure Hierarchical Maps with an OpenAI-compatible KoboldCPP connection whose large JSON generation takes longer than five minutes before response headers are sent.
  2. Start a medium or large AI map draft or expansion.
  3. Wait for the provider to approach completion.
  4. Observe Marinara log fetch failed: Headers Timeout Error and [spatial/map-draft] Generation failed.
  5. Observe KoboldCPP report that the established connection was aborted and the response could not be sent.

Environment

  • Marinara Engine version: latest reported patch; exact installed version not supplied
  • Package version: latest reported patch; current source package version 1.1.5
  • Install type: Windows local installation
  • OS + version: Windows; exact version not supplied
  • Browser or app shell: browser/app shell not supplied
  • Provider: KoboldCPP through an OpenAI-compatible connection

Logs, screenshots, or video

Sanitized failure signature:

TypeError: fetch failed
caused by: HeadersTimeoutError: Headers Timeout Error
[spatial/map-draft] Generation failed

KoboldCPP:
[WinError 10053] An established connection was aborted by the software in your host machine
The response could not be sent, maybe connection was terminated

Hostname, local username paths, chat ID, and private chat data are intentionally omitted.

Additional context

The user-facing failure occurs in Hierarchical Maps, but the five-minute LLM headers timeout is generic Engine-owned provider transport. This issue should track package messaging and retry behavior while linking any paired Marinara-Engine change that makes text-generation headers/body timeouts configurable or adopts a safe streaming collection path for long local generations.

Do not simply raise one timeout without checking request cancellation, inter-chunk body timeout behavior, buffered versus streaming provider compatibility, and cleanup after the client closes the Maps builder.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @thetopham on GitHub (Jul 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/73 Originally assigned to: @thetopham on GitHub. ## Summary Slow local-model map generation can complete in KoboldCPP after Marinara Engine has already aborted the connection with an Undici `HeadersTimeoutError`. Hierarchical Maps then reports a generic generation failure even though the provider was still producing the requested map. ## Affected package Hierarchical Maps (`hierarchical-maps`), latest reported patch; current source package version 1.1.5 ## Expected behavior - Map creation and expansion can wait for a deliberately configured slow local text-generation request. - The UI explains that large maps may take several minutes and keeps a clear persistent loading state. - Timeout failures are distinguished from invalid model output and ordinary connection failures. - Users receive a safe retry path without losing their existing map or unsaved editor state. - Supported text-generation timeout settings are documented and actually govern the outbound LLM request. ## Actual behavior A Windows user configured a 1,200,000 ms timeout, but map generation still failed with `fetch failed: Headers Timeout Error`. KoboldCPP subsequently reported that the established connection had been aborted and its completed response could not be sent. Current source diagnosis shows: - the shared Engine LLM transport uses a hard-coded five-minute `headersTimeout`; - the Maps draft route calls a buffered `chatComplete` request without a longer route signal or configurable dispatcher timeout; and - existing documented `.env` timeout variables cover media, embeddings, custom tools, and selected integrations, not general text-generation headers. This makes the report consistent with Engine aborting just before KoboldCPP tried to return the completed response. ## Steps to reproduce 1. Configure Hierarchical Maps with an OpenAI-compatible KoboldCPP connection whose large JSON generation takes longer than five minutes before response headers are sent. 2. Start a medium or large AI map draft or expansion. 3. Wait for the provider to approach completion. 4. Observe Marinara log `fetch failed: Headers Timeout Error` and `[spatial/map-draft] Generation failed`. 5. Observe KoboldCPP report that the established connection was aborted and the response could not be sent. ## Environment - Marinara Engine version: latest reported patch; exact installed version not supplied - Package version: latest reported patch; current source package version 1.1.5 - Install type: Windows local installation - OS + version: Windows; exact version not supplied - Browser or app shell: browser/app shell not supplied - Provider: KoboldCPP through an OpenAI-compatible connection ## Logs, screenshots, or video Sanitized failure signature: ```text TypeError: fetch failed caused by: HeadersTimeoutError: Headers Timeout Error [spatial/map-draft] Generation failed KoboldCPP: [WinError 10053] An established connection was aborted by the software in your host machine The response could not be sent, maybe connection was terminated ``` Hostname, local username paths, chat ID, and private chat data are intentionally omitted. ## Additional context The user-facing failure occurs in Hierarchical Maps, but the five-minute LLM headers timeout is generic Engine-owned provider transport. This issue should track package messaging and retry behavior while linking any paired Marinara-Engine change that makes text-generation headers/body timeouts configurable or adopts a safe streaming collection path for long local generations. Do not simply raise one timeout without checking request cancellation, inter-chunk body timeout behavior, buffered versus streaming provider compatibility, and cleanup after the client closes the Maps builder. ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@thetopham commented on GitHub (Jul 28, 2026):

resolved in #4175

<!-- gh-comment-id:5109405267 --> @thetopham commented on GitHub (Jul 28, 2026): resolved in #4175
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#34
No description provided.