-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(max): tell users chat charts have no export button #90024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
| from ee.hogai.utils.types.base import AssistantNodeName, AssistantState, NodePath | ||
|
|
||
| INSIGHT_TOOL_PROMPT = """ | ||
| Use this tool to generate an insight from a structured plan. It will return a visualization that the user can analyze and a textual representation for your analysis. These visualizations are transient and only exist within the current conversation—they are not saved to the project. To save an insight permanently, users should click the open insight icon below the chart in the conversation. | ||
| Use this tool to generate an insight from a structured plan. It will return a visualization that the user can analyze and a textual representation for your analysis. These visualizations are transient and only exist within the current conversation—they are not saved to the project. To save an insight permanently, users should click the open insight icon below the chart in the conversation. You cannot export a chart directly from the conversation, because the chart has no download button and no export menu. To export the data, tell the user to open the chart as a new insight from the icon below it, then export it from the insight page. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The transient export route omits the save stepWhy we think it's a valid issue
Issue description
Suggested fixTell the model to open the chart, save the new insight, and then use the saved insight's export menu. Update the identical text in all three prompt sites. Prompt to fix with AI (copy-paste) |
||
|
|
||
| This tool can also be used to edit the visualization the user is currently viewing on the insight page. In that case, you need to generate a new plan based on the schema of the existing insight. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saved insight charts skip the export correction
Why we think it's a valid issue
ee/hogai/context/insight/prompts.py:13, theinsight_urlproperty, every call site that builds anInsightContext, thehas_transient_artifactsflag inee/hogai/tools/task.py, and the controls thatVisualizationWidgetrenders.InsightContext.insight_urlreturns a URL wheneverinsight_short_idis set (ee/hogai/context/insight/context.py:62-67). Three call sites set it for saved insights:ee/hogai/tools/read_data/tool.py:449(read one insight),ee/hogai/context/dashboard/context.py:176(each insight on a read dashboard), andee/hogai/context/context.py:537(an insight the user attaches). All three take the{{#insight_url}}branch, so the new export sentence atprompts.py:13never reaches the model for a saved insight.ee/hogai/tools/task.py:190-213setshas_transient_artifacts = Trueonly for artifacts whose source is notArtifactSource.INSIGHT. A task that returns saved insights alone keeps the flag false, so the whole block attask.py:100-103— including the export sentence — is omitted.products/posthog_ai/frontend/components/tool/widgets/VisualizationWidget.tsx:126-146shows only the open-target button and the show/hide button, andgetArtifactOpenTarget(same file, lines 56-64) gives a saved insight an "Open insight" link, not an export control. So a saved insight in chat has no download button either.Insight URL, andtask.py:102tells the model that URL is a real link. That gives the model a correct route to offer, so the wrong answer is less likely there than on the transient path. Nothing in either branch states that the chat chart itself has no export control, so the invented download icon stays available to the model.Issue description
The new export instruction only appears inside
{{^insight_url}}.ReadDataTool._read_insight()setsinsight_short_idfor saved insights, so the formatter omits this instruction. The UI still renders saved insights inVisualizationWidget, which has no download control. Export questions about these charts can still produce the false directions that this PR intends to remove.Suggested fix
Add guidance for the
{{#insight_url}}branch. Tell Max to open the existing insight and export from that page. Move the warning outsidehas_transient_artifactsinTASK_ARTIFACTS_PROMPT, then give separate routes forArtifact IDandInsight IDentries.Prompt to fix with AI (copy-paste)