Repository navigation
Description
Map: Map: build the Workflows first run, from template gallery to first send
Spec: Spec: Workflows first run
Cast: GPT-6.1 Sol (backend and wiring)
Question
Can a user change the open email just by typing into PostHog AI, which is already open beside it, and see the change in the editor?
Delivers end to end. Spec section "Change with PostHog AI". Builds on Make it yours.
- Open from the start (Michael, 2026-10-05). When Make it yours opens, the PostHog AI side panel opens with it (
openSidePanel(SidePanelTab.Max)), with the open email already selected as context, so the user can type a change straight away. No prompt is sent on their behalf; a placeholder or suggestions may show what to ask.- Switching to another email updates the context to that email.
- A user who closes the panel keeps it closed for this session; "Change with PostHog AI" reopens it.
- Leaving Make it yours does not leave a stale email context behind.
- Make it yours exposes the email (subject, preheader, text) as scene context, following
workflowAgentContext.tsandtemplateAgentContext.ts. - PostHog AI applies a change to the open editor through a frontend-applied tool, following the
create_message_templateMaxTool (products/workflows/backend/max_tools.pywith<MaxTool>). The editor reloads the new design. - If the frontend-applied tool path is gone from master, ship the prompt and the scene context only, and record the gap and the reason on this ticket.
Test seams. The backend tool through the test pattern of the existing MaxTools in products/workflows/backend/, with the LLM mocked. A kea logic test: opening Make it yours opens the side panel with the open email as context, switching emails changes the context, the button reopens a closed panel, and the tool's result updates the editor value.
Write scope. products/workflows/backend/max_tools.py and its registration, the first-run folder under products/workflows/frontend/, and tests.
Overlap: the designing-email-templates skill in products/workflows/skills/; read it, do not change it.
Multi-email templates: PostHog AI acts on the email that is open in Make it yours (#260 lists every email of the template). The scene context names which email is open and how many there are.
Acceptance criteria
-
Opening Make it yours opens PostHog AI beside the editor with the open email as context; typing a change updates that email in the editor.
-
The button opens the PostHog AI side panel with a prompt naming the email.
-
Asking for a change (for example, a shorter subject) changes the email in the open editor against a local stack.
-
Screenshots of the screen with the side panel open, at full width and 520px, are on this ticket.
How to build (map #253)
/implement+/tddred-green-refactor, outside-in, at the seams named above. The frontend mocks the API at the HTTP layer. Mock only what is external: the LLM and the PostHog analytics client.- Repo skills apply where the diff touches their area:
/writing-tests,/improving-drf-endpoints,/writing-ui-components,/writing-kea-logics,/adopting-generated-api-types,/placing-product-frontend-code,/writing-user-facing-copy,/writing-code-comments. - Branch from
upstream/master, push to the fork, open a draft PR onPostHog/posthogagainstmaster. A stacked PR carries its parent's commits and a "Stacked on" note. - Then
/qa-swarm. Shipped means a draft PR it handed off. Never mark ready, enqueue or merge. - Public repo: state sender rules as product rules. Fixture addresses use
example.com. The prototype is throwaway: read it for behavior, never copy or cherry-pick it.
Activity
Silthus commentedon Oct 5, 2026
Heads-up from map #268: ticket #271 changes the
designing-email-templatesskill that this ticket reads.references/unlayer-design-json.mdgains a "Native blocks and spacing" section: onetextblock per paragraph, spaced withcontainerPadding: "8px 24px",textinstead ofparagraph, and the button link shapevalues.href = {name: "web", values: {href, target}}.references/design-guidelines.mdrecommends the nativebuttonblock instead of a hand-written HTML table button.SKILL.mdgains one line that points to the native-block pattern.No tool or API behavior changes. The draft PR will be linked from #271.
Silthus commentedon Oct 5, 2026
Runtime: T3 delegated task from conductor thread
mcp:53aaf922-c8de-490b-8df2-687a523ef55f(devbox-michaelr-3)Worker:
impl-261, GPT-6.1 Sol (high reasoning), full accessTask:
node:delegated-task:command%3Amcp%3A3880df84-306b-4346-98c3-53a1a8e2f2d5%3Adelegate-task%3Amap253-impl-261-r1Worktree:
/home/coder/.t3/worktrees/posthog/fr-261, branchfeat/workflows-first-run-ai-editfromfeat/workflows-first-run-make-it-yoursata8c22c7ee3f(stacked on PostHog#112053)Review: one cross-family review (read-only
claude -p --model claude-opus-5-5), per the map's updated rule; this replaces the body's qa-swarm lineCap: 4 hours from 17:52 UTC (deadline 21:52 UTC)
CodeRabbit slot: 1 of 3
Silthus commentedon Oct 5, 2026
Note
🤖 GPT-6.1 Sol responding on behalf of Michael
Parked with draft PostHog/posthog#112079, stacked on PostHog#112053.
Final head:
d1e0b0f99fd58241e93a0566b1f55df2195cf880.Claude Opus 5.5 reviewed
260cca54a035935295b4c434e87efaf65b34bcd0after the draft opened; the final head contains the checked review fixes.Locked so far:
Proof bundle: red panel test, green final tests, frontend typecheck/lint/format logs, strict preflight, and the final browser interaction. The local gate and pre-push hook pass. Preflight retains a freshness advisory and complexity warnings. Real LLM behavior and backend sends were not exercised.
Claude report and every finding's disposition: M1, M2, M3, M4, L1's already-closed case, and L3 are fixed with focused tests. L4's copy is fixed; extra analytics events are rejected because the specified funnel and existing sidebar events cover this slice. L2's send coordination is rejected as outside this write scope; a chat sent inside the canvas export debounce can still see the previous committed design. Moving AI to the main scene still counts as deliberately closing the panel, per the session rule.
CodeRabbit was signed out and skipped. The PostHog image uploader denied this account, so the fake-data proof is on the fork assets branch. GitHub also denied assigning the upstream PR; this ticket remains assigned to Silthus. The conductor owns the parent stack's inherited upstream conflicts and freshness.
The gap is a scope decision. MaxTool still exists on master, but only in frozen LangGraph. The current sandbox tools update saved entities, so they cannot apply changes to this unsaved email. The integration guide says “No new
useMaxToolregistrations.” The brief permits context-only fallback only if that path is gone; it is still present, so this draft does not satisfy that literal exception or the editor-update criterion.Pending question: Should #261 accept this sandbox panel/context-only draft and move in-place unsaved-email editing to a separate MCP slice? Recommended: yes, keep the flag off, and have the conductor graduate the apply-back capability as its own slice. The ticket stays open until that scope decision.
Silthus commentedon Oct 5, 2026
Conductor surfaced the pending scope question to Michael in the conductor thread.
Silthus commentedon Oct 6, 2026
Michael's answer (2026-10-06): not accepted as context only. PostHog AI live-editing the email is the core of this ticket, not a follow-up, and it must not ship broken.
mcp:9722ddda-29b5-4b69-a2e2-f444da0fdfc5. That map links itself here. This ticket closes when the map's stack ships on top of feat(workflows): attach first-run email context to posthog ai PostHog/posthog#112079.wayfinder:awaiting-humancleared; the ticket stays open and assigned.Silthus commentedon Oct 6, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Michael
The live-edit work now has its own map: Map: PostHog AI live-edits the open email in every Workflows email editor, charted with Michael on 2026-10-06.