Skip to content

Fix: tool events colliding across agents and status regression on replay#661

Open
hellop11 wants to merge 1 commit into
usestrix:mainfrom
hellop11:fix/issue-hellop11
Open

Fix: tool events colliding across agents and status regression on replay#661
hellop11 wants to merge 1 commit into
usestrix:mainfrom
hellop11:fix/issue-hellop11

Conversation

@hellop11

@hellop11 hellop11 commented Jul 3, 2026

Copy link
Copy Markdown

Problem

test_directory_size_skips_symlinks in tests/test_live_view.py could fail when multiple agents were active in the same session because TuiLiveView tracked tool call/output events using a dictionary keyed only by call_id.

This caused two issues:

Tool events could collide across agents. If two agents reused the same call_id, one agent's event could overwrite the other's, causing incorrect or missing tool events in the timeline.
Replayed tool-call events could regress completed tools back to running. When _record_tool_call_data() was called again for an existing event, it always reset the status to running, even if _record_tool_output_data() had already marked the tool as completed or failed.

Fixes #660

Fix
Change the event lookup key from call_id to (agent_id, call_id) so tool events are isolated per agent.
Update _record_tool_call_data() so that, when an event already exists, it only refreshes mutable fields such as tool_name and args. The status and result fields are preserved and continue to be managed exclusively by _record_tool_output_data().

Changes
strix/interface/tui/live_view.py: key tool event lookup by (agent_id, call_id) instead of call_id.
strix/interface/tui/live_view.py: preserve existing status and result when replaying tool-call events.
tests/test_live_view.py: add three regression tests:
test_same_call_id_different_agents_stay_isolated
test_replayed_tool_call_does_not_regress_completed_status
test_failed_result_keeps_failed_status_after_replay

Before / After

Before: Tool events from different agents could overwrite each other when they shared the same call_id, and replayed tool-call events could incorrectly change a completed or failed tool back to running.

After: Tool events remain isolated between agents by using (agent_id, call_id) as the lookup key, and replaying a tool-call event updates only mutable metadata without altering the tool's final status or result.

@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes tool event tracking in the TUI live view. The main changes are:

  • Tool events are keyed by both agent id and call id.
  • Replayed tool-call events refresh name and args without resetting status or result.
  • Live-view hydration and parsing helpers received stricter typing.
  • Regression tests cover cross-agent call-id reuse and replayed status preservation.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
strix/interface/tui/live_view.py Tool event lookup now separates agents and preserves completed or failed status during replay.
tests/test_live_view.py Adds tests for call-id isolation across agents and replay status preservation.

Reviews (1): Last reviewed commit: "Fix tool events colliding across agents ..." | Re-trigger Greptile

@hellop11 hellop11 changed the title Fix tool events colliding across agents and status regression on replay Fix: tool events colliding across agents and status regression on replay Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Tool events collide across agents and can regress from "completed" back to "running" in TuiLiveView

1 participant