You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ship stack A: edit a code-managed template with your agent #516
Turns the integration branch spec/template-agent-edit into one reviewed draft PR on PostHog/posthog, per SHIP.md "Ship ticket". It covers Spec #502 stack A: #512, #503 and #509. The branch starts from spec/code-managed-templates at 07d7e0e, so the PR stacks on PostHog#118924.
Runtime: T3 child task
Task: node:delegated-task:command%3Amcp%3Afccb5a2f-b9fc-4c83-906b-f57b46974a4b%3Adelegate-task%3Awf-email-ship-516-1
Cast: Opus 5.5, high. Cap 240 minutes. Ships spec/template-agent-edit at 8a50f6ef11c, stacked on PostHog#118924.
PR:PostHog/posthog#118980 (draft), branch Silthus:spec/template-agent-edit, stacked on #118924. Review starts after d746c355e26. Reviewed head:0960e3de1162369dc6b77d8b3f9f9912562cab5c. fleet proof gate exits 0 on it.
qa-swarm, because the diff extends a public API contract (read-only template fields, the MCP get tool) and adds devDependencies.
Round
HEAD
Lanes
Fixed
Rejected
1 (full)
069216473b7
GPT-6.1 Sol high: correctness, risk, design, systems, author perspective; Opus 5.5 high: fresh eyes, UI
10
3
Live run 1
069216473b7
real app built from the branch
1
3
2 (fixes)
5ff207cb20c
same 7 lenses on the fix diff
7
0
Final reads 1–4
fa25e693a33 → 0960e3de116
GPT-6.1 Sol high
2
0
Live runs 2–3
5ff207cb20c, fa25e693a33
real app
2
1
Fixed, among others:
Uploaded source.repository/path/ref went verbatim into a prompt an agent with repository write access runs. The builder now treats a value outside a repository, path or ref shape as unknown.
The Liquid scan was quadratic on unclosed {{ on every list and retrieve (8.4 s on 40k characters). It is now a forward scan (4 ms on 200k).
Two tickets built the variable list twice: the server scan, and a frontend regex over the server's prose. The server now returns change_prompt_variables.
Copy HTML file left a second preheader tag behind, and broke the round trip for Liquid holding & or </title.
"Show full prompt" painted blank in Chromium. A scroll container inside the collapse inside the popover's 3D transform never paints, and global styles make every <pre> one.
Focus return, a second click on the button, Escape on the button, and Copy prompt pushed out of view.
message template duplicated now also fires on "Duplicate with my changes" and the library card.
A stale sentence is dropped when a reload points at another file.
One self-inflicted regression: a formatter rewrote two Django templates in 01cbef1d39e. Final read 1 caught it, and 158cccc1401 restores them byte for byte.
Proof (HEAD 0960e3de116)
Live run in the real app, built from the branch on a scratch database, at 069216473b7 and fa25e693a33:
posthog-node upload from a git checkout; REST upload; base-written row; released and GUI templates;
the injection attempt is dropped from the prompt;
in Chromium at 1440 and 560 px: clipboard equals sentence + context, the full prompt paints, focus returns, Copy HTML file is byte for byte, edge cases parse back through the SDK, no write request;
an agent round trip edited only the file and re-uploaded.
004b1bdc322, 3ae1cce0091 and 0960e3de116 came after the last browser run. Their proof is the render and API tests.
Prod shape: gap, accepted under the standing instruction (production read access from 2026-11-02).
Graded the merge risk medium, so no shadow diff was owed.
Rejected: a pending state on the clipboard copy; feedback for Cmd+Enter on an undescribed sentence; renaming the side-menu label; rewording the path-less "Find the HTML file" line and the starter, which are the spec's text; blank lines left where preheader tags were removed.
CodeRabbit is retired on this repository, so it did not run.
Shared Popover:Popover.tsx never calls refs.setReference, so a press on any popover's own trigger counts as outside. The trigger's click then reopens the popover. "Quick start" in the same header does the same.
Lemon UI: a scroll container inside a LemonCollapse inside a Popover stays unpainted in Chromium. Other popovers with collapsible scrolling content may show it.
The library card's message template duplicated event has no test. messageTemplatesLogic has no test file.
Activity
Silthus commentedon Oct 17, 2026
Runtime: T3 child task
Task:
node:delegated-task:command%3Amcp%3Afccb5a2f-b9fc-4c83-906b-f57b46974a4b%3Adelegate-task%3Awf-email-ship-516-1Cast: Opus 5.5, high. Cap 240 minutes. Ships
spec/template-agent-editat8a50f6ef11c, stacked on PostHog#118924.Silthus commentedon Oct 17, 2026
Note
🤖 Opus 5.5 responding on behalf of Michael
Resolution
PR: PostHog/posthog#118980 (draft), branch
Silthus:spec/template-agent-edit, stacked on #118924. Review starts afterd746c355e26.Reviewed head:
0960e3de1162369dc6b77d8b3f9f9912562cab5c.fleet proof gateexits 0 on it.What shipped
spec/code-managed-templatesatd746c355e26(Email templates: keep unsaved edits when an upload claims a template back #508) merged into the branch as069216473b7. One conflict inmessageTemplateLogic.ts: Email templates: keep unsaved edits when an upload claims a template back #508'screateCopyOfrefactor won, and themessage template duplicatedevent moved into it. Nothing generated needed regenerating.Review
qa-swarm, because the diff extends a public API contract (read-only template fields, the MCP get tool) and adds devDependencies.069216473b7069216473b75ff207cb20cfa25e693a33→0960e3de1165ff207cb20c,fa25e693a33Fixed, among others:
source.repository/path/refwent verbatim into a prompt an agent with repository write access runs. The builder now treats a value outside a repository, path or ref shape as unknown.{{on every list and retrieve (8.4 s on 40k characters). It is now a forward scan (4 ms on 200k).change_prompt_variables.&or</title.<pre>one.message template duplicatednow also fires on "Duplicate with my changes" and the library card.01cbef1d39e. Final read 1 caught it, and158cccc1401restores them byte for byte.Proof (HEAD
0960e3de116)069216473b7andfa25e693a33:004b1bdc322,3ae1cce0091and0960e3de116came after the last browser run. Their proof is the render and API tests.mypyclean, ruff clean;tsgoclean; TemplateLibrary + Git jest 9 suites, 111 tests;hogli build:openapiregenerated; pre-pushci:preflight --strict0 failures.Calls made (🤖, also in the PR's Decisions block)
qa-swarminstead of a single review: the diff touches the public API contract and dependencies.change_prompt_variables, so one scanner owns the variable list.For stack B (#517,
spec/template-request-change)Merging this branch changes things stack B builds on:
changePromptVariableCountis gone fromcodeManagedTemplate.ts. The copied event readschange_prompt_variables.length.TemplateChangePrompthas a requiredvariablesfield.AgentPrompt, "Copy prompt" now sits above "Show full prompt". "Run with PostHog Code" (Run with PostHog Code from the Edit with your agent popover #514) goes next to it.<div>, not a<pre>. The root isrole="dialog"and takes acontainerRef.onClickOutsideignores pointer presses on the trigger.change_prompt.Follow-ups
Popover.tsxnever callsrefs.setReference, so a press on any popover's own trigger counts as outside. The trigger's click then reopens the popover. "Quick start" in the same header does the same.CodeManagedSource.tsxstill renders an injected source value as a link in the page header. It should apply the same shape rule.LemonCollapseinside aPopoverstays unpainted in Chromium. Other popovers with collapsible scrolling content may show it.message template duplicatedevent has no test.messageTemplatesLogichas no test file.