## Problem
previosuly if you shared a video via copy/paste URL, if that same video wasnt loaded on the first page when you later tried to click that URL, it would show "no recording selected".
## Changes
now, if theres a sessionId included in the params, fetch that in ADDITION to the first page of results.
We briefly discussed tracking page number or cursor, however, i think this isnt a good idea as cursor values can change (ie, if sorting by clicks, the sort/ranking of videos with most clicks change over time which changes the first page)
## How did you test this code?
Before (no video found)
[before_url_didnt_work.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.com/user-attachments/thumbnails/6592dcd9-be76-4e18-be5d-95189dd5b642.mov" />](https://app.graphite.com/user-attachments/video/6592dcd9-be76-4e18-be5d-95189dd5b642.mov)
After (hurray)
[loads_video_from_url.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.com/user-attachments/thumbnails/f7364532-588f-4946-bb2e-1f528efd7edd.mov" />](https://app.graphite.com/user-attachments/video/f7364532-588f-4946-bb2e-1f528efd7edd.mov)
👉 _Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review._
## Changelog: (features only) Is this feature complete?
<!-- Yes if this is okay to go in the changelog. No if it's still hidden behind a feature flag, or part of a feature that's not complete yet, etc. -->
<!-- Removing this section does not mean the changelog bot won't pick it up, because *some people* like to not use the template, so we can't rely on it existing. -->
## Problem
The writing style guidelines for headers in our agent modes are inconsistent with our general writing style rule of using sentence case.
## Changes
Added a specific guideline for headers to use sentence case rather than title case in the writing style section of the agent modes prompts.
## How did you test this code?
Didn't
## Problem
This PR makes it possible to use the FF tool directly on the experiments page, since we have removed navigation.
It also adds suggestion pills for FF and experiments.
## Changes
- Added suggestions for feature flags and experiments
- Added the feature flag creation tool to the experiments page so users can create flags without navigating away
## How did you test this code?
Tests + locally
## Problem
we shipped it, delete the dead code
## Changes
<!-- If there are frontend changes, please include screenshots. -->
<!-- If a reference design was involved, include a link to the relevant Figma frame! -->
## How did you test this code?
<!-- Briefly describe the steps you took. -->
<!-- Include automated tests if possible, otherwise describe the manual testing routine. -->
<!-- Docs reminder: If this change requires updated docs, please do that! Engineers are the primary people responsible for their documentation. 🙌 -->
👉 _Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review._
## Changelog: (features only) Is this feature complete?
<!-- Yes if this is okay to go in the changelog. No if it's still hidden behind a feature flag, or part of a feature that's not complete yet, etc. -->
<!-- Removing this section does not mean the changelog bot won't pick it up, because *some people* like to not use the template, so we can't rely on it existing. -->
## Problem
This PR introduces a new `MaxTool` to create experiments. It builds on top of the `create_feature_flag` `MaxTool` with multivariate flag support.
## Changes
- Added a new `CreateExperimentTool` that allows creating experiments via PostHog AI
## How did you test this code?
New tests + evals
## Changelog: (features only) Is this feature complete?
Yes, this feature is complete and ready to be included in the changelog.
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
## Problem
The feature flag `MaxTool` currently only supports simple boolean flags, but users need to create multivariate flags for A/B testing and experiments.
## Changes
- Added support for creating multivariate feature flags with multiple variants
## How did you test this code?
- Added unit tests and evals
## Changelog: (features only) Is this feature complete?
Yes, this feature is complete and ready to be included in the changelog.
## Problem
https://posthog.slack.com/archives/C03PB072FMJ/p1762902442761889?thread_ts=1762194137.014209&cid=C03PB072FMJ
we had a client who, when using the UI to filter, saw no results of session recordings. However, when going into recordsings manually, saw the filtered-for event.
turns out with a high rate of sampling or recent sessions WITHOUT recordings (it appears every session of this client's should have this event, they have ~80K sessions per day, replay was turned off 9 days ago) the 10000 LIMIT is very likely to select event sessions that do NOT have a corresponding replay, meaning when we do this join we confusingly get 0 results.
## Changes
Increase the limit.
I asked claude if this was risky for perf:
```
Real-world risk: LOW
- The query is already constrained by date range and team_id
- ClickHouse handles large IN clauses routinely
- Worst case: slightly slower query (probably milliseconds)
```
## How did you test this code?
spoofed user, ran this query directly in SQL -- with 10K limit, no results, with 1M limit, saw results (session replays returend)
<!-- Docs reminder: If this change requires updated docs, please do that! Engineers are the primary people responsible for their documentation. 🙌 -->
👉 _Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review._
## Changelog: (features only) Is this feature complete?
<!-- Yes if this is okay to go in the changelog. No if it's still hidden behind a feature flag, or part of a feature that's not complete yet, etc. -->
<!-- Removing this section does not mean the changelog bot won't pick it up, because *some people* like to not use the template, so we can't rely on it existing. -->
## Problem
The current documentation for the `person_id_join_limitation` in HogQL AI generation is unclear and lacks comprehensive guidance on how to properly handle joins involving person_id fields. This leads to agents creating queries that result in ClickHouse errors due to forward references to override tables.
## Changes
Enhanced the `person_id_join_limitation` documentation in both `ee/hogai/graph/sql/prompts.py` and `posthog/hogql/ai.py` to:
## How did you test this code?
Hopefully it solves [https://us.posthog.com/project/2/error_tracking/0199e7eb-4ec0-73b1-8bc5-937a564aa75d?timestamp=2025-11-10T12%3A14%3A39.085000-08%3A00](error), will monitor