[DBA-94] Fix plot propagation to previous messages#68
Closed
SimonKaran13 wants to merge 4 commits intomainfrom
Closed
[DBA-94] Fix plot propagation to previous messages#68SimonKaran13 wants to merge 4 commits intomainfrom
SimonKaran13 wants to merge 4 commits intomainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a user sends multiple queries that generate plots, new plots overwrite previously rendered messages. The root cause is that
thread._visualization_resultis a shared mutable singleton on the Thread object — everythread.plot()call overwrites it, so non-latest messages withhas_visualization=Truebut no per-messagevisualization_datafall back to this shared state and render the wrong plot.Solution
Restrict the shared thread fallback to the latest message only. Non-latest messages now render exclusively from their own persisted
visualization_data. Anallow_thread_fallbackguard onrender_visualization_sectionprovides defense-in-depth, and a persistence fix ensures missing parquet files don't leavespec_dfabsent from the dict (which caused silent render failures).Summary
thread._visualization_resultfallback to the latest message onlyallow_thread_fallbackkeyword-only parameter torender_visualization_sectionas defense-in-depth guardload_chatwhen_has_spec_dfis True but parquet file is missingvisualization_datais None after a successfulthread.plot()callTest plan
make checkpasses (ruff, mypy, agent guidance)make testpasses (pre-existingtest_indexfailure only)tests/test_plot_propagation.py🤖 Generated with Claude Code