Bug(PostHog AI): insight links shown to users do not always resolve
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
PostHog AI sometimes presents an insight it has just generated as if it can be opened from a URL, when in reality the insight is a transient artifact scoped to the conversation. The agent produces a markdown link of the form [Insight title (<id>)](/insights/<id>) in its reply, where <id> is the in-conversation artifact id and is not a real saved-insight short_id. Users click the link expecting to land on the insight and instead get nothing useful. This is a regression of the fix shipped in #44171.
How to reproduce
- Open PostHog AI in any project (default mode is fine).
- Ask the agent to build any chart, e.g. "show me average X by day of week as a bar chart".
- In a follow-up turn, ask the agent for a link to the insight, or for the SQL.
- The agent responds with a markdown link of the form
[Title (<id>)](/insights/<id>)that does not resolve to a real insight.
Additional context
Observed in a real customer PostHog AI conversation on 2026-05-11, trace ID c6df86dd-8054-4b30-963f-6ac04a213848.
Reported in: https://posthoghelp.zendesk.com/agent/tickets/57991 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/59328)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce this in PostHog AI by asking for a chart and then requesting an insight link or SQL. Trace the response path that generates the markdown link and verify that transient artifact IDs are not presented as saved-insight URLs; done means generated links resolve appropriately without breaking links to real saved insights.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100