Skip to content

Chat agent hangs / loops on tile fetch failures — add timeouts and UX improvements #50

Description

@returnSGD

Problem

When running PixelRAG locally, the chat agent can get stuck in a loop:

  1. Search succeeds but tile images are not readable (too small, or network timeout)
  2. Agent keeps retrying different tiles, then falls back to non-existent web search/fetch tools
  3. Each request can take 3+ minutes before completing

Root causes

  • No fetch timeouts on API calls — slow networks cause indefinite hangs
  • Default API URL uses port 30001, which is blocked by many firewalls (HTTPS port 443 works)
  • maxTurns: 20 allows excessive retry loops
  • System prompt doesn't guide the agent to stop after failed tile reads
  • Chat page lacks a Lightbox — clicking tiles navigates to raw tile URLs with no way back
  • crypto.randomUUID() crashes on LAN IP access (non-secure context)

Fix (PR #49)

  • 30s timeouts on both search and tile fetch calls
  • Default URL changed to https://api.pixelrag.ai
  • maxTurns reduced to 8, prompt updated to limit retries
  • Lightbox with Back button added to chat page
  • crypto.randomUUID() fallback for non-localhost origins

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions