Skip to content

[BUG] Multiple tools getting executed are rendered in flickery order #207

Closed

Description

@edenreich

Summary

When multiple tools are being executed in parallel, the rendered view is flickery - the sorting is not guaranteed.

Steps to Reproduce

  1. Asking the CLI to run multiple tools in parallel
  2. See flickery output rendered, where Grep goes before Read and then Read goes before Grep visual rendered output

Expected Behavior

When the agent decide to execute multiple tools I expect to see the tools execution indicator box consistent - no flickery order.

Actual Behavior

The rendered execution box flickers and the order is not gauranteed.

Activity

  1. added
    bug
    on Nov 17, 2025
  2. added theissue type on Nov 17, 2025
  3. edenreich commented on Nov 17, 2025

    @edenreich
    ContributorAuthor

    @claude Can you fix this?

  4. claude commented on Nov 17, 2025

    @claude
    Contributor

    Claude finished @edenreich's task —— View job • claude/issue-207-20251117-1830 • Create PR ➔


    Fix implemented successfully! ✅

    Summary

    I've fixed the flickering issue where multiple tools executing in parallel were rendered in inconsistent order. The problem was caused by iterating over Go maps which don't guarantee iteration order.

    Changes Made

    • Added order tracking: Introduced toolPreviewsOrder and parallelToolsOrder slices to maintain insertion order
    • Updated event handlers: Modified handlers to track order when new tools are added
    • Fixed rendering logic: Changed RenderPreviews() to iterate using order slices for deterministic, stable rendering
    • Updated cleanup: Modified ClearPreviews() to also reset order slices
    • Added smart cleanup: Tools are removed from order tracking after they complete and their display timer expires

    Technical Details

    The root cause was in /internal/ui/components/tool_call_renderer.go where the RenderPreviews() method iterated over two maps (toolPreviews and parallelToolsOrder). Since Go maps have undefined iteration order, each render cycle would display tools in a random order, creating the flickering effect.

    The fix maintains the original maps for fast lookups while adding parallel slices to track insertion order, ensuring tools always render in the same order they were received.


    Branch: claude/issue-207-20251117-1830 |

  5. added a commit that references this issue on Nov 17, 2025
    662d14c
  6. inference-gateway-releaser commented on Nov 17, 2025

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.53.5 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

    bugreleased

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions