#4259·AionUi

[Bug]: API retry logs contaminate chat history, causing permanent session freeze

Author: mrjjstudioCreated Sep 14, 2026Updated Sep 14, 2026
Labelsneeds-triage

Describe the Bug

When an underlying model provider encounters rate limits or temporary network disconnects, retry logs (Retrying (attempt 1/3, waiting 2s)...Retrying (attempt 2/3, waiting 4s)...) are streamed directly into the conversation turn and permanently saved into the chat history.

This causes a cascading failure:

  1. Context Pollution: Dozens of retry strings are appended into the assistant message payload.
  2. Cascading Freeze / Overflow: In subsequent turns, whenever the user sends a new message (even "hello" or "?"), the bloated conversation history containing repeated retry logs is sent back to the API.
  3. Permanent Session Death: The session enters an unrecoverable state, repeatedly failing with This request produced no visible reply and locking the conversation permanently.

Steps to Reproduce

  1. Start a session with a model provider subject to rate limiting (e.g. Gemini Flash or a custom endpoint).
  2. Run a task that triggers multiple consecutive API calls or large context operations.
  3. When the provider returns a rate limit or temporary network error, observe the chat stream appending: Retrying (attempt 1/3, waiting 2s)...Retrying (attempt 2/3, waiting 4s)... repeatedly into the message bubble.
  4. Once retries fail and the turn ends, try typing any new message in the chat.
  5. The session completely fails to respond, throwing This request produced no visible reply on every subsequent input.

Expected Behavior

  • Ephemeral UI state: Retry and backoff status should only be displayed as transient UI indicators (such as toast notifications, inline spinners, or status bar items), and must NOT be committed into the persistent conversation history.
  • Clean Failure & Rollback: If an API call fails permanently after all retries, the failed/corrupted turn should be rolled back or cleanly flagged, rather than saving poisoned chunks into the message database.
  • Diagnostic Visibility: Provide clear visibility into the root cause (e.g. HTTP 429 Rate Limit, 504 Timeout) with a "Rollback / Retry" action button.

Environment

  • OS: macOS (Apple Silicon)
  • AionUi version: Latest v2.x
  • Backend: aioncore / pi-agent runner